Skip to content

Commit 5e02386

Browse files
committed
Merge pull request #865 from LupusSanctus:am/mobilenetv3
2 parents 8a5800a + f79a6f0 commit 5e02386

File tree

7 files changed

+16
-0
lines changed

7 files changed

+16
-0
lines changed
320 Bytes
Binary file not shown.
287 Bytes
Binary file not shown.
320 Bytes
Binary file not shown.

testdata/dnn/tensorflow/generate_tf_models.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,16 @@ def my_dropout(x):
416416
out = tf.reshape(conv2, [1, 2, 3, 6], 'reshaped')
417417
save(inp, out, 'reshape_nchw')
418418
################################################################################
419+
inp = tf.placeholder(tf.float32, [1, 5, 5, 3], 'input')
420+
out = tf.keras.layers.MaxPool2D((2, 2), 4, "SAME", name='pooling')(inp)
421+
reshape = tf.reshape(out, [-1, 1, 1, 12], 'reshaped')
422+
conv_filter = tf.get_variable('filter', [1, 1, 12, 4],
423+
initializer=tf.truncated_normal_initializer(),
424+
dtype=tf.float32)
425+
conv = tf.nn.conv2d(input=reshape, filters=conv_filter, strides=[1, 1, 1, 1],
426+
padding='SAME', name='conv2d')
427+
save(inp, conv, 'reshape_conv')
428+
################################################################################
419429
inp = tf.placeholder(tf.float32, [1, 6, 5, 3], 'input')
420430
conv = tf.layers.conv2d(inputs=inp, filters=3, kernel_size=[1, 1],
421431
activation=tf.nn.relu,
@@ -792,6 +802,12 @@ def pad_depth(x, desired_channels):
792802
final_out = tf.math.add(out1, out2, name='tf_sum')
793803
save(inp, final_out, 'eltwise_add_vec')
794804
################################################################################
805+
inp = tf.placeholder(tf.float32, [1, 4, 4, 3], 'input')
806+
out1 = tf.keras.layers.MaxPool2D((2, 2), 4, "SAME", name="pooling")(inp)
807+
out2 = tf.keras.layers.ReLU(name="relu")(inp)
808+
final_out = tf.keras.layers.Multiply(name='tf_mul')([out1, out2])
809+
save(inp, final_out, 'eltwise_mul_vec')
810+
################################################################################
795811
inp = tf.placeholder(tf.float32, [None, 2, 3, 4], 'input')
796812
conv = tf.layers.conv2d(inp, filters=3, kernel_size=[1, 1])
797813
softmax = tf.contrib.slim.softmax(conv)
428 Bytes
Binary file not shown.
791 Bytes
Binary file not shown.
144 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)