08 2020 档案
摘要:MSE是mean squared error的缩写,即平均平方误差,简称均方误差。 MSE是逐元素计算的,计算公式为: 旧版的nn.MSELoss()函数有reduce、size_average两个参数,新版的只有一个reduction参数了,功能是一样的。reduction的意思是维度要不要缩减,
阅读全文
摘要:python创建包 Python包实际上是一个文件夹,只不过这个文件夹必须包含__init__.py文件。__init__.py文件可以自己手动创建。 如果用pycharm来创建Python包的话,更方便一些,直接在project的任何一个地方右键,选择new --> python package,
阅读全文
摘要:PyTorch 训练 RNN 时,序列长度不固定怎么办? pytorch中如何在lstm中输入可变长的序列 上面两篇文章写得很好,把LSTM中训练变长序列所需的三个函数讲解的很清晰,但是这两篇文章没有给出完整的训练代码,并且没有写关于带label的情况,为此,本文给出一个完整的带label的训练代码
阅读全文
摘要:Understanding Model Validation for Classification
阅读全文
摘要:a = {'John': 60, 'Alice': 95, 'Paul': 80, 'James': 75, 'Bob': 85} # 问题:如何找出得75分的那个同学? # 方法一:利用 keys() 、values()、index() 函数 name = list(a.keys())[list(
阅读全文
摘要:import numpy as np # Save dictionary = {'hello':'world'} np.save('my_file.npy', dictionary) # Load read_dictionary = np.load('my_file.npy').item() pri
阅读全文
摘要:方法一 摘自Python查找列表中某个元素返回所有下标 方法二 name = ['hello', 'world', 'a', 'b', 'c', 1, 2, 3, 'hello', 'world', 'a', 'b', 'c', 1, 2, 3] first_pos = 0 for i in ran
阅读全文
摘要:摘自:Sener, Ozan, et al. "Unsupervised semantic parsing of video collections." Proceedings of the IEEE International Conference on Computer Vision. 2015
阅读全文
摘要:二分图定义 二分图又称作二部图,是图论中的一种特殊模型。 设G=(V,E)是一个无向图,如果顶点V可分割为两个互不相交的子集(A,B),并且图中的每条边(i,j)所关联的两个顶点i和j分别属于这两个不同的顶点集(i in A,j in B),则称图G为一个二分图。简而言之,就是顶点集V可分割为两个互
阅读全文
摘要:个人主页及文章代码 Hongsong Wang, 王洪松 Beyond Joints: Learning Representations from Primitive Geometries for Skeleton-based Action Recognition and Detection, co
阅读全文
摘要:Python计算程序运行时长可用time模块。 例子: import time start = time.time() for i in range(10000000): pass stop = time.time() running_time = stop - start print('runni
阅读全文
摘要:scikit-learn中的KMeans聚类实现( + MiniBatchKMeans)
阅读全文
摘要:np.append()函数用法
阅读全文
摘要:本文摘自前两个截图来自python--之np.delete
阅读全文
摘要:一. 普通全连接神经网络的计算过程 假设用全连接神经网络做MNIST手写数字分类,节点数如下: 第一层是输入层,784个节点; 第二层是隐层,100个节点; 第三层是输出层,10个节点。 对于这个神经网络,我们在脑海里浮现的可能是类似这样的画面: 但实际上,神经网络的计算过程,本质上是输入向量(矩阵
阅读全文
摘要:注:本篇博客介绍的方法有点繁琐,建议采用另外一篇博客中介绍的方法:Pycharm远程连接服务器(或者docker) 第一步:配置deployment 点击 tools --> Deployment --> Configuration 弹出如下对话框,点击左上角的 ‘+’,选择SFTP,,在弹出的小对
阅读全文
摘要:Pytorch之permute函数
阅读全文
摘要:torch.nn.lstm()接受的数据输入是(序列长度,batchsize,输入维数),使用batch_first=True,可以使lstm接受维度为(batchsize,序列长度,输入维数)的数据输入,同时,lstm的输出数据维度也会变为batchsize放在第一维(可参考这篇博客)。
阅读全文
摘要:在用PyTorch保存模型时,常常会遇到UserWarning: Couldn't retrieve source code for container of type Net. It won't be checked for correctness upon loading."type " + o
阅读全文
摘要:airflights passengers dataset下载地址https://raw.githubusercontent.com/jbrownlee/Datasets/master/airline-passengers.csv 这个dataset包含从1949年到1960年每个月的航空旅客数目,
阅读全文
摘要:数据归一化 minmax_scale()函数解析 例子: import numpy as np from sklearn.preprocessing import MinMaxScaler a = np.arange(20).reshape(4, 5) ms = MinMaxScaler(featu
阅读全文
摘要:scikit-learn数据预处理fit_transform()与transform()的区别
阅读全文
摘要:pandas dataframe 提取行和列
阅读全文
摘要:参考一: PyTorch中LSTM的输出格式 该文章的核心内容截图如下: 总的结论: 注意:如果在搭建lstm网络时使用了batch_first=True,则lstm网络不仅接受的数据第一维是batch,而且输出的结果中,batch也会在第一维,即 output's shape (batch, se
阅读全文
摘要:torch.nn.Module()类有一些重要属性,我们可用其下面几个属性来实现对神经网络层结构的提取: torch.nn.Module.children() torch.nn.Module.modules() torch.nn.Module.named_children() torch.nn.Mo
阅读全文
摘要:python中以下划线开头的变量名的特点
阅读全文
摘要:从2D卷积到3D卷积,都有什么不一样(动态图演示) 3D卷积(3D Convolution) 论文笔记:基于3D卷积神经网络的人体行为识别(3D CNN) 理解3D CNN 第一种理解方式: 视频输入的维度:input_C x input_T x input_W x input_H;3D卷积核的维度
阅读全文
摘要:Pytorch:利用预训练好的VGG16网络提取图片特征
阅读全文
摘要:Image size after convolusion: where n is the width (or height) of the image, k is the kernel size, p is the padding, s is the str
阅读全文
摘要:Python3 中 sys.argv[ ]的用法解释
阅读全文
摘要:Weizmann Dataset 摘自 2016-Review of Action Recognition and Detection Methods 【这篇综述里有较全面的数据集介绍】 The Weizman dataset was recorded by static camera with c
阅读全文
摘要:用卷积神经网络实现对手写数字的识别,代码来自莫烦TensorFlow教程。 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_
阅读全文
摘要:通过TensorFlow用神经网络实现对二次函数的拟合。代码来自莫烦TensorFlow教程。 1 import tensorflow as tf 2 import numpy as np 3 4 def add_layer(inputs, in_size, out_size, activation
阅读全文
摘要:1. TensorFlow核心理解 TensorFlow本质上是一张计算图,数据在图上计算和流动。 写TensorFlow程序,需要: 构建一张计算图; 运行会话,执行图中的运算。 2. TensorFlow的几个概念 图(Graph):用来表示计算任务,也就我们要做的一些操作。 会话(Sessio
阅读全文