-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmodels.py
More file actions
56 lines (36 loc) · 1.26 KB
/
models.py
File metadata and controls
56 lines (36 loc) · 1.26 KB
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
from keras.layers import Input, Dense
from keras.models import Model
from keras.models import load_model
def raw_model():
input_all = Input(shape=(233,), name="input")
x = Dense(512, activation='relu')(input_all)
x = Dense(1024, activation='relu')(x)
x = Dense(512)(x)
out = Dense(4)(x)
model = Model(inputs=[input_all], outputs=out)
model.compile(optimizer='rmsprop', loss='mse')
return model
def preflop_model():
input_n = Input(shape=(16,), name="input")
x = Dense(32, activation='relu')(input_n)
x = Dense(64, activation='relu')(x)
x = Dense(16, activation='relu')(x)
out = Dense(2)(x)
model = Model(inputs=[input_n], outputs=out)
model.compile(optimizer='adam', loss='mse')
return model
def preflop_linear_model():
input_n = Input(shape=(5,), name="input")
x = Dense(16, activation='relu')(input_n)
x = Dense(32, activation='relu')(x)
x = Dense(64, activation='relu')(x)
x = Dense(32, activation='relu')(x)
x = Dense(16, activation='relu')(x)
out = Dense(2)(x)
model = Model(inputs=[input_n], outputs=out)
model.compile(optimizer='adam', loss='mse')
return model
def save_model(model, name):
model.save(name)
def load(name):
return load_model(name)