deepscribe.models

class deepscribe.models.parametermodel.ParameterModel

generic class for a model that is initialized from a parameter dictionary. allows modularity and code reuse when building and training the model.

As of this writing, only implements the model building and training function - no model persistence is actually taken into account.

Must implement the functions _build_model and _train_model.

class deepscribe.models.cnn.CNN2Conv

Subclass of CNNAugment that implements a 2-layer CNN model.

class deepscribe.models.cnn.CNNAugment

Subclass of ParameterModel that trains a CNN image classification network with a data augmentation routine.

class deepscribe.models.cnn.ResNet50

Subclass of CNNAugment using architecture from ResNet50

class deepscribe.models.cnn.ResNet50V2

Subclass of CNNAugment using architecture from ResNet50

class deepscribe.models.cnn.VGG16

Subclass of CNNAugment that transfers learned weights from VGG16.

class deepscribe.models.cnn.VGG19

Subclass of CNNAugment that transfers learned weights from VGG19.

deepscribe.models.baselines.cnn_classifier_2conv(x_train: numpy.array, y_train: numpy.array, x_val: numpy.array, y_val: numpy.array, params: Dict[KT, VT]) → Tuple[<sphinx.ext.autodoc.importer._MockObject object at 0x7fd514be2be0>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fd514be2c18>]
Parameters:
  • x_train – training image data, with shape [n_images, x_dim, y_dim, n_channels]
  • y_train – categorical variables with shape [n_images,]
  • x_val – validation image data, with shape [n_images, x_dim, y_dim, n_channels]
  • y_val – categorical variables with shape [n_images,]
  • model – tf.Keras model.
  • params – parameter dictionary.
deepscribe.models.baselines.cnn_classifier_4conv(x_train: numpy.array, y_train: numpy.array, x_val: numpy.array, y_val: numpy.array, params: Dict[KT, VT]) → Tuple[<sphinx.ext.autodoc.importer._MockObject object at 0x7fd514be2a58>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fd514be2a90>]
Parameters:
  • x_train – training image data, with shape [n_images, x_dim, y_dim, n_channels]
  • y_train – categorical variables with shape [n_images,]
  • x_val – validation image data, with shape [n_images, x_dim, y_dim, n_channels]
  • y_val – categorical variables with shape [n_images,]
  • model – tf.Keras model.
  • params – parameter dictionary.