自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(61)
  • 资源 (23)
  • 收藏
  • 关注

原创 pytorch1.4+tensorboard不显示graph计算图的问题

电脑安装的pytoch版本为1.4,tensorboard无法显示计算图graph,但可以显示scalar。 经过多方查证为pytorch版本问题,目前graph显示仅支持到pytorch1.3。 处理如下: (1)卸载当前的pytorch并安装低版本1.3.1版本 卸载当前的高版本,cmd中输入: pip uninstall torch 安装低版本,采用离线安装的方式。 从连接https://...

2020-04-23 22:36:17 1282 1

原创 pytorch: where、gather函数

** 一、where函数 ** torch.where(condition,x,y) out = x,if condition is 1 = y ,if condition is 0 In [29]: cond = torch.rand(2,2) In [30]: cond Out[30]: tensor([[0.1326, 0.4126], [0.7093, 0.5339]])...

2019-10-24 14:42:31 4559

原创 pytorch:属性统计

** 一、求范数 ** torch.norm(p,dim) In [1]: import torch In [2]: a = torch.full([8],1) In [3]: a Out[3]: tensor([1., 1., 1., 1., 1., 1., 1., 1.]) In [4]: b = a.view(2,4) In [5]: b Out[5]: tensor([[1., 1...

2019-10-24 11:44:08 755

原创 pytorch:tensor的运算

** 一、加减乘除 ** torch.add / torch.sub / torch.mul / torch.div 分别为矩阵对应元素的加减乘除 与使用符号±*/功能相同 //表示整除 In [1]: import torch In [2]: a = torch.rand(3,4) In [3]: b = torch.rand(4) In [4]: a+b Out[4]: tensor([...

2019-10-22 14:40:43 2635

原创 pytorch拼接与拆分

** 一、拼接 ** cat/stack cat在指定的维度上进行连接; stack创建了新的维度进行连接。 In [1]: import torch In [2]: a = torch.rand(4,32,8) In [3]: b = torch.rand(5,32,8) In [4]: torch.cat([a,b],dim=0).shape Out[4]: torch.Size([9,...

2019-10-22 12:38:05 3116

原创 pytorch维度变换

一、view/reshape In [1]: import torch In [2]: a = torch.rand(4,1,28,28) In [3]: a.shape Out[3]: torch.Size([4, 1, 28, 28]) In [4]: a.view(4,28*28) Out[4]: tensor([[0.3060, 0.2680, 0.3763, ..., 0.659...

2019-10-22 11:20:30 539

原创 pytorch的索引与切片

** 一、从左边开始索引 ** In [12]: a = torch.rand(4,3,28,28) In [13]: a.shape Out[13]: torch.Size([4, 3, 28, 28]) In [14]: a[0].shape Out[14]: torch.Size([3, 28, 28]) In [15]: a[0,0].shape Out[15]: torch.Siz...

2019-10-21 18:06:32 614

原创 pytorch创建tensor

** 一、import from numpy ** In [40]: a = np.array([2,3.3]) In [41]: a Out[41]: array([2. , 3.3]) In [42]: b = torch.from_numpy(a) In [43]: b Out[43]: tensor([2.0000, 3.3000], dtype=torch.float64) In...

2019-10-21 16:59:28 2936

原创 pytorch tensor的数据类型

一、维度为0的标量 一般用于loss计算 In [1]: import torch In [2]: a = torch.tensor(1.)#维度为0 In [3]: b = torch.tensor(1.3) In [4]: c = torch.tensor(2.2) In [5]: a.shape,b.shape,c.shape Out[5]: (torch.Size([]), tor...

2019-10-21 15:44:26 247

原创 TensorFlow2.0:模型的保存与加载

** 一、权重参数的保存与加载 ** network.save_weights('weights.ckpt') network.load_weights('weights.ckpt') 权重参数的保存与加载可以针对任何模型,包括自定义的。 但是在加载权重参数时,其模型的结构需要与原来的完全一致。 import tensorflow as tf from tensorflow import ker...

2019-09-11 09:33:28 2894

原创 TensorFlow2.0:自定义层与自定义网络

自定义层函数需要继承layers.Layer,自定义网络需要继承keras.Model。 其内部需要定义两个函数: 1、__init__初始化函数,内部需要定义构造形式; 2、call函数,内部需要定义计算形式及返回值。 #self def layer class MyDense(layers.Layer):#inherit layers.Layer def __init__(self,i...

2019-09-11 08:45:20 3288

原创 TensorFlow2.0:keras.compile与fit的使用

import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers,datasets,optimizers,Sequential,metrics def preprocess(x,y): x = tf.cast(x,dtype=tf.float32)/255. x = t...

2019-09-10 16:17:50 2987

原创 TensorFlow2.0: keras.metrics的使用

keras.metrics中有两个api函数可以简化准确率acc和损失值loss的计算。其分别是metrics.Accuracy( )和metrics.Mean( )。 一、建立测量尺 #建立测量尺 acc_meter = metrics.Accuracy() loss_meter = metrics.Mean() 二、更新数据 loss_meter.update_state(loss) acc...

2019-09-10 15:09:07 8187 2

原创 TensorFlow2.0:tensorboard使用

** 一、tensorboard的安装 ** 使用命令pip install tensorboard ** 二、使用方法 ** 2.1、启动listener 在项目所在的目录创建文件夹logs用于存放监听数据 使用命令行中定位到项目所在的文件夹,并使用命令tensorboard --logdir logs启用listener 使用浏览器输入localhost:6006打开端口 2.2、使用代码...

2019-09-10 14:59:04 4430

原创 TensorFlow2.0:单层感知机梯度计算

** 一 单层单输出感知机梯度计算 ** 单层感知机指的是输入有多个节点,输出只有一个节点. 其实质为二分类,即将样本的多个特征值作为输入,输出为二分类. 假设输入有5个样本,每个样本有3个特征参数,样本的标签值为[0,1,0,1,0]. 那么x的维度为[5,3],y的维度为[5]. 其中感知机参数设置为:w的维度为[3,1],b的维度为[3]. 由于为单输出,因此输出层可以使用sigmoid激...

2019-08-22 11:13:30 773

原创 TensorFlow2.0:梯度计算

** 一 2阶梯度的计算 ** 将需要计算梯度的变量设置为tf.Variable( ),并将计算函数置于with tf.GradientTape ( ) as tape内. import tensorflow as tf x = tf.Variable(tf.constant([2.])) w = tf.Variable(tf.constant([2.])) b = tf.Variable(t...

2019-08-22 10:46:00 4660

原创 TensorFlow2.0:误差计算

** 一 MSE(Mean Square Error)均方误差 ** In [2]: out = tf.random.normal([5,4]) In [3]: y = tf.constant([1,2,3,0,2]) ...

2019-08-20 12:29:21 977

原创 TensorFlow2.0:常用数据范围压缩函数

** 一 tf.nn.relu( )函数 ** tf.nn.relu( )激活函数可以将小于0的数据变成0,大于0的数据保持不变. In [2]: a = tf.constant([-1,-2,0,1,2]) ...

2019-08-20 10:57:56 966

原创 TensorFlow2.0:高阶操作

** 一 tf.where( )函数 ** tf.where(tensor) 当只有一个输入时,输入为布尔型,其返回的是值为True的位置. In [3]: a = tf.random.normal([3,3])#生成3行3列的随机数组 ...

2019-08-19 12:05:12 226

原创 TensorFlow2.0:张量限幅

** 一 tf.clip_by_value( )函数 ** tf.maximum(a,b)返回a和b之间的最大值 tf.minimum(a,b)返回a和b之间的最小值 tf.clip_by_value(t, clip_value_min, clip_value_max, name=None)限制tensor t中张量的最小值为clip_value_min,张量的最大值为clip_value_max...

2019-08-19 10:51:21 378

原创 TensorFlow2.0:数据的填充与复制

** 一 tf.pad( )填充函数 ** tf.pad(tensor, paddings, mode="CONSTANT", name=None, constant_values=0): paddings参数的设置方法: 假设输入tensor有两个维度,则paddings参数设置为paddings = [[a,b],[c,d]] a,b表示为axis=0维度上最前面填充a行,最后面填充b行,...

2019-08-19 10:16:59 1546

原创 TensorFlow2.0:张量排序

一 sort argsort排序 tf.sort( )按照升序或者降序对张量进行排序 tf.argsort( )按照升序或者降序对张量进行排序,但返回的是索引 In [4]: a = tf.range(5) In [5]: a ...

2019-08-19 09:36:54 2187

原创 TensorFlow2.0:数据统计

** 一 tf.norm( )函数–求范数 ** In [30]: a = tf.ones([2,2]) ...

2019-08-13 18:24:43 403

原创 TensorFlow2.0:张量的合并与分割

** 一 tf.concat( ) 函数–合并 ** In [2]: a = tf.ones([4,35,8]) In [3]: b = tf.ones([2,35,8]) In [4]: c...

2019-08-13 16:40:01 2672

原创 TensorFlow2.0:张量的数学运算

(1)+ - * / (2)** pow square (3) sqrt (4) // % (5) exp log (6)@ matmul (7) linear layer element-wise: + - * / matrix-wise: @ matmul dim-wise: reduce_mean/max/min/sum ** 一 + - * / % //运算 ** +:对应矩阵元素相加 ...

2019-08-13 10:15:15 4844

原创 TensorFlow2.0:维度变换

** 一 reshape函数 重排列 ** In [1]: import tensorflow as tf In [2]: a = tf.random.normal([4,28,28,3],mean=1,stddev=1) In [3]: a.shap...

2019-08-13 09:29:46 1090

原创 TensorFlow2.0:索引和切片(2)

** 一 tf.gather( ) 函数 ** –tf.gather(params, indices, validate_indices=None, name=None, axis=0) params:待切片的参数 indices:取出数据所在的位置 axis:指定切片数据所在的维度 tf.gather(a,axis=0,indices=[2,3]): 对参数a进行切片, 对维度0进行操作,将维度...

2019-08-13 08:36:15 1076

原创 TensorFlow2.0:创建tensor

** 一 从numpy list中得到tensor ** —tf.convert_to_tensor() In [1]: import tensorflow as tf In [2]: import numpy as np ...

2019-08-12 16:58:23 271

原创 TensorFlow2.0:索引和切片(1)

** 一 基本的索引方式 ** 给定每个维度的索引,直接进行索引 In [1]: import tensorflow as tf In [2]: import numpy as np ...

2019-08-12 16:57:50 292

原创 Tensorflow2.0数据类型

** 一 Tensorflow的类型 ** --int, float, double --bool --tring In [1]: import tensorflow as tf In [2]: import numpy as np ...

2019-08-12 10:06:44 1488

原创 吴恩达RNN编程作业:Character level language model - Dinosaurus land

Welcome to Dinosaurus Island! 65 million years ago, dinosaurs existed, and in this assignment they are back. You are in charge of a special task. Leading biology researchers are creating new breeds of...

2019-08-06 19:08:53 841

原创 吴恩达RNN作业:Building your Recurrent Neural Network - Step by Step

Building your Recurrent Neural Network - Step by Step Welcome to Course 5’s first assignment! In this assignment, you will implement your first Recurrent Neural Network in numpy. Recurrent Neural Netw...

2019-08-06 16:37:06 661

原创 吴恩达CNN作业:Face Recognition for the Happy House

Welcome to the first assignment of week 4! Here you will build a face recognition system. Many of the ideas presented here are from FaceNet. In lecture, we also talked about DeepFace. Face recognition...

2019-08-05 11:20:31 653

原创 吴恩达CNN卷积神经网络第2周作业ResNets

2019-08-02 11:33:12 276

原创 吴恩达CNN卷积神经网络第二周作业Keras Tutorial

2019-08-01 08:55:20 285

原创 吴恩达深度学习CNN作业:Convolutional Neural Networks: Application

2019-07-31 10:39:46 590

原创 吴恩达深度学习CNN作业:Convolutional Neural Networks: Step by Step

2019-07-30 18:58:46 562

原创 吴恩达深度学习编程作业:TensorFlow

2019-07-24 17:14:06 719

原创 吴恩达深度学习的改善深层神经网络编程作业:优化Optimization

2019-07-23 09:57:38 188

原创 吴恩达深度学习的实用层面编程作业:正则化Regularization

2019-07-22 08:46:51 450

吴恩达RNN编程作业:Character level language model - Dinosaurus land

吴恩达RNN编程作业:Character level language model - Dinosaurus land

2019-08-06

吴恩达机器学习作业ex2

https://blog.youkuaiyun.com/meijie2018_1/article/details/89737570 https://blog.youkuaiyun.com/meijie2018_1/article/details/89839067

2019-06-04

吴恩达CNN卷积神经网络第2周作业ResNets

吴恩达CNN卷积神经网络第二周作业ResNets

2019-08-01

正则化Regularization

正则化Regularization正则化Regularization正则化Regularization

2019-07-22

吴恩达CNN第一周作业

吴恩达CNN第一周作业

2019-07-31

吴恩达机器学习ex7

https://blog.youkuaiyun.com/meijie2018_1/article/details/94428540 https://blog.youkuaiyun.com/meijie2018_1/article/details/94397704

2019-07-22

吴恩达机器学习作业ex6

https://blog.youkuaiyun.com/meijie2018_1/article/details/90712557

2019-06-04

吴恩达RNN作业:Building your Recurrent Neural Network - Step by Step

吴恩达RNN作业:Building your Recurrent Neural Network - Step by Step

2019-08-06

吴恩达机器学习作业ex4

https://blog.youkuaiyun.com/meijie2018_1/article/details/90287938 https://blog.youkuaiyun.com/meijie2018_1/article/details/90368652

2019-06-04

吴恩达机器学习作业ex3

https://blog.youkuaiyun.com/meijie2018_1/article/details/89921499 https://blog.youkuaiyun.com/meijie2018_1/article/details/90201184

2019-06-04

吴恩达机器学习作业ex5

https://blog.youkuaiyun.com/meijie2018_1/article/details/90667876

2019-06-04

吴恩达机器学习ex8

https://blog.youkuaiyun.com/meijie2018_1/article/details/94552895 https://blog.youkuaiyun.com/meijie2018_1/article/details/95043904

2019-07-22

初始化Initialization

初始化Initialization初始化Initialization初始化Initialization

2019-07-22

吴恩达CNN卷积神经网络第二周作业Keras Tutorial.rar

吴恩达CNN卷积神经网络第二周作业Keras Tutorial.rar

2019-08-01

优化Optimization.rar

吴恩达神经网络与深度学习编程作业:优化Optimization

2019-07-24

TensorFlow.rar

吴恩达深度学习编程作业:TensorFlow 吴恩达深度学习编程作业:TensorFlow

2019-07-24

梯度检验Gradient Checking

梯度检验Gradient Checking梯度检验Gradient Checking

2019-07-22

Python Basics with Numpy

Python Basics with Numpy Python Basics with Numpy Python Basics with Numpy

2019-07-22

Deep Neural Network Application - Image Classification

Deep Neural Network Application - Image Classification

2019-07-22

Planar data classification with one hidden layer

Planar data classification with one hidden layer Planar data classification with one hidden layer

2019-07-22

Building your Deep Neural Network - Step by Step

Building your Deep Neural Network - Step by Step Building your Deep Neural Network - Step by Step

2019-07-22

Logistic Regression as a Neural Network

Logistic Regression as a Neural Network Logistic Regression as a Neural Network

2019-07-22

吴恩达机器学习作业ex1

吴恩达机器学习作业ex1源代码,matlab版。 https://blog.youkuaiyun.com/meijie2018_1/article/details/89705221 https://blog.youkuaiyun.com/meijie2018_1/article/details/89708790

2019-06-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除