Coder Social home page Coder Social logo

Comments (2)

bikachu avatar bikachu commented on June 23, 2024

This is in the vanilla RNN

from dynamic-tensorflow-tutorial.

kanthagirish-rit avatar kanthagirish-rit commented on June 23, 2024

Hello @bikachu,

@KnHuq is using tf.scan() to iterate through time steps in the data and compute hidden state. If you take a look at the method vanilla_rnn() of the class, you would notice hidden states being computed for a single time step. This method is passed to tf.scan() as the function.

The first argument in method definition is previous_hidden_state h(t-1). tf.scan() initializes this with initial_hidden which is created in the __init__(). The computed current_hidden_state is h(t).

Second argument x, which would take the shape (# samples, input_dim) is unwrapped by tf.scan() from self.processed_input (time_step, # samples, input_dim) along the first dimension, hence he has reshaped the data to have the first dimension as the time step. vanilla_rnn() would be run for each x, which is the time step and hidden states are computed.

He is considering each column of pixels in an MNIST image as one time step.

from dynamic-tensorflow-tutorial.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.