pub struct AttributeReconstructionObjective { /* private fields */ }Expand description
A simple multi-layer perceptron for attribute reconstruction.
Architecture: input_dim → hidden_dim → … → input_dim (tanh between
hidden layers, linear output). No back-propagation is implemented here;
this struct provides the forward pass for inference / loss computation.
Implementations§
Source§impl AttributeReconstructionObjective
impl AttributeReconstructionObjective
Sourcepub fn new(input_dim: usize, config: AttrReconConfig, seed: u64) -> Result<Self>
pub fn new(input_dim: usize, config: AttrReconConfig, seed: u64) -> Result<Self>
Build a new MLP for input_dim-dimensional features.
Layers are randomly initialised. Use the same seed for
reproducibility.
§Errors
Returns GraphError::InvalidParameter if input_dim == 0 or
n_layers == 0.
Sourcepub fn mse_loss(
&self,
predicted: &[Vec<f64>],
target: &[Vec<f64>],
) -> Result<f64>
pub fn mse_loss( &self, predicted: &[Vec<f64>], target: &[Vec<f64>], ) -> Result<f64>
Mean squared error between predicted and target.
§Errors
Returns GraphError::InvalidParameter if shapes differ.
Sourcepub fn config(&self) -> &AttrReconConfig
pub fn config(&self) -> &AttrReconConfig
Access the underlying config.
Auto Trait Implementations§
impl Freeze for AttributeReconstructionObjective
impl RefUnwindSafe for AttributeReconstructionObjective
impl Send for AttributeReconstructionObjective
impl Sync for AttributeReconstructionObjective
impl Unpin for AttributeReconstructionObjective
impl UnsafeUnpin for AttributeReconstructionObjective
impl UnwindSafe for AttributeReconstructionObjective
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