Skip to content

Instantly share code, notes, and snippets.

@hietalajulius
Created July 28, 2023 12:44
Show Gist options
  • Save hietalajulius/18708fa5edaeb1c7a4fa5ddc2ae25d98 to your computer and use it in GitHub Desktop.
Save hietalajulius/18708fa5edaeb1c7a4fa5ddc2ae25d98 to your computer and use it in GitHub Desktop.
/// Get the output of the linear layer.
fn get_output(&self, x: &Array2<f64>) -> Array2<f64> {
// Formula: (W * x^T + b)^T
(self.W.dot(&x.t()) + self.b.clone()).t().to_owned()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment