API Reference
Models
- class volara_ml.models.JaxModel(*, in_channels, min_input_shape, min_output_shape, min_step_shape, out_channels, out_range, context_override=None, model_type='jax', model_path, params_path=None, pred_size_growth=None)
A JAX/Flax model configuration.
The model is loaded from a pickled Flax module (or apply function) and parameters are loaded from an orbax checkpoint directory or .msgpack file. All JAX imports are lazy so the module loads without JAX installed.
- property eval_input_shape: Coordinate
The input shape to use during prediction.
- property eval_output_shape: Coordinate
The output shape to expect after providing data with shape self.eval_input_shape()
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_path: Path
Path to a pickled Flax module (or apply function).
- model_post_init(_JaxModel__context)
Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.
- Return type:
None
- property num_out_channels: list[int | None]
The number of channels in each output prediction generated by this model. This is expected in a list to account for models that generate multiple output arrays.
- params_path: Path | None
Path to an orbax checkpoint directory or .msgpack file with model parameters.
- predict(device)
Context manager that yields a predict callable.
Loads the model onto the given device on entry and frees GPU memory on exit (del model, clear caches, gc.collect).
- Return type:
Generator[Callable[[ndarray],list[ndarray]],None,None]
- select_device(worker_id)
Return the device to use for the given worker.
- Return type:
Any
- class volara_ml.models.Model(*, in_channels, min_input_shape, min_output_shape, min_step_shape, out_channels, out_range, context_override=None)
A base class for defining the common attributes and methods for all model types.
- property context: Coordinate | tuple[Coordinate, Coordinate]
The context required to make tile artifact free predictions with this model.
- context_override: tuple[Coordinate, Coordinate] | None
An optional override for asymetrical context sizes. This lets you define a specific lower and upper context size for the model which must equal the expected context size of input_shape - output_shape
- abstract property eval_input_shape: Coordinate
The input shape to use during prediction.
- abstract property eval_output_shape: Coordinate
The output shape to expect after providing data with shape self.eval_input_shape()
- from_uint8(data)
A function defining the conversion function to go from np.uint8 back to np.float32
- Return type:
ndarray
- in_channels: int
The number of input channels to the model.
- min_input_shape: Coordinate
The smallest possible input shape to the model. E.g. with UNets there is a minimum input size that satisfies the downsampling and all convolutional models have a minimum input size if using “valid” padding.
- min_output_shape: Coordinate
The output shape to expect when providing the minimum input shape data.
- min_step_shape: Coordinate
The minimum step size to increment the input shape by. This may be used to determine an optimal input/output shape for the model.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- abstract property num_out_channels: list[int | None]
The number of channels in each output prediction generated by this model. This is expected in a list to account for models that generate multiple output arrays.
- out_channels: list[int | None] | int | None
The number of channels in the output of the model. This can be an integer or list of integers if the model has multiple outputs. If None it is assumed that the number of output channels equals the number of input channels
- out_range: tuple[float, float]
The range of the output data. This is used to convert between np.uint8 and np.float32 data types for efficient reading/writing of model outputs.
- abstractmethod predict(device)
Context manager that yields a predict callable.
Loads the model onto the given device on entry and frees GPU memory on exit (del model, clear caches, gc.collect).
- Return type:
Generator[Callable[[ndarray],list[ndarray]],None,None]
- abstractmethod select_device(worker_id)
Return the device to use for the given worker.
- Return type:
Any
- to_out_dtype(out_data)
A function defining the conversion function to go from model outputs to np.uint8 for writing to zarr.
- Return type:
ndarray
- class volara_ml.models.TorchModel(*, in_channels, min_input_shape, min_output_shape, min_step_shape, out_channels, out_range, context_override=None, model_type='torch', save_path, checkpoint_file=None, pred_size_growth=None)
- checkpoint_file: Path | None
An optional path to a checkpoint file containing the model weights. This can be provided either as a dictionary with key/value pair: “model_state_dict” and model.state_dict() or as a plain model.state_dict() dictionary.
- property eval_input_shape: Coordinate
The input shape to use during prediction.
- property eval_output_shape: Coordinate
The output shape to expect after providing data with shape self.eval_input_shape()
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(_TorchModel__context)
Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.
- Return type:
None
- property num_out_channels: list[int | None]
The number of channels in each output prediction generated by this model. This is expected in a list to account for models that generate multiple output arrays.
- predict(device)
Context manager that yields a predict callable.
Loads the model onto the given device on entry and frees GPU memory on exit (del model, clear caches, gc.collect).
- Return type:
Generator[Callable[[ndarray],list[ndarray]],None,None]
- save_path: Path
The path to a model saved using torch.jit.save or torch.save.
- select_device(worker_id)
Return the device to use for the given worker.
- Return type:
Any
Blockwise Tasks
- pydantic model volara_ml.blockwise.Predict
Show JSON schema
{ "title": "Predict", "type": "object", "properties": { "roi": { "anyOf": [ { "maxItems": 2, "minItems": 2, "prefixItems": [ { "items": { "type": "integer" }, "type": "array" }, { "items": { "type": "integer" }, "type": "array" } ], "type": "array" }, { "type": "null" } ], "default": null, "title": "Roi" }, "num_workers": { "default": 1, "title": "Num Workers", "type": "integer" }, "num_cache_workers": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Num Cache Workers" }, "worker_config": { "anyOf": [ { "$ref": "#/$defs/Worker" }, { "type": "null" } ], "default": null }, "fit": { "const": "overhang", "default": "overhang", "title": "Fit", "type": "string" }, "read_write_conflict": { "const": false, "default": false, "title": "Read Write Conflict", "type": "boolean" }, "resource_tracking": { "default": true, "title": "Resource Tracking", "type": "boolean" }, "block_timeout": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Block Timeout" }, "array_scheduler": { "anyOf": [ { "enum": [ "single-threaded", "synchronous", "threads", "processes" ], "type": "string" }, { "type": "null" } ], "default": "single-threaded", "title": "Array Scheduler" }, "skip_mask": { "anyOf": [ { "$ref": "#/$defs/MaskDataset" }, { "type": "null" } ], "default": null }, "task_type": { "const": "predict", "default": "predict", "title": "Task Type", "type": "string" }, "checkpoint": { "discriminator": { "mapping": { "jax": "#/$defs/JaxModel", "torch": "#/$defs/TorchModel" }, "propertyName": "model_type" }, "oneOf": [ { "$ref": "#/$defs/TorchModel" }, { "$ref": "#/$defs/JaxModel" } ], "title": "Checkpoint" }, "in_data": { "$ref": "#/$defs/Raw" }, "out_data": { "items": { "anyOf": [ { "discriminator": { "mapping": { "affs": "#/$defs/Affs", "lsd": "#/$defs/LSD", "raw": "#/$defs/Raw" }, "propertyName": "dataset_type" }, "oneOf": [ { "$ref": "#/$defs/Raw" }, { "$ref": "#/$defs/Affs" }, { "$ref": "#/$defs/LSD" } ] }, { "type": "null" } ] }, "title": "Out Data", "type": "array" } }, "$defs": { "Affs": { "additionalProperties": false, "description": "Represents a dataset containing affinities.\nRequires the inclusion of the neighborhood for these\naffinities.", "properties": { "store": { "title": "Store", "type": "string" }, "voxel_size": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Voxel Size" }, "offset": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Offset" }, "axis_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Axis Names" }, "units": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Units" }, "writable": { "default": true, "title": "Writable", "type": "boolean" }, "ops": { "anyOf": [ { "items": { "description": "A python callable, serialized with cloudpickle and base64-encoded. Deserializing executes arbitrary code: only load configs you trust.", "format": "base64-cloudpickle", "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Ops" }, "flip": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Flip" }, "channels": { "anyOf": [ { "items": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "integer" } ] }, "type": "array" }, { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Channels" }, "zarr_kwargs": { "additionalProperties": true, "title": "Zarr Kwargs", "type": "object" }, "sharding": { "default": true, "title": "Sharding", "type": "boolean" }, "inner_chunk_shape": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Inner Chunk Shape" }, "storage_options": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Storage Options" }, "dataset_type": { "const": "affs", "default": "affs", "title": "Dataset Type", "type": "string" }, "neighborhood": { "items": { "items": { "type": "integer" }, "type": "array" }, "title": "Neighborhood", "type": "array" } }, "required": [ "store" ], "title": "Affs", "type": "object" }, "CloudVolumeWrapper": { "additionalProperties": false, "description": "Represents a volumetric dataset through Cloud Volume.", "properties": { "store": { "title": "Store", "type": "string" }, "voxel_size": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Voxel Size" }, "offset": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Offset" }, "axis_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Axis Names" }, "units": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Units" }, "writable": { "default": true, "title": "Writable", "type": "boolean" }, "ops": { "anyOf": [ { "items": { "description": "A python callable, serialized with cloudpickle and base64-encoded. Deserializing executes arbitrary code: only load configs you trust.", "format": "base64-cloudpickle", "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Ops" }, "flip": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Flip" }, "channels": { "anyOf": [ { "items": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "integer" } ] }, "type": "array" }, { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Channels" }, "zarr_kwargs": { "additionalProperties": true, "title": "Zarr Kwargs", "type": "object" }, "sharding": { "default": true, "title": "Sharding", "type": "boolean" }, "inner_chunk_shape": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Inner Chunk Shape" }, "storage_options": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Storage Options" }, "dataset_type": { "const": "cloudvolume", "default": "cloudvolume", "title": "Dataset Type", "type": "string" }, "mip": { "default": 0, "title": "Mip", "type": "integer" }, "timestamp": { "default": 1794438844, "title": "Timestamp", "type": "integer" }, "agglomerate": { "default": true, "title": "Agglomerate", "type": "boolean" }, "data_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Data Name" }, "fill_missing": { "default": false, "title": "Fill Missing", "type": "boolean" } }, "required": [ "store" ], "title": "CloudVolumeWrapper", "type": "object" }, "JaxModel": { "additionalProperties": false, "description": "A JAX/Flax model configuration.\n\nThe model is loaded from a pickled Flax module (or apply function) and\nparameters are loaded from an orbax checkpoint directory or .msgpack file.\nAll JAX imports are lazy so the module loads without JAX installed.", "properties": { "in_channels": { "title": "In Channels", "type": "integer" }, "min_input_shape": { "items": { "type": "integer" }, "title": "Min Input Shape", "type": "array" }, "min_output_shape": { "items": { "type": "integer" }, "title": "Min Output Shape", "type": "array" }, "min_step_shape": { "items": { "type": "integer" }, "title": "Min Step Shape", "type": "array" }, "out_channels": { "anyOf": [ { "items": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "type": "array" }, { "type": "integer" }, { "type": "null" } ], "title": "Out Channels" }, "out_range": { "maxItems": 2, "minItems": 2, "prefixItems": [ { "type": "number" }, { "type": "number" } ], "title": "Out Range", "type": "array" }, "context_override": { "anyOf": [ { "maxItems": 2, "minItems": 2, "prefixItems": [ { "items": { "type": "integer" }, "type": "array" }, { "items": { "type": "integer" }, "type": "array" } ], "type": "array" }, { "type": "null" } ], "default": null, "title": "Context Override" }, "model_type": { "const": "jax", "default": "jax", "title": "Model Type", "type": "string" }, "model_path": { "format": "path", "title": "Model Path", "type": "string" }, "params_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Params Path" }, "pred_size_growth": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Pred Size Growth" } }, "required": [ "in_channels", "min_input_shape", "min_output_shape", "min_step_shape", "out_channels", "out_range", "model_path" ], "title": "JaxModel", "type": "object" }, "LSD": { "additionalProperties": false, "description": "Represents a dataset containing local shape descriptors.", "properties": { "store": { "title": "Store", "type": "string" }, "voxel_size": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Voxel Size" }, "offset": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Offset" }, "axis_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Axis Names" }, "units": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Units" }, "writable": { "default": true, "title": "Writable", "type": "boolean" }, "ops": { "anyOf": [ { "items": { "description": "A python callable, serialized with cloudpickle and base64-encoded. Deserializing executes arbitrary code: only load configs you trust.", "format": "base64-cloudpickle", "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Ops" }, "flip": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Flip" }, "channels": { "anyOf": [ { "items": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "integer" } ] }, "type": "array" }, { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Channels" }, "zarr_kwargs": { "additionalProperties": true, "title": "Zarr Kwargs", "type": "object" }, "sharding": { "default": true, "title": "Sharding", "type": "boolean" }, "inner_chunk_shape": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Inner Chunk Shape" }, "storage_options": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Storage Options" }, "dataset_type": { "const": "lsd", "default": "lsd", "title": "Dataset Type", "type": "string" } }, "required": [ "store" ], "title": "LSD", "type": "object" }, "Labels": { "additionalProperties": false, "description": "Represents an integer label dataset.", "properties": { "store": { "title": "Store", "type": "string" }, "voxel_size": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Voxel Size" }, "offset": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Offset" }, "axis_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Axis Names" }, "units": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Units" }, "writable": { "default": true, "title": "Writable", "type": "boolean" }, "ops": { "anyOf": [ { "items": { "description": "A python callable, serialized with cloudpickle and base64-encoded. Deserializing executes arbitrary code: only load configs you trust.", "format": "base64-cloudpickle", "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Ops" }, "flip": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Flip" }, "channels": { "anyOf": [ { "items": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "integer" } ] }, "type": "array" }, { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Channels" }, "zarr_kwargs": { "additionalProperties": true, "title": "Zarr Kwargs", "type": "object" }, "sharding": { "default": true, "title": "Sharding", "type": "boolean" }, "inner_chunk_shape": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Inner Chunk Shape" }, "storage_options": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Storage Options" }, "dataset_type": { "const": "labels", "default": "labels", "title": "Dataset Type", "type": "string" } }, "required": [ "store" ], "title": "Labels", "type": "object" }, "MaskDataset": { "additionalProperties": false, "description": "A per-block skip mask for a blockwise task.\n\nPoints to a zarr array in the task's *block-grid* space: one element per\nblock, not per voxel. Any nonzero value means \"skip this block\", zero means\n\"run it\". The array must have one cell per block of the task\n(:attr:`BlockwiseTask.block_grid_shape`), and cell ``(0, 0, ...)`` is the\nfirst block of the task's ``write_roi`` whatever the context.\n\nHanded to :attr:`BlockwiseTask.skip_mask`, it is passed straight to daisy as\n``Task(skip_mask=...)``: masked blocks are reported as skipped and release\ntheir downstream dependencies, but are never recorded as done, so the mask\napplies to the run it is passed to. A later run with a narrower mask (or\nnone) runs the blocks it no longer covers, while blocks that completed stay\ndone. This is the generic form of the surface-band skip: a thin predicted\nsurface only touches a few blocks, so the rest can be skipped up front.\n\nGrid-space, not voxel-space: the inherited voxel-metadata fields are unused\nand the array may have any integer or bool dtype; daisy casts it. Read it\nlike any other dataset, with :meth:`array`. How the mask is built is left to\nthe caller.", "properties": { "store": { "title": "Store", "type": "string" }, "voxel_size": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Voxel Size" }, "offset": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Offset" }, "axis_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Axis Names" }, "units": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Units" }, "writable": { "default": true, "title": "Writable", "type": "boolean" }, "ops": { "anyOf": [ { "items": { "description": "A python callable, serialized with cloudpickle and base64-encoded. Deserializing executes arbitrary code: only load configs you trust.", "format": "base64-cloudpickle", "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Ops" }, "flip": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Flip" }, "channels": { "anyOf": [ { "items": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "integer" } ] }, "type": "array" }, { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Channels" }, "zarr_kwargs": { "additionalProperties": true, "title": "Zarr Kwargs", "type": "object" }, "sharding": { "default": true, "title": "Sharding", "type": "boolean" }, "inner_chunk_shape": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Inner Chunk Shape" }, "storage_options": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Storage Options" }, "dataset_type": { "const": "mask", "default": "mask", "title": "Dataset Type", "type": "string" } }, "required": [ "store" ], "title": "MaskDataset", "type": "object" }, "Raw": { "additionalProperties": false, "description": "Represents a dataset containing raw intensities.\nHas support for sampling specific channels, normalizing\nwith provided scale and shifting, or reading in normalization\nbounds from OMERO metadata.", "properties": { "store": { "title": "Store", "type": "string" }, "voxel_size": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Voxel Size" }, "offset": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Offset" }, "axis_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Axis Names" }, "units": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Units" }, "writable": { "default": true, "title": "Writable", "type": "boolean" }, "ops": { "anyOf": [ { "items": { "description": "A python callable, serialized with cloudpickle and base64-encoded. Deserializing executes arbitrary code: only load configs you trust.", "format": "base64-cloudpickle", "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Ops" }, "flip": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Flip" }, "channels": { "anyOf": [ { "items": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "integer" } ] }, "type": "array" }, { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Channels" }, "zarr_kwargs": { "additionalProperties": true, "title": "Zarr Kwargs", "type": "object" }, "sharding": { "default": true, "title": "Sharding", "type": "boolean" }, "inner_chunk_shape": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Inner Chunk Shape" }, "storage_options": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Storage Options" }, "dataset_type": { "const": "raw", "default": "raw", "title": "Dataset Type", "type": "string" }, "ome_norm": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ome Norm" }, "scale_shift": { "anyOf": [ { "maxItems": 2, "minItems": 2, "prefixItems": [ { "type": "number" }, { "type": "number" } ], "type": "array" }, { "type": "null" } ], "default": null, "title": "Scale Shift" }, "stack": { "anyOf": [ { "discriminator": { "mapping": { "affs": "#/$defs/Affs", "cloudvolume": "#/$defs/CloudVolumeWrapper", "labels": "#/$defs/Labels", "lsd": "#/$defs/LSD", "mask": "#/$defs/MaskDataset", "raw": "#/$defs/Raw" }, "propertyName": "dataset_type" }, "oneOf": [ { "$ref": "#/$defs/Raw" }, { "$ref": "#/$defs/Affs" }, { "$ref": "#/$defs/LSD" }, { "$ref": "#/$defs/Labels" }, { "$ref": "#/$defs/MaskDataset" }, { "$ref": "#/$defs/CloudVolumeWrapper" } ] }, { "type": "null" } ], "default": null, "title": "Stack" } }, "required": [ "store" ], "title": "Raw", "type": "object" }, "TorchModel": { "additionalProperties": false, "properties": { "in_channels": { "title": "In Channels", "type": "integer" }, "min_input_shape": { "items": { "type": "integer" }, "title": "Min Input Shape", "type": "array" }, "min_output_shape": { "items": { "type": "integer" }, "title": "Min Output Shape", "type": "array" }, "min_step_shape": { "items": { "type": "integer" }, "title": "Min Step Shape", "type": "array" }, "out_channels": { "anyOf": [ { "items": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "type": "array" }, { "type": "integer" }, { "type": "null" } ], "title": "Out Channels" }, "out_range": { "maxItems": 2, "minItems": 2, "prefixItems": [ { "type": "number" }, { "type": "number" } ], "title": "Out Range", "type": "array" }, "context_override": { "anyOf": [ { "maxItems": 2, "minItems": 2, "prefixItems": [ { "items": { "type": "integer" }, "type": "array" }, { "items": { "type": "integer" }, "type": "array" } ], "type": "array" }, { "type": "null" } ], "default": null, "title": "Context Override" }, "model_type": { "const": "torch", "default": "torch", "title": "Model Type", "type": "string" }, "save_path": { "format": "path", "title": "Save Path", "type": "string" }, "checkpoint_file": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Checkpoint File" }, "pred_size_growth": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Pred Size Growth" } }, "required": [ "in_channels", "min_input_shape", "min_output_shape", "min_step_shape", "out_channels", "out_range", "save_path" ], "title": "TorchModel", "type": "object" }, "Worker": { "additionalProperties": false, "properties": { "queue": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Queue" }, "num_gpus": { "default": 0, "title": "Num Gpus", "type": "integer" }, "num_cpus": { "default": 1, "title": "Num Cpus", "type": "integer" } }, "title": "Worker", "type": "object" } }, "additionalProperties": false, "required": [ "checkpoint", "in_data", "out_data" ] }
- Config:
extra: str = forbid
arbitrary_types_allowed: bool = True
- Fields:
checkpoint (Annotated[volara_ml.models.TorchModel | volara_ml.models.JaxModel, FieldInfo(annotation=NoneType, required=True, discriminator='model_type')])fit (Literal['overhang'])in_data (volara.datasets.Raw)out_data (list[Annotated[volara.datasets.Raw | volara.datasets.Affs | volara.datasets.LSD, FieldInfo(annotation=NoneType, required=True, discriminator='dataset_type')] | None])read_write_conflict (Literal[False])task_type (Literal['predict'])
- field checkpoint: Annotated[TorchModel | JaxModel, FieldInfo(annotation=NoneType, required=True, discriminator='model_type')] [Required]
- field fit: Literal['overhang'] = 'overhang'
The strategy to use for blocks that overhang your total write roi.
- field in_data: Raw [Required]
- field out_data: list[Annotated[Raw | Affs | LSD, FieldInfo(annotation=NoneType, required=True, discriminator='dataset_type')] | None] [Required]
- field read_write_conflict: Literal[False] = False
Whether blocks have read/write dependencies on neighborhing blocks requiring a specific ordering to the block processing to compute a seamless result.
- field task_type: Literal['predict'] = 'predict'