history store
This commit is contained in:
@@ -88,6 +88,8 @@ pub fn train<B: AutodiffBackend>(training_config: TrainingConfig, device: B::Dev
|
||||
let mut board_state = BoardState::default();
|
||||
let mut episode_buffer: Vec<MctsResults> = vec![];
|
||||
|
||||
let mut game_hist = String::new();
|
||||
|
||||
while board_state.status == BoardStateStatus::Ongoing {
|
||||
let results = mcts.search(&board_state, &infer_model, &device);
|
||||
episode_buffer.push(results);
|
||||
@@ -102,9 +104,15 @@ pub fn train<B: AutodiffBackend>(training_config: TrainingConfig, device: B::Dev
|
||||
|
||||
let stm = board_state.board.side_to_move();
|
||||
let mv = sample_move(&adjusted, &mut rng, stm).unwrap();
|
||||
println!("playing move: {}", mv);
|
||||
// println!("playing move: {}", mv);
|
||||
if episode == 0 {
|
||||
game_hist.push_str(mv.to_string().as_str());
|
||||
game_hist.push(' ');
|
||||
}
|
||||
|
||||
board_state.apply_move(mv)
|
||||
}
|
||||
println!("Game history of first game of iteration: {}", game_hist);
|
||||
|
||||
for result in episode_buffer.iter().enumerate() {
|
||||
if board_state.status == BoardStateStatus::Stalemate
|
||||
|
||||
Reference in New Issue
Block a user