You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(probe): add weighted cross-entropy loss, sweep-to-final pipeline, and vectorized binning
- Add --loss {cross_entropy,weighted_cross_entropy} with per-bin adaptive
class weights w_pos = λ · n_neg/n_pos to counter class imbalance
- Add --pos-weight λ (log-uniform swept in [0.1, 10.0]) as tunable multiplier
- Add sweep --then-final to automatically fetch best W&B config and train
all layers in one command
- Add final --from-sweep to load best HPs from an existing sweep via W&B API
- Add fetch_best_sweep_config() to query sweep.best_run() programmatically
- Vectorize bin_mask computation: pre-compute bin_ids tensor instead of
per-element .item() Python loop (O(N × n_bins) → O(N))
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* docs(readme): document weighted CE loss, sweep→final pipeline, and --from-sweep
Add sections for --loss {cross_entropy,weighted_cross_entropy}, --pos-weight,
--then-final (one-command sweep→final), and --from-sweep (auto-load best HPs).
Update SLURM examples to show new flags.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat(probe): add fixed_params to sweep, ECE metric, and extend dashboard exports
- create_sweep() now accepts optional fixed_params dict to pin specific HPs
while sweeping the remaining ones (e.g., sweep only pos_weight)
- sweep subcommand gains --fixed JSON arg for CLI-driven fixed params
- Added Expected Calibration Error (ECE) to ProbeResult and training loop
- Dashboard exports now include test_auc, val_auc, test_ece, val_ece
- Bumped SLURM sweep time limit from 2h to 4h for sweep+final chains
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat(probe): save model weights after final training, add ECE to tests
- train_probe_layer() now returns (results, weights) tuple — weights dict
contains per-bin state_dict and training mean for inference
- run_final() saves weights.pt alongside results.pt
- run_sweep() discards weights (sweeps don't need them)
- Fixed tests for new ProbeResult fields (val_ece, test_ece) and new
return type of train_probe_layer()
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(probe): require explicit n_bins=1 for pooled training with n_eval_bins
Replace implicit train_n_bins override (1 if n_eval_bins set) with explicit
validation: n_eval_bins must equal n_bins or n_bins must be 1. Update CLI
help text to reflect the new constraint.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Apply suggestion from @andre15silva
---------
Co-authored-by: Tux <tux.tu@outlook.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
The sweep explores `lr`, `weight_decay`, `batch_size`, `patience`, `loss` (cross_entropy vs weighted_cross_entropy), and `pos_weight` (log-uniform in [0.1, 10.0]) via Bayesian optimisation. Copy the best HPs from the W&B dashboard.
235
+
236
+
#### Mode C: Sweep → final (fully automatic)
237
+
238
+
```bash
239
+
uv run python run_probe.py \
240
+
--run-id my_run --probe will_be_correct \
241
+
--model-config configs/models/qwen3_8b.yaml \
242
+
sweep --count 50 --then-final
243
+
```
244
+
245
+
Runs the sweep, waits for completion, fetches the best config from W&B via `fetch_best_sweep_config()`, and trains on all probe layers — no manual copy-paste.
246
+
247
+
#### Mode D: Final from an existing sweep
248
+
249
+
```bash
250
+
uv run python run_probe.py \
251
+
--run-id my_run --probe will_be_correct \
252
+
--model-config configs/models/qwen3_8b.yaml \
253
+
final --from-sweep abc123xyz
254
+
```
255
+
256
+
Queries `sweep.best_run()` via the W&B API to auto-populate `lr`, `weight_decay`, `batch_size`, `patience`, `loss`, and `pos_weight`.
257
+
258
+
### 4. Figures
218
259
219
260
```bash
220
261
uv run python run_figures.py \
@@ -223,7 +264,7 @@ uv run python run_figures.py \
0 commit comments