Skip to content

Conversation

@harpomaxx
Copy link
Collaborator

Description

The model saving was happening inside the testing loop, so every time it hit a save milestone), it was saving the same model 250 times. this fix put this out of the test loop
l

Store the model every --eval_each episodes.

                        # Use episode (training counter) and not test_episode (test counter)
                        if episode % args.store_models_every == 0 and episode != 0:
                            agent.store_q_table(args.models_dir, f'conceptual_q_agent.experiment{args.experiment_id}-episodes-{episode}.pickle')

eldraco and others added 3 commits September 10, 2025 15:50
…ng agent

- Add checks for empty actions list in select_action method for both exploration and exploitation branches
- Return None action when no valid actions are available instead of crashing
- Handle None action in play_game method with graceful episode termination
- Fix typo in comment (ation -> action)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The model saving logic was incorrectly placed inside the testing loop,
causing the same model to be saved 250 times consecutively at each
milestone (e.g., every 20,000 episodes). This resulted in:

- File size fluctuations as saves were repeatedly overwriting
- Extremely long save times due to multiple concurrent operations
- Wasted I/O and disk space

Moved the save check outside the testing loop to ensure models are
saved only once per milestone episode.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants