neurovlm.training.ContrastiveTrainConfig

neurovlm.training.ContrastiveTrainConfig#

class neurovlm.training.ContrastiveTrainConfig(domain, output_root='runs', run_id=None, variant='mixed_baseline', seed=42, device='auto', epochs=100, batch_size=64, eval_batch_size=None, num_workers=0, brain_learning_rate=0.0001, projection_learning_rate=0.0003, weight_decay=0.0001, temperature=0.07, gradient_clip=1.0, amp=True, early_stopping_patience=10, early_stopping_min_delta=0.0, max_train_batches=None, max_eval_batches=None, limit=None, split_dir=None, volume_path=None, from_run=None, init_checkpoint=None, resume=None, preset='retained_base64_v1', target_shape=(36, 45, 38), in_channels=1, base_channels=64, num_blocks=4, latent_dim=384, dropout=0.1, norm='group', pooling='max')[source]#

Configuration for one domain-specific Stage 3 branch.

The default mixed_baseline initializes from the released mixed AE; finetuned initializes from the released AE matching domain. from_run and init_checkpoint explicitly replace that AE source.

Parameters:
  • domain (Literal['pubmed', 'nilearn', 'neurovault'])

  • output_root (str | Path)

  • run_id (str | None)

  • variant (Literal['mixed_baseline', 'finetuned'])

  • seed (int)

  • device (str)

  • epochs (int)

  • batch_size (int)

  • eval_batch_size (int | None)

  • num_workers (int)

  • brain_learning_rate (float)

  • projection_learning_rate (float)

  • weight_decay (float)

  • temperature (float)

  • gradient_clip (float | None)

  • amp (bool)

  • early_stopping_patience (int | None)

  • early_stopping_min_delta (float)

  • max_train_batches (int | None)

  • max_eval_batches (int | None)

  • limit (int | None)

  • split_dir (str | Path | None)

  • volume_path (str | Path | None)

  • from_run (str | Path | None)

  • init_checkpoint (str | Path | None)

  • resume (str | Path | None)

  • preset (Literal['retained_base64_v1', 'custom'])

  • target_shape (tuple[int, int, int])

  • in_channels (int)

  • base_channels (int)

  • num_blocks (int)

  • latent_dim (int)

  • dropout (float)

  • norm (Literal['group', 'batch', 'instance', 'none'])

  • pooling (Literal['max', 'stride'])

__init__(domain, output_root='runs', run_id=None, variant='mixed_baseline', seed=42, device='auto', epochs=100, batch_size=64, eval_batch_size=None, num_workers=0, brain_learning_rate=0.0001, projection_learning_rate=0.0003, weight_decay=0.0001, temperature=0.07, gradient_clip=1.0, amp=True, early_stopping_patience=10, early_stopping_min_delta=0.0, max_train_batches=None, max_eval_batches=None, limit=None, split_dir=None, volume_path=None, from_run=None, init_checkpoint=None, resume=None, preset='retained_base64_v1', target_shape=(36, 45, 38), in_channels=1, base_channels=64, num_blocks=4, latent_dim=384, dropout=0.1, norm='group', pooling='max')#
Parameters:
  • domain (Literal['pubmed', 'nilearn', 'neurovault'])

  • output_root (str | Path)

  • run_id (str | None)

  • variant (Literal['mixed_baseline', 'finetuned'])

  • seed (int)

  • device (str)

  • epochs (int)

  • batch_size (int)

  • eval_batch_size (int | None)

  • num_workers (int)

  • brain_learning_rate (float)

  • projection_learning_rate (float)

  • weight_decay (float)

  • temperature (float)

  • gradient_clip (float | None)

  • amp (bool)

  • early_stopping_patience (int | None)

  • early_stopping_min_delta (float)

  • max_train_batches (int | None)

  • max_eval_batches (int | None)

  • limit (int | None)

  • split_dir (str | Path | None)

  • volume_path (str | Path | None)

  • from_run (str | Path | None)

  • init_checkpoint (str | Path | None)

  • resume (str | Path | None)

  • preset (Literal['retained_base64_v1', 'custom'])

  • target_shape (tuple[int, int, int])

  • in_channels (int)

  • base_channels (int)

  • num_blocks (int)

  • latent_dim (int)

  • dropout (float)

  • norm (Literal['group', 'batch', 'instance', 'none'])

  • pooling (Literal['max', 'stride'])

Return type:

None

Methods

__init__(domain[, output_root, run_id, ...])

architecture()

Attributes

amp

base_channels

batch_size

brain_learning_rate

device

dropout

early_stopping_min_delta

early_stopping_patience

epochs

eval_batch_size

from_run

gradient_clip

in_channels

init_checkpoint

internal_variant

latent_dim

limit

max_eval_batches

max_train_batches

norm

num_blocks

num_workers

output_root

pooling

preset

primary_metric

projection_learning_rate

resume

run_id

seed

split_dir

target_shape

temperature

variant

volume_path

weight_decay

domain