一步步搭建循环神经网络 将在numpy中实现一个循环神经网络 Recurrent Neural Networks (RNN) are very effective for Natural Language Processing and other sequence tasks because they have "memory". 他们可以读取一个输入 \(x^{\langle t \rangle}\) (such as words) one at a time, 并且通过隐藏层激活…
Initialization 如何选择初始化方式,不同的初始化会导致不同的结果 好的初始化方式: 加速梯度下降的收敛(Speed up the convergence of gradient descent) 增加梯度下降 收敛成 一个低错误训练(和 普遍化)的几率(Increase the odds of gradient descent converging to a lower training (and generalization) error) To get started, run…
Regularization Deep Learning models have so much flexibility and capacity that overfitting can be a serious problem,if the training dataset is not big enough. Sure it does well on the training set, but the learned network doesn't generalize to new ex…
1. Gradient Checking 你被要求搭建一个Deep Learning model来检测欺诈,每当有人付款,你想知道是否该支付可能是欺诈,例如该用户的账户可能已经被黑客掉. 但是,反向传播实现起来非常有挑战,并且有时有一些bug,因为这是一个mission-critical应用,你公司老板想让十分确定,你实现的反向传播是正确的.你需要用"gradient checking"来证明你的反向传播是正确的. # Packages import numpy as np from…
Convolutional Neural Networks: Step by Step implement convolutional (CONV) and pooling (POOL) layers in numpy, including both forward propagation and (optionally) backward propagation. Notation: Superscript \([l]\) denotes an object of the \(l^{th}\)…
有哪些sequence model Notation: RNN - Recurrent Neural Network 传统NN 在解决sequence input 时有什么问题? RNN就没有上面的问题. 注意这里还提到了BRNN 双向RNN的概念. 激活函数 g1 经常用的是tanh, 也有用relu的但是不常用 Backpropagation through time Difference types of RNNs Language model and sequence generatio…
Character level language model - Dinosaurus land 为了构建字符级语言模型来生成新的名称,你的模型将学习不同的名字,并随机生成新的名字. 任务清单: 如何存储文本数据,以便使用RNN进行处理. 如何合成数据,通过采样在每个time step预测,并通过下一个RNN-cell unit. 如何构建字符级文本,生成循环神经网络(RNN). 为什么梯度修剪(clipping the gradients)很重要? import numpy as np imp…
Improvise a Jazz Solo with an LSTM Network 实现使用LSTM生成音乐的模型,你可以在结束时听你自己的音乐,接下来你将会学习到: 使用LSTM生成音乐 使用深度学习生成你自己的爵士乐 现在加载库,其中,music21可能不在你的环境内,你需要在命令行中执行pip install msgpack以及pip install music21来获取. from __future__ import print_function import IPython impo…
1. Neural Machine Translation 下面将构建一个神经机器翻译(NMT)模型,将人类可读日期 ("25th of June, 2009") 转换为机器可读日期 ("2009-06-25"). 使用 attention model. from keras.layers import Bidirectional, Concatenate, Permute, Dot, Input, LSTM, Multiply from keras.layers…
1.二维数组中的查找 题目描述 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序.请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数. 思路: 利用二维数组由上到下,由左到右递增的规律, 那么选取右上角a[row][col]与target进行比较,如果等于就直接找到, 当target小于元素a[row][col]时,那么target必定在元素a所在行的左边, 即col--: 当target大于元素a[row][col]时,那么tar…