<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Joshua Dimasaka</title>
    <description>Climate and Earthquake Risk Modeller. Geospatial Data Scientist. Stanford Knight-Hennessy Scholar. Cambridge UKRI EPSRC CDT AI4ER. Germany Helmholtz Visiting AI &amp; Digital GreenTalent. 
</description>
    <link>https://www.joshuadimasaka.com/</link>
    <atom:link href="https://www.joshuadimasaka.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Sun, 02 Aug 2026 01:36:41 +0000</pubDate>
    <lastBuildDate>Sun, 02 Aug 2026 01:36:41 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Title of post 1</title>
        <description>&lt;p&gt;Write your post content here in normal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;markdown&lt;/code&gt;. An example post is shown below for reference.&lt;/p&gt;

&lt;h3 id=&quot;introduction&quot;&gt;Introduction&lt;/h3&gt;

&lt;p&gt;Recurrent Neural Networks and their variations are very likely to overfit the training data. This is due to the large network formed by unfolding each cell of the RNN, and &lt;em&gt;relatively&lt;/em&gt; small number of parameters (since they are shared over each time step) and training data. Thus, the perplexities obtained on the test data are often quite larger than expected. Several attempts have been made to minimize this problem using varied &lt;strong&gt;regularization&lt;/strong&gt; techniques. This paper tackles this issue by proposing a model that combines several of such existing methods.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Merity et al&lt;/em&gt;’s model is a modification of the standard &lt;strong&gt;LSTM&lt;/strong&gt; in which &lt;em&gt;DropConnect&lt;/em&gt; is applied to the hidden weights in the &lt;em&gt;recurrent&lt;/em&gt; connections of the LSTM for regularization. The dropout mask for each weight is preserved and the same mask is used across all time steps, thereby adding negligible computation overhead. Apart from this, several other techniques have been incorporated :&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Variational dropout&lt;/strong&gt; : The same dropout mask is used for a particular recurrent connection in both the forward and backward pass for all time steps. Each input of a mini-batch has a separate dropout mask, which ensures that the regularizing effect due to it isn’t identical across different inputs.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Embedding dropout&lt;/strong&gt; : Dropout with dropout probability \(p_e\) is applied to word embedding vectors, which results in new word vectors which are identically zero for the dropped words. The remaining word vectors are scaled by \(\frac{1}{1-p_e}\) as compensation.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;AR and TAR&lt;/strong&gt; : AR (Activation Regularization) and TAR (Temporal Activation Regularization) are modifications of \(L_2\) regularization, wherein the standard technique is applied to dropped &lt;em&gt;output activations&lt;/em&gt; and dropped &lt;em&gt;change in output activations&lt;/em&gt; respectively. Mathematically, the additional terms in the cost function \(J\) are (here \(\alpha\) and \(\beta\) are scaling constants and \(\textbf{D}\) is the dropout mask) :&lt;/li&gt;
&lt;/ul&gt;

\[J_{AR}=\alpha L_2\left(\textbf{D}_l^t\odot h_l^t\right)\\
J_{TAR}=\beta L_2\left(\textbf{D}_l^t\odot\left(h_l^t - h_l^{t-1}\right)\right)\]

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Weight tying&lt;/strong&gt; : In this method, the parameters for word embeddings and the final output layer are shared.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Variable backpropagation steps&lt;/strong&gt; : A random number of BPTT steps are taken instead of a fixed number, whose mean is very close to the original fixed value (\(s\)). The BPTT step-size (\(x\)) is drawn from the following distribution (here \(\mathcal{N}\) is the Gaussian distribution, \(p\) is a number close to 0.95 and \(\sigma^2\) is the desired variance) :&lt;/li&gt;
&lt;/ul&gt;

\[x \sim p\cdot \mathcal{N}\left(s,\sigma^2\right) + (1-p)\cdot \mathcal{N}\left(\frac{s}{2},\sigma^2\right)\]

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Independent sizes of word embeddings and hidden layer&lt;/strong&gt; : The sizes of the hidden layer and word embeddings are kept independent of each other.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The paper also introduces a new optimization algorithm, namely &lt;strong&gt;Non-monotonically Triggered Averaged Stochastic Gradient Descent&lt;/strong&gt; or NT-ASGD, which can be programmatically described as follows :&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;NT_ASGD&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;w0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
    Input parameters :
    f  - objective function
    t  - stopping criterion
    w0 - initial parameters
    n  - non-monotonicity interval
    L  - number of epochs after which finetuning is done
    lr - learning rate

    Returns :
    parameter(s) that minimize `f`
    &quot;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;k&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[];&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;logs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;w0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;# `func_grad` computes gradient of `f` at `w`
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;func_grad&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;k&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;L&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;# Compute model&apos;s perplexity for current parameters
&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;perplexity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;min&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;logs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]):&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;logs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Return the average of best `k-T+1` parameters
&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):])&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;     &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;They also combined their &lt;strong&gt;AWD-LSTM&lt;/strong&gt; (ASGD Weight Dropped LSTM) with a neural cache model to obtain further reduction in perplexities. A &lt;em&gt;neural cache model&lt;/em&gt; stores previous states in memory, and predicts the output obtained by a &lt;em&gt;convex combination&lt;/em&gt; of the output using stored states and the AWD-LSTM.&lt;/p&gt;

&lt;h3 id=&quot;network-description&quot;&gt;Network description&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Merity et al&lt;/em&gt;’s model used a 3-layer weight dropped LSTM with dropout probability &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.5&lt;/code&gt; for &lt;strong&gt;PTB corpus&lt;/strong&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.65&lt;/code&gt; for &lt;strong&gt;WikiText-2&lt;/strong&gt;, combined with several of the above regularization techniques. The different hyperparameters (as referred to in the discussion above) are as follows : hidden layer size (\(H\)) = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1150&lt;/code&gt;, embedding size (\(D\)) = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;400&lt;/code&gt;, number of epochs = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;750&lt;/code&gt;, \(L\) = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1&lt;/code&gt;, \(n\) = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;5&lt;/code&gt;, learning rate = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;30&lt;/code&gt;, Gradients clipped at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.25&lt;/code&gt;, \(p\) = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.95&lt;/code&gt;, \(s\) = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;70&lt;/code&gt;, \(\sigma^2\) = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;5&lt;/code&gt;, \(\alpha\) = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2&lt;/code&gt;, \(\beta\) = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1&lt;/code&gt;, dropout probabilities for input, hidden outputs, final output and embeddings as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.4&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.3&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.4&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.1&lt;/code&gt; respectively.&lt;/p&gt;

&lt;p&gt;Word embedding weights were initialized from \(\mathcal{U}\left[-0.1,0.1\right]\) and all other hidden weights from \(\mathcal{U}\left[-\frac{1}{\sqrt{1150}},\frac{1}{\sqrt{1150}}\right]\). Mini-batch size of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;40&lt;/code&gt; was used for PTB and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;80&lt;/code&gt; for WT-2.&lt;/p&gt;

&lt;h3 id=&quot;result-highlights&quot;&gt;Result highlights&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;3-layer AWD-LSTM with weight tying attained 57.3 PPL on PTB&lt;/li&gt;
  &lt;li&gt;3-layer AWD-LSTM with weight tying and a continuous cache pointer attained 52.8 PPL on PTB&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Wed, 10 Jan 2018 15:10:00 +0000</pubDate>
        <link>https://www.joshuadimasaka.com/blog/2018/01/post-1</link>
        <guid isPermaLink="true">https://www.joshuadimasaka.com/blog/2018/01/post-1</guid>
        
        
        <category>rnn</category>
        
        <category>discussion</category>
        
      </item>
    
      <item>
        <title>Title of post 2</title>
        <description>&lt;p&gt;Write your post content here in normal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;markdown&lt;/code&gt;. An example post is shown below for reference.&lt;/p&gt;

&lt;h3 id=&quot;introduction&quot;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Regularization is an important step during the training of neural networks. It helps to generalize the model by reducing the possibility of overfitting the training data. There are several types of regularization techniques, with L2 , L1, elastic-net (linear combination of L2 and L1 regularization), dropout and drop-connect being the major ones. While L2, L1 and elastic-net regularization techniques work by constraining the trainable parameters (or &lt;em&gt;weights&lt;/em&gt;) from attaining large values (so that no drastic changes in output are observed for slight changes in the input; or in other words, they prefer &lt;em&gt;diffused&lt;/em&gt; weights rather than &lt;em&gt;peaked&lt;/em&gt; ones), &lt;strong&gt;dropout&lt;/strong&gt; and drop-connect work by averaging the task over a dynamically and randomly generated large &lt;em&gt;ensemble&lt;/em&gt; of networks. These networks are obtained by randomly disconnecting neurons (&lt;em&gt;dropout&lt;/em&gt;) or weights (&lt;em&gt;drop-connect&lt;/em&gt;) from the original network so as to obtain a subnetwork on which the training process is carried out (although for \(\approx1\) epoch for each, since the chance of the same subnetwork being generated again is very rare).&lt;/p&gt;

&lt;p&gt;Application of dropout to feedforward neural networks gives promising results. RNNs are thought of as individual &lt;em&gt;cells&lt;/em&gt; that are &lt;em&gt;unfolded&lt;/em&gt; over several time-steps, with the input at each time-step being a token of the sequence. When dropout is used for regularizing such a network, the ‘disturbance’ it generates at each time step propagates over a long interval, thereby decreasing the network’s ability to represent long range dependencies. Thus, applying dropout in the standard manner to RNNs fails to give any improvement. It is here where &lt;em&gt;Zaremba et al&lt;/em&gt;’s research comes into the picture.&lt;/p&gt;
&lt;h3 id=&quot;network-description&quot;&gt;Network description&lt;/h3&gt;
&lt;p&gt;The network architecture that &lt;em&gt;Zaremba et al&lt;/em&gt; proposed is quite simple and intuitive. In case of deep RNNs (i.e. RNNs spanning over several layers (\(h\)) where output of \(h_{l-1}^{t}\) is used as the input for \(h_l^t\)), all connections between the cells in unfolded state can be broadly classified into two categories - &lt;em&gt;recurrent&lt;/em&gt; and &lt;em&gt;non-recurrent&lt;/em&gt;. The connections between cells in the same layer i.e. \(h_l^t ~-~ h_l^{t+1}~~\forall t\) are &lt;em&gt;recurrent&lt;/em&gt; connections, and those between cells in adjacent layers i.e. \(h_l^t ~-~ h_{l+1}^t~~\forall l\) are &lt;em&gt;non-recurrent&lt;/em&gt; connections. &lt;em&gt;Zaremba et al&lt;/em&gt; suggested that &lt;strong&gt;dropout&lt;/strong&gt; should be applied only to non-recurrent connections - thereby preventing problems which arose earlier.&lt;/p&gt;

&lt;p&gt;The modified network for LSTM units can be mathematically represented as follows:&lt;/p&gt;

&lt;p&gt;Denoting \(T_{m,n}\) as an affine transformation from \(\mathbb{R}^m\rightarrow\mathbb{R}^n\) ( i.e. \(T_{m,n}(x)=Wx+b\) where \(x\in\mathbb{R}^{m\times1}\), \(W\in\mathbb{R}^{n\times m}\) and \(b\in\mathbb{R}^{n\times1}\) and similarly for multiple inputs) and \(\otimes\) as elementwise multiplication, we have :&lt;/p&gt;

\[f_l^t=\text{sigmoid}\left(T_{N,D}^1\left(\textbf{D}\left(h_{l-1}^t\right) ; h_l^{t-1}\right)\right) \\
i_l^t=\text{sigmoid}\left(T_{N,D}^2\left(\textbf{D}\left(h_{l-1}^t\right) ; h_l^{t-1}\right)\right) \\
o_l^t=\text{sigmoid}\left(T_{N,D}^3\left(\textbf{D}\left(h_{l-1}^t\right) ; h_l^{t-1}\right)\right) \\
u_l^t=\text{tanh}\left(T_{N,D}^4\left(\textbf{D}\left(h_{l-1}^t\right) ; h_l^{t-1}\right)\right) \\
c_l^t=c_l^{t-1}\otimes f_l^t + u_l^t\otimes i_l^t \\
h_l^t = \text{tanh}\left(c_l^t\right)\otimes o_l^t\]

&lt;p&gt;Here, \(\textbf{D}\) is the dropout &lt;em&gt;layer&lt;/em&gt; or operator which sets a subset of its input randomly to zero with dropout probability &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;p&lt;/code&gt;. This modification can be adopted for any other RNN architecture.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Zaremba et al&lt;/em&gt; used these architectures for their experiments in which each cell was unrolled for 35 steps. Mini-batch size was 20 for both :&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Medium LSTM&lt;/strong&gt; :
Hidden-layer dimension = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;650&lt;/code&gt;,
Weights initialized uniformly in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[-0.05,0.05]&lt;/code&gt;,
Dropout probability = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.5&lt;/code&gt;,
Number of epochs = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;39&lt;/code&gt;,
Learning rate = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1&lt;/code&gt; which decays by a factor of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1.2&lt;/code&gt; after 6 epochs,
Gradients clipped at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;5&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large LSTM&lt;/strong&gt; :
Hidden-layer dimension = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1500&lt;/code&gt;,
Weights initialized uniformly in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[-0.04,0.04]&lt;/code&gt;,
Dropout probability = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.65&lt;/code&gt;,
Number of epochs = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;55&lt;/code&gt;,
Learning rate = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1&lt;/code&gt; which decays by a factor of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1.15&lt;/code&gt; after 14 epochs,
Gradients clipped at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;10&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;result-highlights&quot;&gt;Result highlights&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;78.4 PPL on Penn TreeBank dataset using a single &lt;strong&gt;Large LSTM&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;68.7 PPL on Penn TreeBank dataset using an ensemble of 38 &lt;strong&gt;Large LSTM&lt;/strong&gt;s&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Wed, 10 Jan 2018 15:01:00 +0000</pubDate>
        <link>https://www.joshuadimasaka.com/blog/2018/01/post-2</link>
        <guid isPermaLink="true">https://www.joshuadimasaka.com/blog/2018/01/post-2</guid>
        
        
        <category>rnn</category>
        
        <category>regularization</category>
        
      </item>
    
  </channel>
</rss>
