Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file owl_algodiff_core_sig.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104# 1 "src/base/algodiff/owl_algodiff_core_sig.ml"(*
* OWL - OCaml Scientific Computing
* Copyright (c) 2016-2022 Liang Wang <liang@ocaml.xyz>
*)moduletypeSig=sigmoduleA:Owl_types_ndarray_algodiff.Sig(** {5 Type definition} *)includeOwl_algodiff_types_sig.Sigwithtypeelt:=A.eltandtypearr:=A.arr(** {5 Core functions} *)valtag:unit->int(** start global tagging counter *)valprimal:t->t(** get primal component of DF or DR type *)valprimal':t->t(** iteratively get primal component of DF or DR type until the component itself is not DF/DR *)valzero:t->t(** return a zero value, which type decided by the input value *)valreset_zero:t->t(** [reset_zero x] iteratively resets all elements included in [x] *)valtangent:t->t(** get the tangent component of input, if the data type is suitable *)valadjref:t->tref(** get the adjref component of input, if the data type is suitable *)valadjval:t->t(** get the adjval component of input, if the data type is suitableTODO *)valshape:t->intarray(** get the shape of primal' value of input *)valis_float:t->bool(** check if input is of float value; if input is of type DF/DR, check its primal' value *)valis_arr:t->bool(** check if input is of ndarray value; if input is of type DF/DR, check its primal' value *)valrow_num:t->int(** get the shape of primal' value of input; and then get the first dimension *)valcol_num:t->int(** get the shape of primal' value of input; and then get the second dimension *)valnumel:t->int(** for ndarray type input, return its total number of elements. *)valclip_by_value:amin:A.elt->amax:A.elt->t->t(** other functions, without tracking gradient *)valclip_by_l2norm:A.elt->t->t(** other functions, without tracking gradient *)valcopy_primal':t->t(** if primal' value of input is ndarray, copy its value in a new AD type ndarray *)valtile:t->intarray->t(** if primal' value of input is ndarray, apply the tile function *)valrepeat:t->intarray->t(** if primal' value of input is ndarray, apply the repeat function *)valpack_elt:A.elt->t(** convert from [elt] type to [t] type. *)valunpack_elt:t->A.elt(** convert from [t] type to [elt] type. *)valpack_flt:float->t(** convert from [float] type to [t] type. *)val_f:float->t(** A shortcut function for [F A.(float_to_elt x)]. *)valunpack_flt:t->float(** convert from [t] type to [float] type. *)valpack_arr:A.arr->t(** convert from [arr] type to [t] type. *)valunpack_arr:t->A.arr(** convert from [t] type to [arr] type. *)(* functions to report errors, help in debugging *)valdeep_info:t->stringvaltype_info:t->stringvalerror_binop:string->t->t->'avalerror_uniop:string->t->'aend