flipdazed / weather-modelling

Deep Architectures for Weather Modelling
4 stars 1 forks source link

Visualise weight layers #4

Closed flipdazed closed 7 years ago

flipdazed commented 7 years ago

Aim Create a visual representation of the weights in each layer to see if there is any strange weight distribution occurring

Outcome Each weight layer to have a similar appearance as

flipdazed commented 7 years ago

Can now visualise layers by passing the keyword argument visualise containing a list of dictionaries of kwargs to pass to utils.visualise.tileRasterImages.

An additional keyword save_loc is also needed to specify where to save the images The images are saved at each epoch with

image.save(visualise_params['save_loc'] + '_at_mb_{:04d}.png'.format(epoch))

An example of the argument to the keyword visualise=visualisations

visualisations = [
    {
        'x':classifier.hiddenLayer.w.get_value(borrow=True).T,
        'img_shape':(29*2, 29*2*3),
        'tile_shape':(100, 100),
        'tile_spacing':(1, 1),
        'save_loc':'dump/plots/mlp_plots/filters_inputLayer'
    },
    {
        'x':classifier.logRegressionLayer.w.get_value(borrow=True).T,
        'img_shape':(100, 100),
        'tile_shape':(1, 2),
        'tile_spacing':(1, 1),
        'save_loc':'dump/plots/mlp_plots/filters_logitLayer'
    }
]
flipdazed commented 7 years ago

Example Output

filters_logitlayer_at_mb_0005

filters_inputlayer_at_mb_0005

flipdazed commented 7 years ago

Able to plot live weight updates!

untitled