科学网

 找回密码
  注册
[转载]Python numpy模块:transpose以及swapaxes函数(矩阵理解及性能)
张伟 2020-11-13 20:18
一、前言 众所周知,python的numpy模块在数据分析中占有重要的地位,因其所定义的 ndarray (n-dimensional array,多维数组)对象比之python基本类库所定义的 list 对象而言,具有更高的灵活性和更广的适用范围。更重要的是,由于numpy模块是用C语言编写的,因此计算机在处理 ndarray 对 ...
个人分类: Python|2611 次阅读|没有评论
import torchnet as tnt
张伟 2020-11-13 16:49
主要介绍torchnet中的常用模块方法 github网址: https://github.com/facebookarchive/torchnet import torchnet as tnt acc_meter = tnt.meter.ClassErrorMeter(accuracy=True) #计算精度 loss_meter = tnt.meter.AverageValueMeter() #计算存储数据的均值和标准差 (1)acc_meter使用示例 pred=torch.Tensor( ...
个人分类: Pytorch|3384 次阅读|没有评论
高性能图像处理库Pillow-SIMD
张伟 2020-11-11 23:11
推荐博客: https://www.jianshu.com/p/b71844bb0db5 Pillow-SIMD:经过针对SIMD(单指令多数据)指令优化的Pillow包 Pillow-SIMD vs Pillow, AVX2的Pillow-SIMD几乎比Pillow快3~10倍 Pillow-SIMD vs others Pillow-SIMD 与 Pillow不能共存,安装Pillow-SIMD前,请先卸载掉Pillow pip uninstall pillow ...
个人分类: 机器学习|2725 次阅读|没有评论
池化总结
张伟 2020-11-10 23:13
推荐博客: https://blog.csdn.net/u013289254/article/details/99080916 https://blog.csdn.net/mrcharles/article/details/105299448 主要包括的池化是:mean-pooling(平均池化),max-pooling(最大池化)、Stochastic-pooling(随机池化)和global average pooling(全局平均池 ...
个人分类: 机器学习|7976 次阅读|没有评论
Pytorch采样器详解--结合DataLoader使用
张伟 2020-11-9 16:21
Pytorch采样器详解--结合DataLoader使用,产生选取样本的随机编号,用于抽样!! traindataloader = torch.utils.data.DataLoader(dataset=traindataset, sampler= RandomSampler(traindataset) ,   ...
个人分类: Pytorch|3510 次阅读|没有评论
Scipy randint 与 Numpy randint 的区别
张伟 2020-11-9 09:38
推荐两篇博客: https://blog.csdn.net/u011292816/article/details/97172242 https://blog.csdn.net/qq_28611929/article/details/89601654 点滴分享,福泽你我!Addoil!
个人分类: Python|1481 次阅读|没有评论
Python中@staticmethod、@classmethod、@property
张伟 2020-11-8 21:13
(1)@staticmethod staticmethod用于修饰类中的方法,使其可以在 不创建类实例的情况下调用方法 , 这样做的好处是执行效率比较高 。(类比其实就是C++里面的静态方法)当然,也可以像一般的方法一样用实例调用该方法。 该方法一般被称为静态方法。静态方法 ...
个人分类: Python|4778 次阅读|没有评论

本页有 3 篇博文因作者的隐私设置或未通过审核而隐藏

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-19 12:27

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部