-
Notifications
You must be signed in to change notification settings - Fork 0
/
Critic.py
32 lines (23 loc) · 968 Bytes
/
Critic.py
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
#implement Critic
#######################################################################
from __future__ import print_function, division
from keras.layers import Input, Dense, Reshape, Concatenate, Activation,LeakyReLU
from keras.models import Sequential, Model
#######################################################################
def build_critic():
##########################################
attribute_dim = 85
features_dim = 2048
in_shape = attribute_dim + features_dim
##########################################
model = Sequential()
model.add(Dense(1024, input_dim=in_shape))
model.add(LeakyReLU(alpha=0.01))
model.add(Dense(1))
model.summary()
##########################################
feature = Input(shape=(features_dim,))
label = Input(shape=(attribute_dim,))
model_input = Concatenate()([feature, label])
validity = model(model_input)
return Model([feature, label], validity)