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

Flightdeck lion-step

Use a signed interpolated momentum update and decoupled weight decay. The persistent buffer uses beta2=0.99.

Source repository · Package JSON

Use Flightdeck lion-step

use vendor::fd_lion_step::lion_step;

Run the example

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

Expected output

module {
  func.func @main(%weight: tensor<2x7xf32>, %grad: tensor<2x7xf32>, %moment: tensor<2x7xf32>, %lr: tensor<2x7xf32>, %decay: 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, %moment : tensor<2x7xf32>
    %v3 = stablehlo.constant dense<1.00000000000000006e-01> : tensor<2x7xf32>
    %v4 = stablehlo.multiply %v3, %grad : tensor<2x7xf32>
    %v5 = stablehlo.add %v2, %v4 : tensor<2x7xf32>
    %v6 = stablehlo.sign %v5 : tensor<2x7xf32>
    %v7 = stablehlo.constant dense<1.00000000000000000e+00> : tensor<2x7xf32>
    %v8 = stablehlo.multiply %lr, %decay : tensor<2x7xf32>
    %v9 = stablehlo.subtract %v7, %v8 : tensor<2x7xf32>
    %v10 = stablehlo.multiply %weight, %v9 : tensor<2x7xf32>
    %v11 = stablehlo.multiply %lr, %v6 : tensor<2x7xf32>
    %v12 = stablehlo.subtract %v10, %v11 : tensor<2x7xf32>
    %v13 = stablehlo.constant dense<9.89999999999999991e-01> : tensor<2x7xf32>
    %v14 = stablehlo.multiply %v13, %moment : tensor<2x7xf32>
    %v15 = stablehlo.constant dense<1.00000000000000002e-02> : tensor<2x7xf32>
    %v16 = stablehlo.multiply %v15, %grad : tensor<2x7xf32>
    %v17 = stablehlo.add %v14, %v16 : tensor<2x7xf32>
    return %v12, %v17 : tensor<2x7xf32>, tensor<2x7xf32>
  }
}

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesbf9c3d5003dd707d30d97f12d52ccf7558d744a92c49c26ec0f191686fc56ed0339f655963
0.1.0Download ZIP · Browse filesd5835c5109c997157eacb77cf292438e0072407581c02bfd005bb172855b5a7aa11f1078ed