pub struct NeuronCache {
pub value: AtomicF32,
pub expected_inputs: usize,
pub finished_inputs: AtomicUsize,
pub claimed: AtomicBool,
}Expand description
Handles the state of a single neuron for NeuralNetCache.
Fields§
§value: AtomicF32The value of the neuron.
expected_inputs: usizeThe expected input count.
finished_inputs: AtomicUsizeThe number of inputs that have finished evaluating.
claimed: AtomicBoolWhether or not a thread has claimed this neuron to work on it.
Implementations§
Source§impl NeuronCache
impl NeuronCache
Sourcepub fn new(bias: f32, expected_inputs: usize) -> Self
pub fn new(bias: f32, expected_inputs: usize) -> Self
Creates a new NeuronCache given relevant info.
Use NeuronCache::from instead to create cache for a Neuron.
Trait Implementations§
Source§impl Debug for NeuronCache
impl Debug for NeuronCache
Source§impl Default for NeuronCache
impl Default for NeuronCache
Source§fn default() -> NeuronCache
fn default() -> NeuronCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for NeuronCache
impl !RefUnwindSafe for NeuronCache
impl Send for NeuronCache
impl Sync for NeuronCache
impl Unpin for NeuronCache
impl UnsafeUnpin for NeuronCache
impl UnwindSafe for NeuronCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more