MCPcopy Create free account
hub / github.com/commaai/research / discriminator

Function discriminator

models/autoencoder.py:100–127  ·  view source on GitHub ↗
(batch_size, df_dim, ch, rows, cols)

Source from the content-addressed store, hash-verified

98
99
100def discriminator(batch_size, df_dim, ch, rows, cols):
101 X = Input(batch_shape=(batch_size, rows[-1], cols[-1], ch))
102 model = Convolution2D(df_dim, 5, 5, subsample=(2, 2), border_mode="same",
103 batch_input_shape=(batch_size, rows[-1], cols[-1], ch),
104 name="d_h0_conv", dim_ordering="tf", init=normal)(X)
105 model = LeakyReLU(.2)(model)
106
107 model = Convolution2D(df_dim*2, 5, 5, subsample=(2, 2), border_mode="same",
108 name="d_h1_conv", dim_ordering="tf", init=normal)(model)
109 model = BN(mode=2, axis=3, name="d_bn1", gamma_init=mean_normal, epsilon=1e-5)(model)
110 model = LeakyReLU(.2)(model)
111
112 model = Convolution2D(df_dim*4, 5, 5, subsample=(2, 2), border_mode="same",
113 name="d_h2_conv", dim_ordering="tf", init=normal)(model)
114 model = BN(mode=2, axis=3, name="d_bn2", gamma_init=mean_normal, epsilon=1e-5)(model)
115 model = LeakyReLU(.2)(model)
116
117 model = Convolution2D(df_dim*8, 5, 5, subsample=(2, 2), border_mode="same",
118 name="d_h3_conv", dim_ordering="tf", init=normal)(model)
119
120 dec = BN(mode=2, axis=3, name="d_bn3", gamma_init=mean_normal, epsilon=1e-5)(model)
121 dec = LeakyReLU(.2)(dec)
122 dec = Flatten()(dec)
123 dec = Dense(1, name="d_h3_lin", init=normal)(dec)
124
125 output = Model([X], [dec, model])
126
127 return output
128
129
130def get_model(sess, image_shape=(80, 160, 3), gf_dim=64, df_dim=64, batch_size=64,

Callers 1

get_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected