-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hyper.fs
52 lines (48 loc) · 1.21 KB
/
Hyper.fs
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
module Hyper
open SharpLearning.Optimization
open System
let parameters (sampleRate: uint32) : IParameterSpec [] =
let sr = sampleRate |> float
[|
// max delay
MinMaxParameterSpec(
1.0,
Math.Round(sr * 0.05),
Transform.Linear,
ParameterType.Discrete
);
// min delay will be -1
// max abs acceleration
MinMaxParameterSpec(
0.001,
sr / 40000.0,
Transform.Linear,
ParameterType.Continuous
);
// max abs speed
MinMaxParameterSpec(
0.001,
sr / 40000.0,
Transform.Linear,
ParameterType.Continuous
);
// update delay
MinMaxParameterSpec(
1.0,
sr * 0.25,
Transform.Linear,
ParameterType.Discrete
)
|]
let makeOpt parms iters =
BayesianOptimizer(parms, iters)
let makeWalkerDef (parms: float []) : Walkers.WalkerDef =
{
MostDelay = parms.[0] |> int
LeastDelay = 1
AccA = -parms.[1]
AccB = parms.[1]
SpeedA = -parms.[2]
SpeedB = parms.[2]
UpdateDelay = parms.[3] |> int
}