A neural network trained with PPO (Proximal Policy Optimization) to play
Beasty Bar, a strategic card game where animals compete to enter Heaven (the bar) while avoiding Hell.
Evaluated with 500 games per opponent (both sides), greedy action selection.
1import torch
2from huggingface_hub import hf_hub_download
3
4# Download the latest model
5checkpoint_path = hf_hub_download(
6 repo_id="shiptoday101/beastybar-ppo",
7 filename="v4/final.pt"
8)
9
10# Load checkpoint
11checkpoint = torch.load(checkpoint_path, map_location="cpu", weights_only=False)
12
13# Access the network weights
14state_dict = checkpoint["model_state_dict"]
15config = checkpoint["config"]
16
17print(f"Iteration: {checkpoint['iteration']}")
18print(f"Network config: {config['network_config']}")
1# Clone the game repo first: git clone https://github.com/diegooprime/beastybar
2from _02_agents.neural.network import BeastyBarNetwork
3from _02_agents.neural.utils import NetworkConfig
4from _03_training.checkpoint_manager import load_for_inference
5
6# Load for inference (smaller footprint)
7state_dict, config = load_for_inference("path/to/v4_final.pt")
8network = BeastyBarNetwork(NetworkConfig.from_dict(config))
9network.load_state_dict(state_dict)
10network.eval()