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 parameterstraining_data (
xarray.DataArrayoriris.cube.Cubeor array_like) – The training data - the leading dimension should represent training samplesdata_processors (
listofesem.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 spacelearning_rate (
float) – The learning rate to use with the chosen optimizerdecay (
float) – Any decay to apply to the learning ratekernel_size (
tupleofint) – The convolutional kernel sizeloss (
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 withname (
str) – An optional name for the emulatorgpu (
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.