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

Flightdeck brier-fit

Score binary probability calibration from logits with the Brier loss and its chain-rule gradient.

Source repository · Package JSON

Use Flightdeck brier-fit

use vendor::fd_brier_fit::brier_fit;

Run the example

nest demo fd_brier_fit@0.1.1
blyxc native-run fd_brier_fit-demo/main.blyx
Example source and expected output
use vendor::fd_brier_fit::brier_fit;
fn main() { fd_brier_fit(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.logistic %x : tensor<2x7xf32>
    %v2 = stablehlo.subtract %v1, %target : tensor<2x7xf32>
    %v3 = stablehlo.multiply %v2, %v2 : tensor<2x7xf32>
    %v4 = stablehlo.constant dense<2.00000000000000000e+00> : tensor<2x7xf32>
    %v5 = stablehlo.multiply %v4, %v2 : tensor<2x7xf32>
    %v6 = stablehlo.multiply %v5, %v1 : tensor<2x7xf32>
    %v7 = stablehlo.constant dense<1.00000000000000000e+00> : tensor<2x7xf32>
    %v8 = stablehlo.subtract %v7, %v1 : tensor<2x7xf32>
    %v9 = stablehlo.multiply %v6, %v8 : tensor<2x7xf32>
    return %v3, %v9 : tensor<2x7xf32>, tensor<2x7xf32>
  }
}

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesbf9c3d5003d3a8b3b729e2b354aca8c797c079ec34fda07f6034014f636b6be1539ec649ae
0.1.0Download ZIP · Browse filesd5835c5109f5092842768f4c109a8b7c050c0616a3f633d8b038537036f81fac564eff74be