ResNetInterface

class ketos.neural_networks.resnet.ResNetInterface(block_sets=[2, 2, 2], n_classes=2, initial_filters=16, initial_strides=1, initial_kernel=[3, 3], strides=2, kernel=[3, 3], optimizer=Adam ketos recipe, loss_function=BinaryCrossentropy ketos recipe, metrics=[BinaryAccuracy ketos recipe, Precision ketos recipe, Recall ketos recipe])[source]

Creates a ResNet model with the standardized Ketos interface.

Args:
block_sets: list of ints

A list specifying the block sets and how many blocks each set contains. Example: [2,2,2] will create a ResNet with 3 block sets, each containing 2 ResNetBlocks (i.e.: a total of 6 residual blocks)

n_classes:int

The number of classes. The output layer uses a Softmax activation and will contain this number of nodes, resulting in model outputs with this many values summing to 1.0.

initial_filters:int

The number of filters used in the first ResNetBlock. Subsequent blocks will have two times more filters than their previous block.

initial_strides: int

Strides used in the first convolutional layer

initial_kernel: int

Kernel size used in the first convolutional layer

strides: int

Strides used in convolutional layers within the blocks

kernel: int

Kernel size used in convolutional layers within the blocks

optimizer: ketos.neural_networks.RecipeCompat object

A recipe compatible optimizer (i.e.: wrapped by the ketos.neural_networksRecipeCompat class)

loss_function: ketos.neural_networks.RecipeCompat object

A recipe compatible loss_function (i.e.: wrapped by the ketos.neural_networksRecipeCompat class)

metrics: list of ketos.neural_networks.RecipeCompat objects

A list of recipe compatible metrics (i.e.: wrapped by the ketos.neural_networksRecipeCompat class). These metrics will be computed on each batch during training.

secondary_metrics: list of ketos.neural_networks.RecipeCompat objects

A list of recipe compatible metrics (i.e.: wrapped by the ketos.neural_networksRecipeCompat class). These can be used as additional metrics. Computed at each batch during training but only printed or logged as the average at the end of the epoch

Methods

Attributes

checkpoint_dir

early_stopping_monitor

Sets an early stopping monitor.

log_dir

test_generator

train_generator

val_generator

valid_losses

valid_metrics

valid_optimizers