Internal Deep Diamond API mostly relevant to programmers who write tools, extensions and additional backend engines.
When implementing your own backend, in addition to the light documentation provided in this namespace, please refer to the DNNL implementation and its tests. It is currently the most complete one. Next, see the cuDNN GPU backend to see how it solves differences in general approach to computation. There are countless small and not so small gotchas with these complex technologies, so expect lots of debugging.
Internal Deep Diamond API mostly relevant to programmers who write tools, extensions and additional backend engines. When implementing your own backend, in addition to the light documentation provided in this namespace, please refer to the DNNL implementation and its tests. It is currently the most complete one. Next, see the cuDNN GPU backend to see how it solves differences in general approach to computation. There are countless small and not so small gotchas with these complex technologies, so expect lots of debugging.
An object that can be trained with the backpropagation algorithm.
An object that can be trained with the backpropagation algorithm.
(backward this)
(backward this hyperparam)
Do the backward pass with the provided hyperparam
s relevant to the encompassing backprop
variants such as stochastic gradient descent or Adam.
Do the backward pass with the provided `hyperparam` s relevant to the encompassing backprop variants such as stochastic gradient descent or Adam.
(forward this)
(forward this hyperparam)
Do the forward pass with the provided hyperparam
s relevant to the encompassing backprop
variants such as stochastic gradient descent or Adam.
Do the forward pass with the provided `hyperparam` s relevant to the encompassing backprop variants such as stochastic gradient descent or Adam.
An object that can provide information relevant for batch based computation.
An object that can provide information relevant for batch based computation.
(batch-index this)
The index of batch in tensor shape (typically 0, but can be 1 for RNN).
The index of batch in tensor shape (typically 0, but can be 1 for RNN).
A backend factory for supported cost implementations.
A backend factory for supported cost implementations.
(crossentropy-cost this last-layer train-tz)
Create cross-entropy cost blueprint.
Create cross-entropy cost blueprint.
(mean-absolute-cost this last-layer train-tz)
Create absolute cost blueprint.
Create absolute cost blueprint.
(quadratic-cost this last-layer train-tz)
Create quadratic cost blueprint.
Create quadratic cost blueprint.
An object that can provide several descriptors for connecting with other layers in different contexts (inference, training, and gradients.)
An object that can provide several descriptors for connecting with other layers in different contexts (inference, training, and gradients.)
(diff-desc this)
Descriptor used for propagating gradients.
Descriptor used for propagating gradients.
(inf-desc this)
Descriptor used in inference layer.
Descriptor used in inference layer.
(train-desc this)
Descriptor used in training layer.
Descriptor used in training layer.
An object that can provide a DD backend factory, and native backend factory.
An object that can provide a DD backend factory, and native backend factory.
(diamond-factory this)
Returens the backend factory related to this object.
Returens the backend factory related to this object.
(native-diamond-factory this)
Returns native backend factory related to this object.
Returns native backend factory related to this object.
An object that has weights gradients (typically objects that can be used in training).
An object that has weights gradients (typically objects that can be used in training).
(diff-weights this)
Gradient weights tensor.
Gradient weights tensor.
An object that can transfer gradient data.
An object that can transfer gradient data.
(diff-input this)
Gradients at the input of this
.
Gradients at the input of `this`.
(diff-output this)
Gradients at the output of this
.
Gradients at the output of `this`.
(diff-z this)
Gradients after the linear part of this
transformation.
Gradients after the linear part of `this` transformation.
A backend factory for neural networks related structures, that typically creates blueprints for common layers such as fully connected layers, convolutions, batch normalization, etc.
A backend factory for neural networks related structures, that typically creates blueprints for common layers such as fully connected layers, convolutions, batch normalization, etc.
(inner-product-blueprint this src-desc dst-desc weights-type)
Create technology specific inner product blueprint with input src-desc
,
output dst-desc
, and weights-type
keyword.
Create technology specific inner product blueprint with input `src-desc`, output `dst-desc`, and `weights-type` keyword.
(gaussian-dropout-blueprint this src-desc sd)
Create dropout layer blueprint with input src-desc
, and standard deviation scalar sd
.
Create dropout layer blueprint with input `src-desc`, and standard deviation scalar `sd`.
(create-workspace this byte-size)
Creates technology specific workspace of byte-size
size.
Creates technology specific workspace of `byte-size` size.
(sum-blueprint this src-descs)
Create summing layer blueprint with inputs src-descs
.
Create summing layer blueprint with inputs `src-descs`.
(concat-blueprint this src-descs conc-dim dst-type)
Create concatenation layer blueprint with inputs src-descs
, scalar conc-dim
,
and dst-type
keyword.
Create concatenation layer blueprint with inputs `src-descs`, scalar `conc-dim`, and `dst-type` keyword.
(fc-blueprint this src-desc dst-desc activ alpha beta weights-type)
Create fully connected (dense) layer blueprint with input src-desc
,
output dst-desc
, activ
keyword, alpha
, and beta
scalar parameters,
and weights-type
keyword.
Create fully connected (dense) layer blueprint with input `src-desc`, output `dst-desc`, `activ` keyword, `alpha`, and `beta` scalar parameters, and `weights-type` keyword.
(pooling-blueprint this src-desc dst-desc algo strides kernel padding)
Create pooling layer blueprint with input src-desc
, output dst-desc
,
algorithm keyword algo
, strides
, kernel
, and padding
Clojure vectors.
Create pooling layer blueprint with input `src-desc`, output `dst-desc`, algorithm keyword `algo`, `strides`, `kernel`, and `padding` Clojure vectors.
(activ-blueprint this src-desc activ alpha beta)
Create technology specific activation blueprint from src-desc
,
activ
keyword, alpha
, and beta
scalar parameters.
Create technology specific activation blueprint from `src-desc`, `activ` keyword, `alpha`, and `beta` scalar parameters.
(branch-blueprint this src-desc split-dim dst-descs)
Create branch layer blueprint with input src-desc
, scalar split-dim
,
and dst-descs
outputs.
Create branch layer blueprint with input `src-desc`, scalar `split-dim`, and `dst-descs` outputs.
(batch-norm-blueprint this src-desc activ alpha beta)
Create batch normalization layer blueprint with input src-desc
, activ
keyword,
alpha
, and beta
scalar parameters.
Create batch normalization layer blueprint with input `src-desc`, `activ` keyword, `alpha`, and `beta` scalar parameters.
(convolution-blueprint this
src-desc
kernel-desc
dst-desc
activ
strides
padding
dilation
alpha
beta)
Create convolution layer blueprint with input src-desc
, kernel kernel-desc
,
output dst-desc
, algorithm keyword algo
, activ
keyword, strides
, padding
and
dilation
Clojure vectors, alpha
, and beta
scalar parameters.
Create convolution layer blueprint with input `src-desc`, kernel `kernel-desc`, output `dst-desc`, algorithm keyword `algo`, `activ` keyword, `strides`, `padding` and `dilation` Clojure vectors, `alpha`, and `beta` scalar parameters.
(split-blueprint this src-desc n)
Create split layer blueprint with input src-desc
, and scalar n
, the number of splits at the output.
Create split layer blueprint with input `src-desc`, and scalar `n`, the number of splits at the output.
An object that can be initialized with a provided function init-fn
.
An object that can be initialized with a provided function `init-fn`.
(init this init-fn)
Initialize this
with init-fn
.
Initialize `this` with `init-fn`.
An object that provides hooks of the linear part of the backward pass.
An object that provides hooks of the linear part of the backward pass.
(backward-diff this scal-diff-w scal-g scal-diff-b scal-b)
Compute the linear part of the backward gradient computation of the backprop algorithm.
Compute the linear part of the backward gradient computation of the backprop algorithm.
A backend factory for memory-mapped tensor-related structures, such as the mapped tensors themselves.
A backend factory for memory-mapped tensor-related structures, such as the mapped tensors themselves.
(map-channel this channel desc flag offset-bytes n-index)
Create a mapped tensor from the provided FileChannel
, descriptor desc
, mapping flags
.
Create a mapped tensor from the provided `FileChannel`, descriptor `desc`, mapping `flags`.
An object that can provide relevant Neanderthal backend factory for the provided
dtype
(typically a keyword such as :float
, :int
, etc.). Most backends are
supposed to provide these factories for Java primitive types supported by Neanderthal.
Anyway, don't forget to check out both DNNL and cuDNN implementations, AND the relevant tests. They are the final sources of truth, not these docstrings; if the docs and tests don't match, the tests are right, and the docstrings are wrong.
An object that can provide relevant Neanderthal backend factory for the provided `dtype` (typically a keyword such as `:float`, `:int`, etc.). Most backends are supposed to provide these factories for Java primitive types supported by Neanderthal. Anyway, don't forget to check out both DNNL and cuDNN implementations, AND the relevant **tests**. They are the final sources of truth, not these docstrings; if the docs and tests don't match, the tests are right, and the docstrings are wrong.
(neanderthal-factory this dtype)
Returns Neanderthal backend factory related to this DD object.
Returns Neanderthal backend factory related to this DD object.
An object for which the memory region that it controls can be (destructively) changed.
An object for which the memory region that it controls can be (destructively) changed.
(offset tz n-ofst)
Offsets the underlying memory region for this tz
by n-ofst
batches
(not in bytes or scalar entries).
Offsets the underlying memory region for this `tz` by `n-ofst` batches (not in bytes or scalar entries).
An object that has trainable parameters.
An object that has trainable parameters.
(bias this)
Provides tensor that contains bias, or anything that can be considered bias in the context of learning algorithms.
Provides tensor that contains bias, or anything that can be considered bias in the context of learning algorithms.
(weights this)
Provides tensor that contains weights, or anything that can be considered weights in the context of learning algorithms.
Provides tensor that contains weights, or anything that can be considered weights in the context of learning algorithms.
An object that has a sequence of parameters.
An object that has a sequence of parameters.
(parameters this)
A backend factory for recurrent neural networks (RNN) related structures, that typically creates blueprints for RNN operations and layers.
A backend factory for recurrent neural networks (RNN) related structures, that typically creates blueprints for RNN operations and layers.
(abbreviate-blueprint fact src-desc dst-type)
Creates a RNN output sequence abbreviation blueprint.
Creates a RNN output sequence abbreviation blueprint.
(rnn-blueprint fact
src-desc
dst-desc
lrs
activ
alpha
weights-type
src-iter?
dst-iter?)
Create RNN layer with src-desc
, dst-desc
, activ
keyword, weights-type
keyword,
and booleans src-iter?
, and dst-iter?
.
Create RNN layer with `src-desc`, `dst-desc`, `activ` keyword, `weights-type` keyword, and booleans `src-iter?`, and `dst-iter?`.
(rnn-op-blueprint this
src-desc
dst-desc
weights-type
activ
dir
lrs
src-iter?
dst-iter?)
Create RNN operation with src-desc
, dst-desc
, weights-type
keyword, activ
keyword,
direction dir
, number of layers lrs
, and booleans src-iter?
, and dst-iter?
.
Create RNN operation with `src-desc`, `dst-desc`, `weights-type` keyword, `activ` keyword, direction `dir`, number of layers `lrs`, and booleans `src-iter?`, and `dst-iter?`.
An object that has trainable parameters in the context of recurrent networks.
An object that has trainable parameters in the context of recurrent networks.
(bias-iter this)
Bias iteration tensor.
Bias iteration tensor.
(bias-layer this)
Bias tensor.
Bias tensor.
(weights-iter this)
Weights iteration tensor.
Weights iteration tensor.
(weights-layer this)
Weights tensor.
Weights tensor.
A backend factory for tensor-related structures, such as the tensors themselves, tensor decsciptors, tensor transformers, batchers, shufflers, and engines.
A backend factory for tensor-related structures, such as the tensors themselves, tensor decsciptors, tensor transformers, batchers, shufflers, and engines.
(create-batcher this src dst mb-size)
Create batcher from src
to dst
that has mini-batch capacity mb-size
.
Create batcher from `src` to `dst` that has mini-batch capacity `mb-size`.
(create-shuffler this src dst)
Create shuffluer from src
to dst
Create shuffluer from `src` to `dst`
(create-tensor this desc init)
(create-tensor this desc batch-index init)
Create tensor from the provided descriptor desc
, and initializes it to zero if init
is true.
Create tensor from the provided descriptor `desc`, and initializes it to zero if `init` is true.
(create-tensor-desc this desc)
(create-tensor-desc this shape type format)
Create technology-specific tensor descriptor from another descriptor desc
,
or from shape
, type
, and format
.
Create technology-specific tensor descriptor from another descriptor `desc`, or from `shape`, `type`, and `format`.
(create-transformer this in out)
Create transformer from in
to out
Create transformer from `in` to `out`
(tensor-engine this dtype)
Provides DD tensor engine for data type dtype
(:float
, etc.)
Provides DD tensor engine for data type `dtype` (`:float`, etc.)
An object that can inform interested parties of the capacity of workspace that it needs.
An object that can inform interested parties of the capacity of workspace that it needs.
(inf-ws-size this)
Necessary workspace size during inference.
Necessary workspace size during inference.
(train-ws-size this)
Necessary workspace size during training.
Necessary workspace size during training.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close