dacapo.experiments.model

Module Contents

Classes

Model

A trainable DaCapo model. Consists of an Architecture and a

class dacapo.experiments.model.Model(architecture: dacapo.experiments.architectures.architecture.Architecture, prediction_head: torch.nn.Module, eval_activation: torch.nn.Module | None = None)

A trainable DaCapo model. Consists of an Architecture and a prediction head. Models are generated by ``Predictor``s.

May include an optional eval_activation that is only executed when the model is in eval mode. This is particularly useful if you want to train with something like BCELossWithLogits, since you want to avoid applying softmax while training, but apply it during evaluation.

num_out_channels: int
num_in_channels: int
forward(x)
compute_output_shape(input_shape: funlib.geometry.Coordinate) Tuple[int, funlib.geometry.Coordinate]

Compute the spatial shape (i.e., not accounting for channels and batch dimensions) of this model, when fed a tensor of the given spatial shape as input.

scale(voxel_size: funlib.geometry.Coordinate) funlib.geometry.Coordinate