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

Flightdeck log-cosh

Measure robust regression error in log space and compute its bounded tanh derivative.

Source repository · Package JSON

Use Flightdeck log-cosh

use vendor::fd_log_cosh::log_cosh;

Run the example

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

Expected output

module {
  func.func @main(%x: tensor<2x7xf32>, %target: tensor<2x7xf32>) -> (tensor<2x7xf32>, tensor<2x7xf32>) {
    %v0 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<2x7xf32>
    %v1 = stablehlo.subtract %x, %target : tensor<2x7xf32>
    %v2 = stablehlo.abs %v1 : tensor<2x7xf32>
    %v3 = stablehlo.constant dense<2.00000000000000000e+00> : tensor<2x7xf32>
    %v4 = stablehlo.negate %v3 : tensor<2x7xf32>
    %v5 = stablehlo.multiply %v4, %v2 : tensor<2x7xf32>
    %v6 = stablehlo.exponential %v5 : tensor<2x7xf32>
    %v7 = stablehlo.log_plus_one %v6 : tensor<2x7xf32>
    %v8 = stablehlo.add %v2, %v7 : tensor<2x7xf32>
    %v9 = stablehlo.constant dense<6.93147180559945286e-01> : tensor<2x7xf32>
    %v10 = stablehlo.subtract %v8, %v9 : tensor<2x7xf32>
    %v11 = stablehlo.tanh %v1 : tensor<2x7xf32>
    return %v10, %v11 : tensor<2x7xf32>, tensor<2x7xf32>
  }
}

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesbf9c3d50036db8a3b1639931602e89b9c38afce382b3160529eeade1c806c98b2daed21b3d
0.1.0Download ZIP · Browse filesd5835c510993b792c9f215c933f6331900639a8e757d06d31c3deec7120f397ae2392a8b78