floor

floor, function

def const dash autodiff pure floor(quantity: number): number

Returns quantity rounded down to the nearest integer.

Examples

table T = with
  [| as X |]
  [| -1.7 |]
  [| -0.5 |]
  [| 0.2 |]
  [| 1.9 |]

show table "Floor" with
  T.X
  floor(T.X) as "Floor"

This produces the following table:

X Floor
-1.7 -2
-0.5 -1
0.2 0
1.9 1

Remarks

Inside an autodiff block, the gradient for floor is defined as 1 to support discrete policy optimization.

See also

User Contributed Notes
0 notes + add a note