modlee.model.model module

Modlee model class and callbacks.

class modlee.model.model.ModleeModel(data_snapshot_size=10000000.0, kwargs_cache={}, modality=None, task=None, *args, **kwargs)[source]

Bases: LightningModule

configure_callbacks()[source]

Configure callbacks for auto-documentation.

Returns:

A list of callbacks for auto-documentation.

property run_path

The path to the current run.

Returns:

The path to the current run.

class modlee.model.model.SimpleDataset(input_shape=(1, 10), output_shape=(1, 20))[source]

Bases: Dataset

A simple dataset class.

class modlee.model.model.SimpleModel(input_shape=(1, 10), output_shape=(1, 20))[source]

Bases: ModleeModel

A simple Modlee model.

configure_optimizers()[source]

Configure optimizers for the model.

Returns:

The optimizer object.

forward(x)[source]

Forward pass.

Parameters:

x – The input to the model.

Returns:

The output of the model.

training_step(batch, batch_idx)[source]

Perform a training step.

Parameters:
  • batch – The batch of dat.a

  • batch_idx – The index of the batch.

Returns:

A dictionary of the loss.