Initializers
Initializers
[function] set-manual-seed
Sets the seed for random operations.[macro] with-manual-seed
Sets the seed for random operations within the scope of the body.[function] ax+b
Generates an array sampled from this formula: x_i = a * index_components(i) + b.
There is a linspace
function for the same purpose, but it is not lazy.
Result
Result
[function] !rand
Creates a tensor whose elements are randomly sampled from a uniform distribution over the interval [0, 1)
.
There is a rand
function for the same purpose, but it is not lazy.
Result
{Tensor{LISPBUFFER}[float32] :shape (3 3) :id STC215307
((0.40309912 0.8688215 0.9638163)
(0.032803092 0.918832 0.59222883)
(0.53384453 0.48372424 0.8027758))
:op #<PROCEEDNODE {10072FC363}>
:requires-grad NIL
:variables (STC207840)
:tracker #<TRACKER :order={row(0 1)} :shape=(3 3) :contiguous-p=T>}
Result
[function] !normal
Creates a tensor whose elements are randomly sampled from a normal distribution with the given mean
and std
.
There is a normal
function for the same purpose, but it is not lazy.
Result
{Tensor{LISPBUFFER}[float32] :shape (3 3) :id STC231243
((1.9926395 -3.0460858 2.0359108)
(-1.3665679 2.2740877 -0.34971234)
(0.7738801 -0.7173807 1.5476315))
:op #<PROCEEDNODE {100394FD63}>
:requires-grad NIL
:variables (STC215320)
:tracker #<TRACKER :order={row(0 1)} :shape=(3 3) :contiguous-p=T>}
Result
{Tensor{LISPBUFFER}[float32] :shape (3 3) :id TID231244
((-0.6933528 -0.618868 -0.09813504)
(-0.3018336 0.73544437 -1.0356082)
(-1.6392002 0.5641113 -0.094371416))
:op #<ALLOCATE {10038585C3}>
:requires-grad NIL
:variables NIL
:tracker #<TRACKER :order={row(0 1)} :shape=(3 3) :contiguous-p=T>}
[function] !randn
Creates a tensor whose elements are randomly sampled from a normal distribution with a mean of 0 and a standard deviation of 1.
There is a randn
function for the same purpose, but it is not lazy.
Result
{Tensor{LISPBUFFER}[float32] :shape (3 3) :id STC263491
((0.4054314 -2.6517396 -0.93262064)
(-0.44230795 -0.18937276 -0.42351857)
(0.09603451 -0.004643383 -0.9779817))
:op #<PROCEEDNODE {1001D978C3}>
:requires-grad NIL
:variables (STC248794)
:tracker #<TRACKER :order={row(0 1)} :shape=(3 3) :contiguous-p=T>}
Result
[function] !uniform
(!uniform shape &key (low 0.0) (high 1.0) (dtype *default-float*) (order *default-order*) (out nil))
Creates a tensor whose elements are randomly sampled from a uniform distribution over the interval [low, high)
There is a uniform
function for the same purpose, but it is not lazy.
Result
{Tensor{LISPBUFFER}[float32] :shape (3 3) :id STC272262
((1.5054502 1.7935554 1.0513923)
(1.4500921 1.7713478 1.5610737)
(1.7057834 1.4408889 1.9995518))
:op #<PROCEEDNODE {10054A87E3}>
:requires-grad NIL
:variables (STC263504)
:tracker #<TRACKER :order={row(0 1)} :shape=(3 3) :contiguous-p=T>}
Result
[function] !randint
Creates a tensor whose elements are randomly sampled from a uniform distribution over the interval [low, high)
.
There is a randint
function for the same purpose, but it is not lazy.
CATEN-USER> (ctx:with-contextvar (:backend "clang") (proceed (!randint `(3 3) :low 1 :high 10)))
Result
CATEN-USER> (ctx:with-contextvar (:backend "clang") (randint `(3 3) :low 1 :high 10 :dtype :int32))
Result
[function] !full
Initializes a tensor filled with fill-value
.
Result
{Tensor{LISPBUFFER}[float32] :shape (3 3) :id STC339745
((#.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY #.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY #.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY)
(#.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY #.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY #.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY)
(#.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY #.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY #.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY))
:op #<PROCEEDNODE {10091948C3}>
:requires-grad NIL
:variables (TID339684)
:tracker #<TRACKER :order={row(0 1)} :shape=(3 3) :contiguous-p=T>}
[function] xavier-uniform
No description provided
[function] xavier-gaussian
No description provided