flipdazed / weather-modelling

Deep Architectures for Weather Modelling
4 stars 1 forks source link

Need Histogram of Updates #7

Closed flipdazed closed 7 years ago

flipdazed commented 7 years ago

Aim As with the histogram of parameter values in #6 except this time with the update values

flipdazed commented 7 years ago

updates are held outside the NN class

gparams = [T.grad(cost, param) for param in classifier.params]
updates = [
    (param, param - learning_rate * gparam) 
    for param, gparam in zip(classifier.params, gparams)
]

can return from the training function as gradients and multiply by learning_rate

train_model = theano.function(
    inputs=[index],
    outputs=[cost] + gparams,
    updates=updates,
    givens={
        x: train_set_x[index * batch_size: (index + 1) * batch_size],
        y: train_set_y[index * batch_size: (index + 1) * batch_size]
    }
)
flipdazed commented 7 years ago

Big issue with multiple outputs in theano.function http://stackoverflow.com/q/40272716/4013571

In essence, a workaround is needed such that .get_value is not assigned before the training process.

flipdazed commented 7 years ago

untitled