package neural_nets_lib

  1. Overview
  2. Docs

Module Ocannl.OperationSource

Computational primitives for neural networks, integrating Tensor with Assignments.

Sourcemodule At : sig ... end
Sourcemodule Initial_NTDSL : sig ... end
Sourcemodule Initial_TDSL : sig ... end
Sourceval add : ?label:Base.string list -> ?grad_spec:Tensor.grad_spec -> Tensor.t -> Tensor.t -> Tensor.t
Sourceval sub : ?label:Base.string list -> ?grad_spec:Tensor.grad_spec -> Tensor.t -> Tensor.t -> Tensor.t
Sourceval pointmul : ?label:Base.string list -> ?grad_spec:Tensor.grad_spec -> Tensor.t -> Tensor.t -> Tensor.t
Sourceval matmul : ?label:Base.string list -> ?grad_spec:Tensor.grad_spec -> Tensor.t -> Tensor.t -> Tensor.t
Sourceval einsum : ?label:Base.string list -> Base.string -> ?grad_spec:Tensor.grad_spec -> Tensor.t -> Tensor.t -> Tensor.t

Similar to the explicit mode of numpy.einsum, the binary variant. Can compute various forms of matrix multiplication, inner and outer products, etc.

Note that "a,b->c" from numpy is "a;b=>c" in OCANNL, since "->" is used to separate the input and the output axes.

Sourceval outer_sum : ?label:Base.string list -> Base.string -> ?grad_spec:Tensor.grad_spec -> Tensor.t -> Tensor.t -> Tensor.t

Like einsum, but adds instead than multiplying the resulting values.

Sourceval einsum1 : ?label:Base.string list -> Base.string -> ?grad_spec:Tensor.grad_spec -> Tensor.t -> Tensor.t

Similar to the explicit mode of numpy.einsum, the unary variant. Can permute axes, extract diagonals, compute traces etc.

Note that "a->c" from numpy is "a=>c" in OCANNL, since "->" is used to separate the input and the output axes.

Sourceval relu : ?label:Base.string list -> ?grad_spec:Tensor.grad_spec -> Tensor.t -> Tensor.t
Sourcemodule NDO_without_pow : sig ... end
Sourceval pointpow : ?label:Base.string Base.list -> grad_spec:Tensor.grad_spec -> Base.float -> Tensor.t -> Tensor.t
Sourcemodule NDO_without_div : sig ... end
Sourceval pointdiv : ?label:Base.string Base.list -> grad_spec:Tensor.grad_spec -> Tensor.t -> Tensor.t -> Tensor.t
Sourceval range : ?label:Base.string list -> ?grad_spec:Tensor.grad_spec -> ?axis_label:Base.string -> Base.Int.t -> Tensor.t
Sourceval range_of_shape : ?label:Base.string list -> ?grad_spec:Tensor.grad_spec -> ?batch_dims:Base.Int.t Base.List.t -> ?input_dims:Base.Int.t Base.List.t -> ?output_dims:Base.Int.t Base.List.t -> ?batch_axes:(Base.string * Base.Int.t) Base.List.t -> ?input_axes:(Base.string * Base.Int.t) Base.List.t -> ?output_axes:(Base.string * Base.Int.t) Base.List.t -> unit -> Tensor.t
Sourceval stop_gradient : ?label:Base.string list -> Tensor.t -> Tensor.t

A stop_gradient is an identity in the forward pass and a no-op in the backprop pass.

Sourceval slice : ?label:Base.string list -> grad_spec:Tensor.grad_spec -> Idx.static_symbol -> Tensor.t -> Tensor.t
Sourceval embed_symbol : ?label:Base.string list -> Arrayjit.Indexing.static_symbol -> Tensor.t
Sourcemodule DO : sig ... end
Sourcemodule NDO : sig ... end
Sourcemodule TDSL : sig ... end
Sourcemodule NTDSL : sig ... end
OCaml

Innovation. Community. Security.