stackedAutoencoder.py
def feedForwardAutoencoder(theta, hidden_size, visible_size, input):

    """ Define limits to access useful data """

    limit0 = 0
    limit1 = hidden_size * visible_size
    limit2 = 2 * hidden_size * visible_size
    limit3 = 2 * hidden_size * visible_size + hidden_size
    
    """ Access W1 and b1 from 'theta' """
    
    W1 = theta[limit0 : limit1].reshape(hidden_size, visible_size)
    b1 = theta[limit2 : limit3].reshape(hidden_size, 1)
    
    """ Compute the hidden layer activations """
    
    hidden_layer = 1 / (1 + numpy.exp(-(numpy.dot(W1, input) + b1)))
    
    return hidden_layer
 Define limits to access useful data 
Define limits to access useful data
Define limits to access useful data
def feedForwardAutoencoder(theta, hidden_size, visible_size, input):
    limit0 = 0
    limit1 = hidden_size * visible_size
    limit2 = 2 * hidden_size * visible_size
    limit3 = 2 * hidden_size * visible_size + hidden_size
    W1 = theta[limit0 : limit1].reshape(hidden_size, visible_size)
    b1 = theta[limit2 : limit3].reshape(hidden_size, 1)
    hidden_layer = 1 / (1 + numpy.exp(-(numpy.dot(W1, input) + b1)))
    return hidden_layer
def feedForwardAutoencoder ( theta , hidden_size , visible_size , input ) : limit0 = 0 limit1 = hidden_size * visible_size limit2 = 2 * hidden_size * visible_size limit3 = 2 * hidden_size * visible_size + hidden_size """ Access W1 and b1 from 'theta' """ W1 = theta [ limit0 : limit1 ] . reshape ( hidden_size , visible_size ) b1 = theta [ limit2 : limit3 ] . reshape ( hidden_size , 1 ) """ Compute the hidden layer activations """ hidden_layer = 1 / ( 1 + numpy . exp ( - ( numpy . dot ( W1 , input ) + b1 ) ) ) return hidden_layer
Define limits to access useful data
Define limits to access useful data
""" Define limits to access useful data """ """ Access W1 and b1 from 'theta' """ """ Compute the hidden layer activations """
theta
hidden_size
visible_size
input