GeezerVison is showing github.com — fix type and doc formating. · willfu/DeepLearningTutorials@e371d52
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: code/DBN.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -41,7 +41,7 @@ def __init__(self, numpy_rng, theano_rng = None, n_ins = 784, | 41 | 41 | :param n_ins: dimension of the input to the DBN | 42 | 42 |
| 43 | 43 | :type n_layers_sizes: list of ints | 44 | | - :param n_layers_sizes: intermidiate layers size, must contain | | 44 | + :param n_layers_sizes: intermediate layers size, must contain | 45 | 45 | at least one value | 46 | 46 |
| 47 | 47 | :type n_outs: int | @@ -63,7 +63,7 @@ def __init__(self, numpy_rng, theano_rng = None, n_ins = 784, | 63 | 63 | self.y = T.ivector('y') # the labels are presented as 1D vector of | 64 | 64 | # [int] labels | 65 | 65 |
| 66 | | - # The DBN is an MLP, for which all weights of intermidiate layers are shared with a | | 66 | + # The DBN is an MLP, for which all weights of intermediate layers are shared with a | 67 | 67 | # different RBM. We will first construct the DBN as a deep multilayer perceptron, and | 68 | 68 | # when constructing each sigmoidal layer we also construct an RBM that shares weights | 69 | 69 | # with that layer. During pretraining we will train these RBMs (which will lead | |
Collapse file Copy file name to clipboardExpand all lines: code/SdA.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -70,7 +70,7 @@ def __init__(self, numpy_rng, theano_rng = None, n_ins = 784, | 70 | 70 | :param n_ins: dimension of the input to the sdA | 71 | 71 |
| 72 | 72 | :type n_layers_sizes: list of ints | 73 | | - :param n_layers_sizes: intermidiate layers size, must contain | | 73 | + :param n_layers_sizes: intermediate layers size, must contain | 74 | 74 | at least one value | 75 | 75 |
| 76 | 76 | :type n_outs: int | @@ -95,7 +95,7 @@ def __init__(self, numpy_rng, theano_rng = None, n_ins = 784, | 95 | 95 | self.y = T.ivector('y') # the labels are presented as 1D vector of | 96 | 96 | # [int] labels | 97 | 97 |
| 98 | | - # The SdA is an MLP, for which all weights of intermidiate layers | | 98 | + # The SdA is an MLP, for which all weights of intermediate layers | 99 | 99 | # are shared with a different denoising autoencoders | 100 | 100 | # We will first construct the SdA as a deep multilayer perceptron, | 101 | 101 | # and when constructing each sigmoidal layer we also construct a | |
Collapse file Copy file name to clipboardExpand all lines: code/mlp.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 |
| 4 | 4 | A multilayer perceptron is a logistic regressor where | 5 | 5 | instead of feeding the input to the logistic regression you insert a | 6 | | -intermidiate layer, called the hidden layer, that has a nonlinear | | 6 | +intermediate layer, called the hidden layer, that has a nonlinear | 7 | 7 | activation function (usually tanh or sigmoid) . One can use many such | 8 | 8 | hidden layers making the architecture deep. The tutorial will also tackle | 9 | 9 | the problem of MNIST digit classification. | @@ -101,7 +101,7 @@ class MLP(object): | 101 | 101 |
| 102 | 102 | A multilayer perceptron is a feedforward artificial neural network model | 103 | 103 | that has one layer or more of hidden units and nonlinear activations. | 104 | | - Intermidiate layers usually have as activation function thanh or the | | 104 | + Intermediate layers usually have as activation function thanh or the | 105 | 105 | sigmoid function (defined here by a ``SigmoidalLayer`` class) while the | 106 | 106 | top layer is a softamx layer (defined here by a ``LogisticRegression`` | 107 | 107 | class). | |
Collapse file Copy file name to clipboardExpand all lines: doc/DBN.txt +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -162,7 +162,7 @@ classification. | 162 | 162 | :param n_ins: dimension of the input to the DBN | 163 | 163 |
| 164 | 164 | :type n_layers_sizes: list of ints | 165 | | - :param n_layers_sizes: intermidiate layers size, must contain | | 165 | + :param n_layers_sizes: intermediate layers size, must contain | 166 | 166 | at least one value | 167 | 167 |
| 168 | 168 | :type n_outs: int | |
Collapse file Copy file name to clipboardExpand all lines: doc/SdA.txt +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -94,7 +94,7 @@ representations of intermediate layers of the MLP. | 94 | 94 | :param n_ins: dimension of the input to the sdA | 95 | 95 |
| 96 | 96 | :type n_layers_sizes: list of ints | 97 | | - :param n_layers_sizes: intermidiate layers size, must contain | | 97 | + :param n_layers_sizes: intermediate layers size, must contain | 98 | 98 | at least one value | 99 | 99 |
| 100 | 100 | :type n_outs: int | |
Collapse file Copy file name to clipboardExpand all lines: doc/mlp.txt +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -138,7 +138,7 @@ layer on top. | 138 | 138 |
| 139 | 139 | The initial values for the weights of a hidden layer :math:`i` should be uniformly | 140 | 140 | sampled from a symmetric interval that depends on the activation function. For | 141 | | -:math:`tanh` activation function results obtained in [Xavier10] show that the | | 141 | +:math:`tanh` activation function results obtained in [Xavier10]_ show that the | 142 | 142 | interval should be | 143 | 143 | :math:`[-\sqrt{\frac{6}{fan_{in}+fan_{out}}},\sqrt{\frac{6}{fan_{in}+fan_{out}}}]`, where | 144 | 144 | :math:`fan_{in}` is the number of units in the :math:`(i-1)`-th layer, | @@ -154,11 +154,11 @@ both upward (activations flowing from inputs to outputs) and backward | 154 | 154 | # `W` is initialized with `W_values` which is uniformely sampled | 155 | 155 | # from sqrt(-6./(n_in+n_hidden)) and sqrt(6./(n_in+n_hidden)) | 156 | 156 | # for tanh activation function | 157 | | - # the output of uniform if converted using asarray to dtype | | 157 | + # the output of uniform is converted using asarray to dtype | 158 | 158 | # theano.config.floatX so that the code is runable on GPU | 159 | 159 | # Note : optimal initialization of weights is dependent on the | 160 | 160 | # activation function used (among other things). | 161 | | - # For example, results presented in [Xavier10] suggest that you | | 161 | + # For example, results presented in [Xavier10]_ suggest that you | 162 | 162 | # should use 4 times larger initial weights for sigmoid | 163 | 163 | # compared to tanh | 164 | 164 | if activation == theano.tensor.tanh: | @@ -207,7 +207,7 @@ the ``MLP`` class : | 207 | 207 |
| 208 | 208 | A multilayer perceptron is a feedforward artificial neural network model | 209 | 209 | that has one layer or more of hidden units and nonlinear activations. | 210 | | - Intermidiate layers usually have as activation function thanh or the | | 210 | + Intermediate layers usually have as activation function tanh or the | 211 | 211 | sigmoid function (defined here by a ``HiddenLayer`` class) while the | 212 | 212 | top layer is a softamx layer (defined here by a ``LogisticRegression`` | 213 | 213 | class). | @@ -412,7 +412,7 @@ Under some assumptions, a compromise between these two constraints leads to the | 412 | 412 | initialization: :math:`uniform[-\frac{6}{\sqrt{fan_{in}+fan_{out}}},\frac{6}{\sqrt{fan_{in}+fan_{out}}}]` | 413 | 413 | for tanh and :math:`uniform[-4*\frac{6}{\sqrt{fan_{in}+fan_{out}}},4*\frac{6}{\sqrt{fan_{in}+fan_{out}}}]` | 414 | 414 | for sigmoid. Where :math:`fan_{in}` is the number of inputs and :math:`fan_{out}` the number of hidden units. | 415 | | -For mathematical considerations please refer to [Xavier10]. | | 415 | +For mathematical considerations please refer to [Xavier10]_. | 416 | 416 |
| 417 | 417 | Learning rate | 418 | 418 | -------------- | |
Collapse file Copy file name to clipboardExpand all lines: doc/rbm.txt +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -574,7 +574,7 @@ op provided by Theano, therefore we urge the reader to look it up by following t | 574 | 574 |
| 575 | 575 | Once we have the generated the chain we take the sample at the end of the | 576 | 576 | chain to get the free energy of the negative phase. Note that the | 577 | | -``chain_end`` is a symbolical Theano variable express in terms of the model | | 577 | +``chain_end`` is a symbolical Theano variable expressed in terms of the model | 578 | 578 | parameters, and if we would apply ``T.grad`` naively, the function will | 579 | 579 | try to go through the Gibbs chain to get the gradients. This is not what we | 580 | 580 | want (it will mess up our gradients) and therefire we need to indicate to | @@ -585,7 +585,7 @@ want (it will mess up our gradients) and therefire we need to indicate to | 585 | 585 |
| 586 | 586 |
| 587 | 587 | # determine gradients on RBM parameters | 588 | | - # not that we only need the sample at the end of the chain | | 588 | + # note that we only need the sample at the end of the chain | 589 | 589 | chain_end = nv_samples[-1] | 590 | 590 |
| 591 | 591 | cost = T.mean(self.free_energy(self.input)) - T.mean(self.free_energy(chain_end)) | |
|