Skip to content

Commit bb60ab4

Browse files
committed
fix: remove chore coments
1 parent 402febb commit bb60ab4

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

scripts/analyze_gtm.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,24 @@ def main():
4242
# Print static analysis (no data needed)
4343
print()
4444
print(analyzer.format_instruction_report())
45+
46+
# Temperature from checkpoint reflects the buffer state at save time.
47+
# During training, temperature is set externally by the annealing schedule
48+
# (tau_start -> tau_end over phases 2+3), so the saved value shows the
49+
# temperature at the epoch when the best checkpoint was saved.
4550
temp_info = analyzer.analyze_temperature()
46-
print('=== Gumbel Temperature ===')
51+
print('=== Gumbel Temperature (at checkpoint save) ===')
4752
for i, t in enumerate(temp_info['temperatures']):
4853
sharp = '*' if temp_info['is_sharp'][i] else ''
4954
print(f' Step {i}: tau={t:.4f} {sharp}')
55+
56+
# Show annealing config if available
57+
checkpoint = torch.load(args.checkpoint, map_location='cpu', weights_only=False)
58+
cfg = checkpoint.get('config', {})
59+
tau_start = cfg.get('training', {}).get('tau_start', None)
60+
tau_end = cfg.get('training', {}).get('tau_end', None)
61+
if tau_start is not None:
62+
print(f' Schedule: {tau_start} -> {tau_end} (linear over phases 2+3)')
5063
print()
5164

5265
# Load validation data

tasks/gtm.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,6 @@ def run(self):
302302
else:
303303
self._current_act_weight = 0.0
304304

305-
# Gumbel temperature annealing:
306-
# Phase 1 (warmup): hold at tau_start
307-
# Phase 2 (circuit): anneal tau_start -> tau_act_restart
308-
# Phase 3 (ACT): warm restart at tau_act_restart, anneal -> tau_end
309-
# Warm restart needed because ACT activates steps[num_steps:max_steps]
310-
# which have untrained weights and need exploration room.
311305
if phase == 1:
312306
tau = self.tau_start
313307
elif phase == 2:

0 commit comments

Comments
 (0)