ceiling

ceiling, function

def const autodiff pure ceiling(a: number): number

Returns the smallest integer greater than or equal to a.

Example

show table "" with
  ceiling(-1.7) 
  ceiling(-0.5) 
  ceiling(0.2)  
  ceiling(1.9)

This outputs the following table:

ceiling(-1.7) ceiling(-0.5) ceiling(0.2) ceiling(1.9)
-1 0 1 2

Remarks

When used inside an Autodiff block, the gradient associated to ceiling() is 1, instead of 0, as the mathematical definition would suggest. The purpose of this irregular behavior is to facilate the design of discrete policies.

See also

User Contributed Notes
0 notes + add a note