![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
机器学习
qq_34535410
这个作者很懒,什么都没留下…
展开
-
【无标题】
timmm 库 optimizer lr原创 2022-06-10 15:48:23 · 688 阅读 · 0 评论 -
Pycharm设置Default Server
Pycharm设置Default Server原创 2019-01-11 17:04:46 · 4025 阅读 · 3 评论 -
数据增强操作
将图片分成小块# -*- coding: utf-8 -*-"""@Author : zhwzhong@License : (C) Copyright 2013-2018, hit@Contact : zhwzhong.hit@gmail.com@Software: PyCharm@File : ImgToPatch.py@Time : 201...原创 2019-01-16 21:13:53 · 519 阅读 · 0 评论 -
Python 递归获取文件夹里所有文件
递归获取root文件夹里所有mat文件:# -*- coding: utf-8 -*-"""@Author : zhwzhong@License : (C) Copyright 2013-2018, hit@Contact : zhwzhong.hit@gmail.com@Software: PyCharm@File : mean_and_std.py@...原创 2019-01-22 20:21:34 · 1801 阅读 · 0 评论 -
docker pycharm远程访问找不到cudnn lib 的问题
在终端输入python输入:import osprint(os.environ.get('CUDA_HOME'))print(os.environ.get('LD_LIBRARY_PATH'))获取本机环境变量地址,然后添加到pycharm环境变量中。原创 2019-03-01 16:04:20 · 519 阅读 · 0 评论 -
AutoEncoder-PyTorch
import osimport h5pyimport shutilimport torch as timport numpy as npimport torch.nn as nnimport torchnet as tntfrom torchvision import transformsfrom torch.utils import datafrom tensorboardX ...原创 2019-03-28 21:20:22 · 368 阅读 · 2 评论 -
Metrics2
# -*- coding: utf-8 -*-"""@Author : zhwzhong@License : (C) Copyright 2013-2018, hit@Contact : zhwzhong.hit@gmail.com@Software: PyCharm@File : metrics.py@Time : 2018/10/8 09:4...原创 2019-04-13 09:29:34 · 751 阅读 · 0 评论 -
Non-local blcok (self-attention)
# -*- coding: utf-8 -*-"""@Author : zhwzhong@License : (C) Copyright 2013-2018, hit@Contact : zhwzhong.hit@gmail.com@Software: PyCharm@File : nlrn.py@Time : 2019/5/5 16:27@D...转载 2019-05-05 17:24:23 · 1531 阅读 · 0 评论 -
Pytorch统计参数网络参数数量
def get_parameter_number(net): total_num = sum(p.numel() for p in net.parameters()) trainable_num = sum(p.numel() for p in net.parameters() if p.requires_grad) return {'Total': total_num, ...原创 2019-04-30 20:11:08 · 11979 阅读 · 1 评论 -
python 可视化光流
def make_color_wheel(): """ Generate color wheel according Middlebury color code :return: Color wheel """ RY = 15 YG = 6 GC = 4 CB = 11 BM = 13 MR = 6 ncol...原创 2019-05-08 21:41:31 · 9830 阅读 · 10 评论 -
Python 计算SSIM偏低的问题
在DnCNN中利用skimage.measure.comssim(),计算SSIM时data_range不应手动设置原创 2019-05-20 19:54:02 · 1453 阅读 · 1 评论 -
makefile 使用
makefile 使用https://blog.csdn.net/wcl199274/article/details/39140459转载 2018-09-19 22:27:20 · 166 阅读 · 0 评论 -
在Ubuntu的左侧启动栏添加应用程序
链接地址: https://blog.csdn.net/gavin_8724/article/details/72857759转载 2018-09-14 10:32:03 · 2848 阅读 · 0 评论 -
Pytorch快速入门一-Tensor
TensorVariableTensor Tensor 可以简单地认为是一个数组,且支持高效的科学计算。基础操作: 从接口的角度讲,对tensor可以分为两类: torch.function,如torch.add(a,b)tensor.function,如a.add(b)这两种功能是等价的。从存储角度讲,可以分为以下两类: 不会修改自身的数据,如...原创 2018-03-09 21:32:34 · 10723 阅读 · 0 评论 -
Numpy与统计学
Numpy产生随机数 Random模块提供了许多产生符合特定随机分布的随机数的函数,他们的最后一个参数size都用于指定输出数组的形状,而其他参数都是分布函数的参数。normal():正态分布,前两个参数分别为期望和标准差。uniform():均与分布,前两个参数分别为区间的起始值和终值。possion():泊松分布,第一个参数是 λ\lambda系数,表示单位时间内随机事件的平均发生率。原创 2016-12-20 20:10:12 · 783 阅读 · 0 评论 -
python Scipy模块
求解非线性方程组。 比如求解: cos(a) = 1 - d^2 / (2*R^2) L = a * r from math import cosfrom scipy import optimizedef f(x): d = 140 l = 156 a, r = x.tolist() return [原创 2016-12-22 11:15:21 · 9029 阅读 · 1 评论 -
Python as_stried函数
# -*- coding: utf-8 -*-__author__ = 'zzw'import numpy as npfrom numpy.lib.stride_tricks import as_strideda = np.arange(9).reshape(3,3)b = as_strided(a,shape=(2, 2, 2, 2), strides=(a.itemsize*np.arr原创 2016-12-18 09:28:33 · 607 阅读 · 0 评论 -
Numpy数组基础
Numpy 推荐的导入方式是 import numpy as npndarray对象 1.1创建:a = np.array([1,2,2])1.2可以通过shape属性获得数组形状。c = np.array([[1,2,3,4],[2,3,4,5],[3,4,5,6]])c.shape(3L,4L)1.3可以通过shape改变数组的属性。c.shape = 4,3print c[[1 2原创 2016-12-19 09:36:21 · 2614 阅读 · 0 评论 -
python用matplotlib画图
1.使用pyplot模块画图。import matplotlib.pyplot as pltimport numpy as npx = np.linspace(0, 10, 1000)y = np.sin(x)z = np.cos(x**2)plt.figure(figsize=(8, 5))plt.plot(x, y, label="$sin(x)$", color="red", li原创 2016-12-22 20:59:12 · 3297 阅读 · 0 评论 -
ROC曲线
先来一个简单的例子:from sklearn.metrics import roc_curve, aucimport matplotlib.pyplot as pltimport numpy as npimport numpy.random as rsize = 1000000y_pred = r.random(size)y_true = np.array([ 1 if i >= 0.5原创 2017-03-16 20:39:08 · 769 阅读 · 0 评论 -
python并行计算
if __name__ == '__main__': arr = loadtxt("c:\\train_save.csv", delimiter=',', usecols=(3, 4, 5)) start = 0 end = len(arr) print type(arr) ppservers = () #job_server = pp.Server(原创 2017-04-03 15:45:16 · 276 阅读 · 0 评论 -
Pytorch实现简单的回归
# -*- coding: utf-8 -*-# @Time : 2018/1/17 18:48# @Author : Zhiwei Zhong# @Site : 回归# @File : Regression.py# @Software: PyCharmimport torchfrom torch.autograd import Variableimport t原创 2018-01-17 19:16:59 · 641 阅读 · 0 评论 -
pytorch和Numpy的区别以及相互转换
# -*- coding: utf-8 -*-# @Time : 2018/1/17 16:37# @Author : Zhiwei Zhong# @Site : # @File : Numpy_Pytorch.py# @Software: PyCharmimport torchimport numpy as npnp_data = np.arange(6)原创 2018-01-17 19:17:54 · 51525 阅读 · 1 评论 -
Pytorch中的Varible
# -*- coding: utf-8 -*-# @Time : 2018/1/17 18:36# @Author : Zhiwei Zhong# @Site : Variable 和 tensor 的区别# @File : Variable.py# @Software: PyCharmimport torchfrom torch.autograd import原创 2018-01-17 19:18:39 · 304 阅读 · 0 评论 -
Pytorch快速搭建神经网络
import torchnet = torch.nn.Sequential( torch.nn.Linear(2, 10), torch.nn.ReLU(), torch.nn.Linear(10, 2),)print(net)原创 2018-01-17 19:37:03 · 542 阅读 · 0 评论