simpleml.models.base_keras_model module

Base module for keras models. Keras has a native persistence mechanism so need to overwrite other methods at the root

class simpleml.models.base_keras_model.KerasModel(save_method='disk_keras_hdf5', **kwargs)[source]

Bases: simpleml.models.base_model.Model

author
build_network(external_model, **kwargs)[source]

Design choice to require build network method instead of exposing raw Keras objects that can be modified later. Simplifies saving and loading pattern because initialized object should also be the final state (as long as manual override doesnt happen)

created_timestamp
feature_metadata
filepaths
get_params(**kwargs)[source]

Get fit params

has_external_files
hash_
id
metadata_
modified_timestamp
name
params
pipeline
pipeline_id
project
registered_name
set_params(**kwargs)[source]

Keras networks don’t have params beyond layers, which should be configured in self.build_network, so use this for fit params - self.fit will auto pull params and pass them to the fit method.

TODO: Figure out if changing params should be allowed after fit. If they are, would need to reinitialize model, otherwise it would train more epochs and not forget the original training. If not, once fit, we can treat the model as static, and no longer able to be changed

For now going with option 2 - cannot refit models

static transfer_weights(new_model, old_model)[source]
version
version_description