| """ |
| Hyperparameters, feature definitions, and normalization config. |
| |
| All magic numbers live here so experiments are easy to re-run with |
| different settings. |
| """ |
|
|
| from dataclasses import dataclass, field |
|
|
| |
| |
|
|
| |
| INPUT_FEATURES_B = [ |
| "n_exc", |
| "n_inh", |
| "conn_prob", |
| "n_synapses", |
| "mean_in_degree", |
| "gS_exc_effective", |
| "ou_mu_effective", |
| "ou_sigma_effective", |
| "ou_tau", |
| "sim_duration_ms", |
| "ach_level", |
| ] |
|
|
| INPUT_FEATURES_A = [f for f in INPUT_FEATURES_B if f != "ach_level"] |
|
|
| |
| OUTPUT_STATS = [ |
| "mean_firing_rate", |
| "mean_exc_rate", |
| "mean_inh_rate", |
| "mean_cv_isi", |
| "mean_fano_factor", |
| "synchrony_index", |
| "mean_pairwise_corr", |
| "peak_frequency_hz", |
| "total_spectral_power", |
| "n_active_neurons", |
| "total_spikes", |
| ] |
|
|
| |
| |
| LOG_TRANSFORM_STATS = { |
| "total_spectral_power", |
| "total_spikes", |
| "n_active_neurons", |
| } |
|
|
| |
| LOG_TRANSFORM_INPUTS = { |
| "n_synapses", |
| "gS_exc_effective", |
| } |
|
|
|
|
| |
|
|
| @dataclass |
| class TrainConfig: |
| """Training hyperparameters β small model, fast iteration.""" |
|
|
| |
| d_model: int = 64 |
| n_heads: int = 4 |
| n_layers: int = 4 |
| d_ff: int = 256 |
| dropout: float = 0.1 |
|
|
| |
| batch_size: int = 2048 |
| lr: float = 1e-3 |
| weight_decay: float = 1e-2 |
| warmup_steps: int = 500 |
| max_epochs: int = 200 |
| patience: int = 20 |
| grad_clip: float = 1.0 |
|
|
| |
| val_frac: float = 0.1 |
| seed: int = 42 |
|
|
| |
| sim_dir: str = "/data/sims/prod_5k_v13/circuits" |
| extra_ach0_dir: str = "/data/sims/ach0_extra/circuits" |
| allen_dir: str = "/data/allen/epochs" |
| checkpoint_dir: str = "/data/training/checkpoints" |
| log_dir: str = "/data/training/logs" |
|
|
| |
| aug_noise_scale: float = 0.02 |
| aug_mixup_alpha: float = 0.2 |
|
|
| |
| mlp_hidden: list = field(default_factory=lambda: [64, 64]) |
| mlp_dropout: float = 0.1 |
|
|
| |
| n_input_features_a: int = field(init=False) |
| n_input_features_b: int = field(init=False) |
| n_output_stats: int = field(init=False) |
|
|
| def __post_init__(self): |
| self.n_input_features_a = len(INPUT_FEATURES_A) |
| self.n_input_features_b = len(INPUT_FEATURES_B) |
| self.n_output_stats = len(OUTPUT_STATS) |
|
|