def _generator_model(sess, features): # See Arxiv 1603.05027 model = dm_arch.Model('GENE', 2 * features - 1) mapsize = 3 # Encoder layers = [24, 48] for nunits in layers: _residual_block(model, nunits, mapsize) model.add_avg_pool() # Decoder layers = [96, 64] for nunits in layers: _residual_block(model, nunits, mapsize) _residual_block(model, nunits, mapsize) model.add_upscale() nunits = 48 _residual_block(model, nunits, mapsize) _residual_block(model, nunits, 1) model.add_conv2d(3, mapsize=1) model.add_sigmoid(1.1) return model
def _discriminator_model(sess, image): model = dm_arch.Model('DISC', 2 * image - 1.0) mapsize = 3 layers = [64, 96, 128, 192] #[32, 48, 96, 128] for nunits in layers: model.add_batch_norm() model.add_lrelu() model.add_conv2d(nunits, mapsize=mapsize) model.add_avg_pool() nunits = layers[-1] model.add_batch_norm() model.add_lrelu() model.add_conv2d(nunits, mapsize=mapsize) #model.add_batch_norm() model.add_lrelu() model.add_conv2d(1, mapsize=mapsize) model.add_mean() return model
def _discriminator_model(sess, image): model = dm_arch.Model('DISC', 2 * image - 1.0) mapsize = 3 layers = [32, 48, 96, 128] for nunits in layers: _residual_block(model, nunits, mapsize) model.add_avg_pool() nunits = layers[-1] _residual_block(model, nunits, mapsize) model.add_conv2d(1, mapsize=1, stride=1) model.add_mean() return model