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

Flightdeck rmsprop-step

Smooth squared gradients with decay 0.99 and update parameters with a scale-adjusted step.

Source repository · Package JSON

Use Flightdeck rmsprop-step

use vendor::fd_rmsprop_step::rmsprop_step;

Run the example

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

Expected output

module {
  func.func @main(%weight: tensor<2x7xf32>, %grad: tensor<2x7xf32>, %variance: tensor<2x7xf32>, %lr: tensor<2x7xf32>) -> (tensor<2x7xf32>, tensor<2x7xf32>) {
    %v0 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<2x7xf32>
    %v1 = stablehlo.constant dense<9.89999999999999991e-01> : tensor<2x7xf32>
    %v2 = stablehlo.multiply %v1, %variance : tensor<2x7xf32>
    %v3 = stablehlo.constant dense<1.00000000000000002e-02> : tensor<2x7xf32>
    %v4 = stablehlo.multiply %v3, %grad : tensor<2x7xf32>
    %v5 = stablehlo.multiply %v4, %grad : tensor<2x7xf32>
    %v6 = stablehlo.add %v2, %v5 : tensor<2x7xf32>
    %v7 = stablehlo.multiply %lr, %grad : tensor<2x7xf32>
    %v8 = stablehlo.sqrt %v6 : tensor<2x7xf32>
    %v9 = stablehlo.constant dense<1.00000000000000002e-08> : tensor<2x7xf32>
    %v10 = stablehlo.add %v8, %v9 : tensor<2x7xf32>
    %v11 = stablehlo.divide %v7, %v10 : tensor<2x7xf32>
    %v12 = stablehlo.subtract %weight, %v11 : tensor<2x7xf32>
    return %v12, %v6 : tensor<2x7xf32>, tensor<2x7xf32>
  }
}

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesbf9c3d50031dc48601f26dd900e2ab2f18be76c35524ec75a8bd2fdfb7e8f5854a1cdb623b
0.1.0Download ZIP · Browse filesd5835c5109681edf3da28337b3f305d6fd9cfa19d36580a67557e58794d7eb58acd498704d