摘要: 0范数: 向量中非零元素的个数。 1范数: 为绝对值之和。 2范数: 通常意义上的模。 无穷范数:取向量的最大值。 行范数:矩阵中每行绝对值之和的最大值 列范数:矩阵中每列绝对值之和的最大值 阅读全文
posted @ 2022-02-11 16:33 Uriel-w 阅读(371) 评论(0) 推荐(0)
摘要: 来源:https://www.cnblogs.com/LeftNotEasy/archive/2011/01/19/svd-and-applications.html 前言: 上一次写了关于PCA与LDA的文章,PCA的实现一般有两种,一种是用特征值分解去实现的,一种是用奇异值分解去实现的。在上篇文 阅读全文
posted @ 2022-02-10 19:08 Uriel-w 阅读(719) 评论(0) 推荐(0)
摘要: 目前分类损失函数为何多用交叉熵,而不是 KL 散度。 首先损失函数的功能是通过样本来计算模型分布与目标分布间的差异,在分布差异计算中,KL 散度是最合适的。但在实际中,某一事件的标签是已知不变的(例如我们设置猫的 label 为 1,那么所有关于猫的样本都要标记为 1),即目标分布的熵为常数。而根据 阅读全文
posted @ 2022-01-05 11:07 Uriel-w 阅读(273) 评论(0) 推荐(0)
摘要: BN回顾 #####首先Batch Normalization 中的Normalization被称为标准化,通过将数据进行平和缩放拉到一个特定的分布。BN就是在batch维度上进行数据的标准化。BN的引入是用来解决 internal covariate shift 问题,即训练迭代中网络激活的分布的 阅读全文
posted @ 2022-01-03 16:23 Uriel-w 阅读(51) 评论(0) 推荐(0)
摘要: 注意:下面缺少任何一个依赖包都不能安装成功,建议在线安装,让系统自动配置。CentOS和Ubuntu安装的包有所不同 Linux中离线下载软件包网站,主要提供RPM包:https://rpm.pbone.net/ ,https://pkgs.org/ 1、安装boost yum install bo 阅读全文
posted @ 2021-11-09 14:29 Uriel-w 阅读(411) 评论(0) 推荐(0)
摘要: 论文《TUPE》复现 原有的注意力计算公式拆分为四部分后发现,中间两部分(word-to-position, position-to-word)对于识别并没有什么明显的作用,并且第一部分(word-to-word)和第四部分论文提出将位置信息与词嵌入信息分离开选择各自的权重矩阵来更新参数,提出的原因 阅读全文
posted @ 2021-10-28 14:25 Uriel-w 阅读(139) 评论(0) 推荐(1)
摘要: import os import pickle from tqdm import tqdm from config import wav_folder, transcript_file, pickle_file from utils import ensure_folder def get_data 阅读全文
posted @ 2021-10-19 19:48 Uriel-w 阅读(104) 评论(0) 推荐(0)
摘要: import torch.nn as nn from .decoder import Decoder from .encoder import Encoder class Transformer(nn.Module): #定义类,继承父类nn.Module """An encoder-decoder 阅读全文
posted @ 2021-10-19 19:46 Uriel-w 阅读(138) 评论(0) 推荐(0)
摘要: import torch import torch.nn as nn import torch.nn.functional as F from config import IGNORE_ID from .attention import MultiHeadAttention from .module 阅读全文
posted @ 2021-10-19 19:46 Uriel-w 阅读(183) 评论(0) 推荐(0)
摘要: import numpy as np import torch import torch.nn as nn class MultiHeadAttention(nn.Module): ''' Multi-Head Attention module ''' def __init__(self, n_he 阅读全文
posted @ 2021-10-19 19:45 Uriel-w 阅读(77) 评论(0) 推荐(0)
摘要: import torch.nn as nn from .attention import MultiHeadAttention #引进多头注意力模块 from .module import PositionalEncoding, PositionwiseFeedForward #位置编码和前馈网络 阅读全文
posted @ 2021-10-19 19:44 Uriel-w 阅读(233) 评论(0) 推荐(0)
摘要: import numpy as np import torch # from torch.utils.tensorboard import SummaryWriter import torch.nn as nn import argparse from tqdm import tqdm from c 阅读全文
posted @ 2021-10-19 19:42 Uriel-w 阅读(199) 评论(0) 推荐(0)
摘要: 2021-09-23至2021-10-30关于transformer的学习 Transformer的提出解决了两个问题: (1) 首先它使用了Attention机制,将序列中的任意两个位置之间的距离是缩小为一个常量; (2) 其次它不是类似RNN(不能并行)的顺序结构,因此具有更好的并行性,符合现有 阅读全文
posted @ 2021-09-30 20:43 Uriel-w 阅读(612) 评论(0) 推荐(0)
摘要: import argparse #参数解析包 import torch #张量、加减乘除等运算,相当于numpy import torch.nn as nn #包括各种函数 import torch.nn.functional as F #包括激活函数,损失函数等 import torch.opti 阅读全文
posted @ 2021-09-15 17:14 Uriel-w 阅读(251) 评论(0) 推荐(1)
摘要: CUDA版本是 9.1.83,python版本3.6.5 win10 使用如下语句可以安装cu91版本的pytorch pip3 install http://download.pytorch.org/whl/cu91/torch-0.4.0-cp36-cp36m-win_amd64.whl 然而下 阅读全文
posted @ 2021-09-07 10:45 Uriel-w 阅读(803) 评论(0) 推荐(0)