esem.cnn_model

esem.cnn_model(training_params, training_data, data_processors=None, filters=12, learning_rate=0.001, decay=0.01, kernel_size=(3, 5), loss='mean_squared_error', activation='tanh', optimizer='RMSprop', name='', gpu=0)

Create a simple two layer Convolutional Neural Network Emulator using Keras.

Note that X should include both the train and validation data

Parameters
  • training_params (pd.DataFrame) – The training parameters

  • training_data (xarray.DataArray or iris.cube.Cube or array_like) – The training data - the leading dimension should represent training samples

  • data_processors (list of esem.data_processors.DataProcessor) – A list of DataProcessor to apply to the data transparently before training. Model output will be un-transformed before being returned from the Emulator.

  • filters (int) – The dimensionality of the first convolutional layer output space

  • learning_rate (float) – The learning rate to use with the chosen optimizer

  • decay (float) – Any decay to apply to the learning rate

  • kernel_size (tuple of int) – The convolutional kernel size

  • loss (str) – The loss function to train against (see https://keras.io/api/losses/)

  • activation (str) – The activation function to use in the final CNN layer (see https://keras.io/api/layers/activations/)

  • optimizer ({'RMSprop', 'Adam'}) – The optimizer to train the model with

  • name (str) – An optional name for the emulator

  • gpu (int) – The GPU to use (only applicable for multi-GPU) machines

Returns

Emulator – An esem emulator object which can be trained and sampled from

Notes

The Keras model is compiled but not trained until train is called on the returned Emulator object.