-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautodiff_intf.ml
75 lines (52 loc) · 1.33 KB
/
autodiff_intf.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
module type Common = sig
type t
type floatlike
val c : floatlike -> t
val zero : t
val one : t
val two : t
val scale : t -> floatlike -> t
val (+) : t -> t -> t
val (-) : t -> t -> t
val ( * ) : t -> t -> t
val int_pow : t -> int -> t
val (/) : t -> t -> t
val pow : t -> floatlike -> t
val exp : t -> t
val log : t -> t
val ( ** ) : t -> t -> t
val sin : t -> t
val cos : t -> t
val tan : t -> t
val abs : t -> t
val step : t -> t
val relu : t -> t
val softplus : t -> t
val sigmoid : t -> t
end
module type S = sig
type floatlike
module Univar : sig
type t
val eval : t -> floatlike -> floatlike
val d : t -> t
val x : t
val compose : t -> t -> t
include Common with type t := t and type floatlike := floatlike
end
type t
val eval : t -> floatlike Infinite_list.t -> floatlike
val eval' : t -> floatlike list -> floatlike
val grad : t -> t Infinite_list.t
val x_i : int -> t
val x_0 : t
val x_1 : t
val x_2 : t
val compose_univar : Univar.t -> t -> t
val compose : t -> t Infinite_list.t -> t
val compose' : t -> t list -> t
val compose_list : t -> t Infinite_list.t list -> t
val compose_list' : t -> t list list -> t
val compose_list'' : t list list -> t list
include Common with type t := t and type floatlike := floatlike
end