- 博客(28)
- 资源 (1)
- 收藏
- 关注
原创 ubuntu16.04安装caffe时遭遇的一个问题
Caffe的安装依赖protoc2.6.1,我的电脑在 usr/bin/ 下已有版本2.6.1,但系统环境默认使用的是我通过anaconda3安装的protoc3版本。可以通过指令 sudo protoc --version 和 protoc --version 查看系统安装的和当前默认的protoc版本,以及使用指令 whereis protoc 查看相应路径,使用指令 which prot...
2018-12-13 15:57:36 248
原创 cs231n_2017_Style_Transfer
import torchimport torch.nn as nnfrom torch.autograd import Variableimport torchvisionimport torchvision.transforms as Timport PILimport numpy as npfrom scipy.misc import imreadfrom collect...
2018-07-23 21:32:42 458
原创 整理一波pytorch训练模型的流程
import torchimport torch.nn as nnimport torch.optim as optimfrom torch.autograd import Variablefrom torch.utils.data import DataLoaderfrom torch.utils.data import samplerimport torchvision.dat...
2018-07-19 17:33:32 5511
原创 cs231n_2017_pool_or_not
cs231n的官方课程笔记里,有提到如下内容:(译文来源:知乎https://zhuanlan.zhihu.com/p/22038289?refer=intelligentunit)不使用汇聚层:很多人不喜欢汇聚操作,认为可以不使用它。比如在Striving for Simplicity: The All Convolutional Net一文中,提出使用一种只有重复的卷积层组成的结构,抛弃汇...
2018-07-17 16:36:48 230
原创 cs231n_2017_visualize_filters
保存一段可视化滤波器/卷积核的代码:from cs231n.vis_utils import visualize_gridgrid = visualize_grid(model.params['W1'].transpose(0, 2, 3, 1))plt.imshow(grid.astype('uint8'))plt.axis('off')plt.gcf().set_size_inche...
2018-07-16 10:47:01 382
原创 cs231n_2017_max_pool_naive
max_pool_forward_naive:def max_pool_forward_naive(x, pool_param): """ A naive implementation of the forward pass for a max pooling layer. Inputs: - x: Input data, of shape (N, C, H, W...
2018-07-16 09:25:40 396
原创 cs231n_2017_conv_naive
conv_forward_naive:def conv_forward_naive(x, w, b, conv_param): """ A naive implementation of the forward pass for a convolutional layer. The input consists of N data points, each with C ...
2018-07-16 09:24:00 639
原创 cs231n_2017_spatial_batchnorm
spatial_batchnorm_forward:def spatial_batchnorm_forward(x, gamma, beta, bn_param): """ Computes the forward pass for spatial batch normalization. Inputs: - x: Input data of shape (N, ...
2018-07-16 09:22:19 1099
原创 记一次成功的 Ubuntu16.04.4 + Cuda9.0 + Cudnn7
半年前我曾发起过数次战役,尽管我知道笔记本的性能跑深度学习不是那么好,但我还是幻想拥有自己的可以跑GPU的深度学习便携式平台,于是有了十次左右的重装Ubuntu的惨痛经历(其实也不能说惨,过程中学到的东西还是不少的)。半年后还是不甘心想再尝试一下。功夫不负有心人,今天终于成功了。下面我就分享一下思路和经验:一、系统及基本环境:主要参照官网的documentation,一定要仔细看,不懂的地方goo...
2018-07-13 16:37:32 765
原创 cs231n_2017_FullyConnectedNet
这是一个全连接网络,结构为:{affine - [batch norm] - relu - [dropout]} x (L - 1) - affine - softmax(也是fc_net.py里面的一个网络,纯自己写)class FullyConnectedNet(object): """ Author::Chenx """ """ A fully-con...
2018-07-09 09:51:32 477
原创 cs231n_2017_TwoLayerNet
这是一个简单的两层网络:affine - relu - affine - softmax(关于网络结构的具体描述都在函数文档里了)from builtins import rangefrom builtins import objectimport numpy as npfrom cs231n.layers import *from cs231n.layer_utils import *...
2018-07-09 09:43:12 953
原创 cs231n_2017_gradient_check
关于梯度检测的一些代码及使用示例:五种gradient_check:from __future__ import print_functionfrom builtins import rangeimport numpy as npfrom random import randrangedef eval_numerical_gradient(f, x, verbose=True, h=0...
2018-07-09 09:15:58 975
原创 cs231n_2017_softmax_cross_entropy_loss
softmax_cross_entropy_loss:(交叉熵损失)def softmax_loss(x, y): """ Computes the loss and gradient for softmax classification. Inputs: - x: Input data, of shape (N, C) where x[i, j] is the ...
2018-07-08 16:13:44 437
原创 cs231n_2017_svm_hinge_loss
svm_hinge_loss: (折叶损失)def svm_loss(x, y): """ Computes the loss and gradient using for multiclass SVM classification. Inputs: - x: Input data, of shape (N, C) where x[i, j] is the sco...
2018-07-08 16:10:35 268
原创 cs231n_2017_solver
觉得 solver.py 拿来训练很好用,存一波:目录:solver.py , solver训练FullyConnectedNet , 外加一段可视化loss与accuracy函数的代码 。solver.py:from __future__ import print_function, divisionfrom builtins import rangefrom builtins ...
2018-07-08 16:06:16 603
原创 cs231n_2017_dropout_layer
dropout_forward:def dropout_forward(x, dropout_param): """ Performs the forward pass for (inverted) dropout. Inputs: - x: Input data, of any shape - dropout_param: A dictionary wi...
2018-07-08 15:42:34 211
原创 cs231n_2017_relu_layer
relu_forward:def relu_forward(x): """ Computes the forward pass for a layer of rectified linear units (ReLUs). Input: - x: Inputs, of any shape Returns a tuple of: - out: Out...
2018-07-08 15:39:40 430
原创 cs231n_2017_affine_layer
affine_forward:def affine_forward(x, w, b): """ Computes the forward pass for an affine (fully-connected) layer. The input x has shape (N, d_1, ..., d_k) and contains a minibatch of N ...
2018-07-08 15:37:45 1088
原创 cs231n_2017_update_rules
课程笔记及其翻译的网址:https://zhuanlan.zhihu.com/p/21930884?refer=intelligentunit一、SGD:def sgd(w, dw, config=None): """ Performs vanilla stochastic gradient descent. config format: - learning_r...
2018-07-08 15:33:12 272
原创 cs231n_2017_batchnorm
batchnorm_forward:相关的计算求导,参阅:( step4累加单元的反向传播划个重点 )https://kratzert.github.io/2016/02/12/understanding-the-gradient-flow-through-the-batch-normalization-layer.htmldef batchnorm_forward(x, gamma, beta,...
2018-07-08 11:18:37 310
原创 ml_ex8
ex8:%% Machine Learning Online Class% Exercise 8 | Anomaly Detection and Collaborative Filtering%% Initializationclear ; close all; clc%% ================== Part 1: Load Example Dataset =======...
2018-07-06 17:21:40 231
原创 ml_ex7
ex7:%% Machine Learning Online Class% Exercise 7 | Principle Component Analysis and K-Means Clustering%% Initializationclear ; close all; clc%% ================= Part 1: Find Closest Centroids =...
2018-07-06 17:18:13 191
原创 ml_ex6
ex6:%% Machine Learning Online Class% Exercise 6 | Support Vector Machines%% Initializationclear ; close all; clc%% =============== Part 1: Loading and Visualizing Data ================% Load f...
2018-07-06 17:13:06 554
原创 ml_ex5
ex5:%% Machine Learning Online Class% Exercise 5 | Regularized Linear Regression and Bias-Variance%% Initializationclear ; close all; clc%% =========== Part 1: Loading and Visualizing Data ====...
2018-07-06 17:07:25 310
原创 ml_ex4
ex4:%% Machine Learning Online Class - Exercise 4 Neural Network Learning%% Initializationclear ; close all; clc%% Setup the parameters you will use for this exerciseinput_layer_size = 400; % 2...
2018-07-06 17:02:09 206
原创 ml_ex3
ex3:%% Machine Learning Online Class - Exercise 3 | Part 1: One-vs-all%% Initializationclear ; close all; clc%% Setup the parameters you will use for this part of the exerciseinput_layer_size =...
2018-07-06 16:56:21 168
原创 ml_ex2
ex2:(略去了部分代码)%% Machine Learning Online Class - Exercise 2: Logistic Regression%% Initializationclear ; close all; clcdata = load('ex2data1.txt');X = data(:, [1, 2]); y = data(:, 3);%% =======...
2018-07-06 16:50:33 344
原创 ml_ex1
复习整理一下之前做的cousera上吴恩达老师的机器学习课程布置的编程作业:( MATLAB )ex1:(求精简略去了部分代码)%% Machine Learning Online Class - Exercise 1: Linear Regression%% Initializationclear ; close all; clc%% ==================== Part...
2018-07-06 16:39:26 191
华科随机过程实验报告
2018-05-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人