extern crate ndarray;
pub mod adam;
#[allow(dead_code)]
pub mod sgd;
pub use self::adam::Adam;
pub use self::sgd::SGD;
use std::cmp::{Eq, Ordering, PartialEq};
use tensor::Tensor;
pub struct StateKey<'a>(pub &'a Tensor);
impl<'a> Eq for StateKey<'a> {}
impl<'a> PartialEq for StateKey<'a> {
#[inline]
fn eq(&self, other: &StateKey<'a>) -> bool {
(self.0 as *const _) == (other.0 as *const _)
}
}
impl<'a> Ord for StateKey<'a> {
#[inline]
fn cmp(&self, other: &Self) -> Ordering {
let a = self.0 as *const Tensor;
let b = other.0 as *const Tensor;
a.cmp(&b)
}
}
impl<'a> PartialOrd for StateKey<'a> {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}