pub struct GpuNeuralSolver {
pub layers: Vec<NeuralLayer>,
pub learning_rate: f64,
}Expand description
Multi-layer perceptron running on the CPU mock GPU backend.
Layers are stacked so that the output of layer i feeds into layer i+1.
All hidden activations use ReLU; the final layer is linear.
Fields§
§layers: Vec<NeuralLayer>Ordered list of dense layers.
learning_rate: f64Learning rate (stored for future back-prop use).
Implementations§
Source§impl GpuNeuralSolver
impl GpuNeuralSolver
Sourcepub fn new(layer_sizes: &[usize], lr: f64) -> Self
pub fn new(layer_sizes: &[usize], lr: f64) -> Self
Build a network from an ordered list of layer widths.
layer_sizes must contain at least two elements: the first is the
input dimension and the last is the output dimension.
Sourcepub fn forward_pass(&self, input: &[f64]) -> Vec<f64>
pub fn forward_pass(&self, input: &[f64]) -> Vec<f64>
Run a full forward pass through all layers (ReLU hidden, linear output).
Sourcepub fn layer_count(&self) -> usize
pub fn layer_count(&self) -> usize
Number of layers (= number of weight matrices).
Trait Implementations§
Source§impl Clone for GpuNeuralSolver
impl Clone for GpuNeuralSolver
Source§fn clone(&self) -> GpuNeuralSolver
fn clone(&self) -> GpuNeuralSolver
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GpuNeuralSolver
impl RefUnwindSafe for GpuNeuralSolver
impl Send for GpuNeuralSolver
impl Sync for GpuNeuralSolver
impl Unpin for GpuNeuralSolver
impl UnsafeUnpin for GpuNeuralSolver
impl UnwindSafe for GpuNeuralSolver
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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