Handbook
Glossary
normalize ( X -- norm )
Vocabulary
tensors
.
demos
.
private
Inputs
X
an
object
Outputs
norm
an
object
Definition
USING:
accessors
kernel
math.statistics
ranges
sequences
tensors
;
IN:
tensors.demos.private
::
normalize
( X -- norm )
X
transpose
tensor>array
:>
X-T X-T
[
mean
]
map
>tensor
:>
feat-means X
shape>>
first
[0..b)
[
drop
feat-means
]
map
stack
:>
means X-T
[
std
]
map
>tensor
:>
feat-stds X
shape>>
first
[0..b)
[
drop
feat-stds
]
map
stack
:>
stds X means
t-
stds
t/
;