Skip to content

Instantly share code, notes, and snippets.

@hietalajulius
Created July 28, 2023 12:42
Show Gist options
  • Save hietalajulius/5adbe8b9c387629b6371b1b1e76a1f49 to your computer and use it in GitHub Desktop.
Save hietalajulius/5adbe8b9c387629b6371b1b1e76a1f49 to your computer and use it in GitHub Desktop.
/// LinearLayer represents a linear layer in a neural network.
pub struct LinearLayer {
pub W: Array2<f64>,
pub b: Array2<f64>,
// Gradient of the loss
pub dL_dW: Option<Array2<f64>>,
pub dL_db: Option<Array2<f64>>,
// Gradient of the output
pub dy_dW: Option<Array2<f64>>,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment