Skip to content

Instantly share code, notes, and snippets.

@Albertbol
Created March 13, 2021 12:11
Show Gist options
  • Save Albertbol/bbf0c4b8ea725ab2d741fc7595206292 to your computer and use it in GitHub Desktop.
Save Albertbol/bbf0c4b8ea725ab2d741fc7595206292 to your computer and use it in GitHub Desktop.
adjustWeights(input, weights, bias, gradients) {
const inputT = Matrix.transpose(input)
const weightsDelta = Matrix.multiply(gradients, inputT)
weights = Matrix.map(weights, { m: weightsDelta, add: true })
bias = Matrix.map(bias, { m: gradients, add: true })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment