forked from miking-lang/miking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdist-ext.ext-ocaml.mc
135 lines (132 loc) · 3.99 KB
/
dist-ext.ext-ocaml.mc
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
include "map.mc"
include "ocaml/ast.mc"
let distExtMap =
use OCamlTypeAst in
mapFromSeq cmpString
[
("externalExponentialSample", [
{ expr = "Owl_stats.exponential_rvs",
ty = tyarrows_ [otylabel_ "lambda" tyfloat_, tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalGammaLogPdf", [
{ expr = "Owl_stats.gamma_logpdf",
ty = tyarrows_ [tyfloat_, otylabel_ "shape" tyfloat_, otylabel_ "scale" tyfloat_, tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalGammaSample", [
{ expr = "Owl_stats.gamma_rvs",
ty = tyarrows_ [otylabel_ "shape" tyfloat_, otylabel_ "scale" tyfloat_, tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalBinomialLogPmf", [
{ expr = "Owl_stats.binomial_logpdf",
ty = tyarrows_ [tyint_, otylabel_ "p" tyfloat_, otylabel_ "n" tyint_, tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalBinomialSample", [
{ expr = "Owl_stats.binomial_rvs",
ty = tyarrows_ [otylabel_ "p" tyfloat_, otylabel_ "n" tyint_, tyint_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalBetaLogPdf", [
{ expr = "Owl_stats.beta_logpdf",
ty = tyarrows_ [tyfloat_, otylabel_ "a" tyfloat_, otylabel_ "b" tyfloat_, tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalBetaSample", [
{ expr = "Owl_stats.beta_rvs",
ty = tyarrows_ [otylabel_ "a" tyfloat_, otylabel_ "b" tyfloat_, tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalGaussianLogPdf", [
{ expr = "Owl_stats.gaussian_logpdf",
ty = tyarrows_ [tyfloat_, otylabel_ "mu" tyfloat_, otylabel_ "sigma" tyfloat_, tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalGaussianSample", [
{ expr = "Owl_stats.gaussian_rvs",
ty = tyarrows_ [otylabel_ "mu" tyfloat_, otylabel_ "sigma" tyfloat_, tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalMultinomialLogPmf", [
{ expr = "Owl_stats.multinomial_logpdf ",
ty = tyarrows_ [otyarray_ tyint_, otylabel_ "p" (otyarray_ tyfloat_), tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalMultinomialSample", [
{ expr = "Owl_stats.multinomial_rvs ",
ty = tyarrows_ [tyint_, otylabel_ "p" (otyarray_ tyfloat_), otyarray_ tyint_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalCategoricalSample", [
{ expr = "Owl_stats.categorical_rvs ",
ty = tyarrows_ [otyarray_ tyfloat_, tyint_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalDirichletLogPdf", [
{ expr = "Owl_stats.dirichlet_logpdf ",
ty = tyarrows_ [otyarray_ tyfloat_, otylabel_ "alpha" (otyarray_ tyfloat_), tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalDirichletSample", [
{ expr = "Owl_stats.dirichlet_rvs ",
ty = tyarrows_ [otylabel_ "alpha" (otyarray_ tyfloat_), otyarray_ tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalUniformContinuousSample", [
{ expr = "Owl_stats.uniform_rvs",
ty = tyarrows_ [tyfloat_, tyfloat_, tyfloat_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalUniformDiscreteSample", [
{ expr = "Owl_stats.uniform_int_rvs",
ty = tyarrows_ [tyint_, tyint_, tyint_],
libraries = ["owl"],
cLibraries = []
}
]),
("externalSetSeed", [
{ expr = "
fun seed -> (
Random.init seed;
Owl_base_stats_prng.init seed;
Owl_stats_prng.sfmt_seed seed;
Owl_stats_prng.ziggurat_init ()
)",
ty = tyarrows_ [tyint_, otyunit_],
libraries = ["owl"],
cLibraries = []
}
])
]