MCPcopy
hub / github.com/FACEGOOD/FACEGOOD-Audio2Face / __init__

Method __init__

code/train/model_paper.py:70–90  ·  view source on GitHub ↗
(self, kernels_size=None, E=16, conv2d_strides=None, emotion_strides=None)

Source from the content-addressed store, hash-verified

68 emotion_strides: list, the strides of each emotion layer
69 """
70 def __init__(self, kernels_size=None, E=16, conv2d_strides=None, emotion_strides=None):
71 super(ArticulationLayer, self).__init__()
72
73 self.E = E
74 if kernels_size is None:
75 kernels_size = [[1, 3], [1, 3], [1, 3], [1, 3], [1, 4]]
76 if emotion_strides is None:
77 emotion_strides = [[1, 2], [1, 4], [1, 8], [1, 16], [1, 64]]
78 if conv2d_strides is None:
79 conv2d_strides = [[1, 2], [1, 2], [1, 2], [1, 2], [1, 4]]
80
81 self.kernels_size = kernels_size
82 self.emotion_strides = emotion_strides
83 self.conv2d_strides = conv2d_strides
84
85 self.emotion = tf.random.normal([1, 1, 64, self.E], mean=0.0, stddev=1.0)
86
87 self.articulation_layer = []
88 for i in range(len(self.kernels_size)):
89 self.articulation_layer.append([conv2d_layer(256, self.kernels_size[i], self.conv2d_strides[i]),
90 conv2d_layer(self.E, self.kernels_size[i], self.emotion_strides[i])])
91
92 def call(self, x):
93 emotion_input = tf.tile(self.emotion, [tf.shape(x)[0], 1, 1, 1])

Callers

nothing calls this directly

Calls 2

conv2d_layerFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected