Skip to content

Commit

Permalink
chore: fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Jun 6, 2024
1 parent 927987c commit 53ade15
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl Default for Context {
let position = Position::from_str("x5o/7/7/7/7/7/o5x x 0 1").unwrap();
Context {
position,
searcher: Searcher::new(position, mcts::policy::handcrafted, mcts::value::material),
searcher: Searcher::new(position, mcts::policy::monty, mcts::value::monty),
}
}
}
2 changes: 1 addition & 1 deletion src/mcts/features.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use goober::SparseVector;

use super::policy::PolicyNetwork;
use super::simulate::ValueNetwork;
use super::value::ValueNetwork;

#[repr(C)]
pub struct Nets(pub ValueNetwork<2916, 256>, pub PolicyNetwork);
Expand Down
2 changes: 2 additions & 0 deletions src/mcts/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
pub mod policy;
pub mod value;

mod features;
mod node;
mod params;
mod tree;

use std::mem;
use std::time;

pub use self::features::*;
pub use self::node::*;
pub use self::params::*;
pub use self::tree::*;
Expand Down
7 changes: 5 additions & 2 deletions src/mcts/policy.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use crate::mcts::{get_features, NETS};
use ataxx::{BitBoard, Move};

use goober::{activation, layer, FeedForwardNetwork, Matrix, SparseVector, Vector};

pub type Fn = fn(position: &ataxx::Position, mov: Move) -> f64;

pub fn handcrafted(position: &ataxx::Position, mov: Move) -> f64 {
Expand All @@ -26,8 +29,8 @@ pub fn handcrafted(position: &ataxx::Position, mov: Move) -> f64 {
score.max(0.1)
}

pub fn monty(node: &Node, mov: Move) -> f64 {
NETS.1.get(&mov, &get_features(&node.position)) as f64
pub fn monty(position: &ataxx::Position, mov: Move) -> f64 {
NETS.1.get(&mov, &get_features(position)) as f64
}

#[repr(C)]
Expand Down

0 comments on commit 53ade15

Please sign in to comment.