chore(ml-alpha-tests): migrate test fixtures to MultiResolutionConfig
multi_horizon_loader.rs constructs MultiHorizonLoaderConfig with default_three_scale() (matching alpha_train's production default and yielding total_positions()=32). The cfg.seq_len=32 override in loader_stride_4_yields_correct_spacing is now a no-op since the constructor already provides 32, so it's removed with a comment. perception_overfit.rs was untouched — it doesn't construct MultiHorizonLoaderConfig, only PerceptionTrainerConfig (whose own seq_len field is unrelated to the loader migration).
This commit is contained in:
@@ -21,7 +21,7 @@ fn cfg_from_env() -> Option<MultiHorizonLoaderConfig> {
|
||||
Some(MultiHorizonLoaderConfig {
|
||||
files,
|
||||
predecoded_dir: predec,
|
||||
seq_len: 64,
|
||||
multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::default_three_scale(),
|
||||
horizons: HORIZONS,
|
||||
n_max_sequences: 100,
|
||||
seed: 0xA1A2_A3A4,
|
||||
@@ -43,9 +43,9 @@ fn loader_yields_seq_with_valid_labels() {
|
||||
|
||||
let mut count = 0;
|
||||
while let Some(seq) = loader.next_sequence().expect("next") {
|
||||
assert_eq!(seq.snapshots.len(), cfg.seq_len);
|
||||
assert_eq!(seq.snapshots.len(), cfg.multi_resolution.total_positions());
|
||||
for h in 0..N_HORIZONS {
|
||||
assert_eq!(seq.labels[h].len(), cfg.seq_len);
|
||||
assert_eq!(seq.labels[h].len(), cfg.multi_resolution.total_positions());
|
||||
for &v in &seq.labels[h] {
|
||||
assert!(v.is_nan() || v == 0.0 || v == 1.0, "label not binary: {v}");
|
||||
}
|
||||
@@ -65,7 +65,7 @@ fn loader_errors_on_empty_files() {
|
||||
let cfg = MultiHorizonLoaderConfig {
|
||||
files: Vec::new(),
|
||||
predecoded_dir: PathBuf::from("/tmp/does_not_exist_foxhunt_test"),
|
||||
seq_len: 64,
|
||||
multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::default_three_scale(),
|
||||
horizons: HORIZONS,
|
||||
n_max_sequences: 10,
|
||||
seed: 0,
|
||||
@@ -86,12 +86,12 @@ fn loader_stride_4_yields_correct_spacing() {
|
||||
eprintln!("skipping: FOXHUNT_TEST_DATA not set or mbp10 dir missing");
|
||||
return;
|
||||
};
|
||||
cfg.seq_len = 32;
|
||||
// cfg.multi_resolution stays at default_three_scale() (total_positions=32).
|
||||
cfg.n_max_sequences = 5;
|
||||
let mut loader = MultiHorizonLoader::new(&cfg).expect("loader init");
|
||||
|
||||
while let Some(seq) = loader.next_sequence().expect("next") {
|
||||
assert_eq!(seq.snapshots.len(), cfg.seq_len);
|
||||
assert_eq!(seq.snapshots.len(), cfg.multi_resolution.total_positions());
|
||||
let dts_ns: Vec<i64> = (1..seq.snapshots.len())
|
||||
.map(|k| (seq.snapshots[k].ts_ns as i64) - (seq.snapshots[k - 1].ts_ns as i64))
|
||||
.filter(|d| *d >= 0) // ts_ns is monotonic in MBP-10
|
||||
|
||||
Reference in New Issue
Block a user