Blyx Nest Blyx language
Registry / Framework
framework · v0.1.1

Flightdeck momentum-step

Advance weights and their velocity with classical momentum 0.9. Supply the learning rate as an input.

Source repository · Package JSON

Use Flightdeck momentum-step

use vendor::fd_momentum_step::momentum_step;

Run the example

nest demo fd_momentum_step@0.1.1
blyxc native-run fd_momentum_step-demo/main.blyx
Example source and expected output
use vendor::fd_momentum_step::momentum_step;
fn main() { fd_momentum_step(2, 7); }

Expected output

module {
  func.func @main(%weight: tensor<2x7xf32>, %grad: tensor<2x7xf32>, %velocity: tensor<2x7xf32>, %lr: tensor<2x7xf32>) -> (tensor<2x7xf32>, tensor<2x7xf32>) {
    %v0 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<2x7xf32>
    %v1 = stablehlo.constant dense<9.00000000000000022e-01> : tensor<2x7xf32>
    %v2 = stablehlo.multiply %v1, %velocity : tensor<2x7xf32>
    %v3 = stablehlo.add %v2, %grad : tensor<2x7xf32>
    %v4 = stablehlo.multiply %lr, %v3 : tensor<2x7xf32>
    %v5 = stablehlo.subtract %weight, %v4 : tensor<2x7xf32>
    return %v5, %v3 : tensor<2x7xf32>, tensor<2x7xf32>
  }
}

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesbf9c3d5003716cdb2c4bdb3f3c40e6f13820f5a8615235fabc9a5bded261873863bc5d2047
0.1.0Download ZIP · Browse filesd5835c5109e849b72b8a6d9c907208841265d06da2868d343b11972ca363f39bcffe71302a