Skip to content

Commit

Permalink
Add Serialize/Deserialize to fa module
Browse files Browse the repository at this point in the history
  • Loading branch information
tspooner committed Oct 21, 2017
1 parent 70dd8b3 commit cd1698a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/fa/linear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use ndarray::{ArrayView, Array1, Array2};
use geometry::Space;


#[derive(Serialize, Deserialize)]
pub struct Linear<S: Space, P: Projection<S>> {
projector: P,
weights: Array2<f64>,
Expand Down
1 change: 1 addition & 0 deletions src/fa/projection/rbf_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use geometry::{Span, Space, RegularSpace};
use geometry::dimensions::{Continuous, Partitioned};


#[derive(Serialize, Deserialize)]
pub struct RBFNetwork {
mu: Array2<f64>,
gamma: Array1<f64>,
Expand Down
1 change: 1 addition & 0 deletions src/fa/projection/sutton_tc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extern {
}


#[derive(Serialize, Deserialize)]
pub struct SuttonTiles {
n_tilings: i32,
memory_size: i32,
Expand Down
1 change: 1 addition & 0 deletions src/fa/projection/uniform_grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use geometry::{Space, RegularSpace};
use geometry::dimensions::{Dimension, Continuous, Partitioned};


#[derive(Serialize, Deserialize)]
pub struct UniformGrid {
n_features: usize,
input_space: RegularSpace<Partitioned>,
Expand Down
4 changes: 2 additions & 2 deletions src/fa/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use std::collections::HashMap;
///
/// assert_eq!(f.evaluate(&(0, 1)), 1.0);
/// ```
#[derive(Clone)]
pub struct Table<K, V>(HashMap<K, V>);
#[derive(Clone, Serialize, Deserialize)]
pub struct Table<K: Hash + Eq, V>(HashMap<K, V>);

impl<K: Hash + Eq, V> Table<K, V> {
pub fn new() -> Self {
Expand Down

0 comments on commit cd1698a

Please sign in to comment.