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

Flightdeck quantile-fit

Train conditional quantiles with pinball loss. Supply a quantile between zero and one. Use zero subgradient at a tie.

Source repository · Package JSON

Use Flightdeck quantile-fit

use vendor::fd_quantile_fit::quantile_fit;

Run the example

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

Expected output

module {
  func.func @main(%x: tensor<2x7xf32>, %target: tensor<2x7xf32>, %tau: tensor<2x7xf32>) -> (tensor<2x7xf32>, tensor<2x7xf32>) {
    %v0 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<2x7xf32>
    %v1 = stablehlo.subtract %target, %x : tensor<2x7xf32>
    %v2 = stablehlo.multiply %tau, %v1 : tensor<2x7xf32>
    %v3 = stablehlo.constant dense<1.00000000000000000e+00> : tensor<2x7xf32>
    %v4 = stablehlo.subtract %tau, %v3 : tensor<2x7xf32>
    %v5 = stablehlo.multiply %v4, %v1 : tensor<2x7xf32>
    %v6 = stablehlo.maximum %v2, %v5 : tensor<2x7xf32>
    %v7 = stablehlo.compare GT, %v1, %v0, FLOAT : (tensor<2x7xf32>, tensor<2x7xf32>) -> tensor<2x7xi1>
    %v8 = stablehlo.negate %tau : tensor<2x7xf32>
    %v9 = stablehlo.compare LT, %v1, %v0, FLOAT : (tensor<2x7xf32>, tensor<2x7xf32>) -> tensor<2x7xi1>
    %v10 = stablehlo.subtract %v3, %tau : tensor<2x7xf32>
    %v11 = stablehlo.select %v9, %v10, %v0 : tensor<2x7xi1>, tensor<2x7xf32>
    %v12 = stablehlo.select %v7, %v8, %v11 : tensor<2x7xi1>, tensor<2x7xf32>
    return %v6, %v12 : tensor<2x7xf32>, tensor<2x7xf32>
  }
}

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesbf9c3d5003fc19f15be6f35a96ed2112e179b440bf1b2e77026b908b5fda4f8ec5ec5dd18a
0.1.0Download ZIP · Browse filesd5835c51094ddeb7223bb5f9d513a08c99d568e3372be3faf6c825b91f1e3766776539f1ac