add posed mesh, metrics, tanh, l1 with gt

This commit is contained in:
2022-06-17 19:41:16 +00:00
parent cf1c536260
commit a14acceeb6
5 changed files with 87 additions and 33 deletions
+4 -1
View File
@@ -7,12 +7,15 @@ import tensorflow as tf
class BiasAct(tf.keras.layers.Layer):
def __init__(self, lrmul, act, **kwargs):
super(BiasAct, self).__init__(**kwargs)
assert act in ['linear', 'lrelu']
assert act in ['linear', 'lrelu', 'tanh']
self.lrmul = lrmul
if act == 'linear':
self.act = tf.keras.layers.Lambda(lambda x: tf.identity(x))
self.gain = 1.0
elif act == 'tanh':
self.act = tf.keras.layers.Activation('tanh')
self.gain = 1.0
else:
self.act = tf.keras.layers.LeakyReLU(alpha=0.2)
self.gain = np.sqrt(2)