mirror of
https://github.com/xiph/opus.git
synced 2025-05-18 17:38:29 +00:00
Proper ordering for MDense weights
This commit is contained in:
parent
141830ce5a
commit
60c97b9723
1 changed files with 3 additions and 3 deletions
|
@ -85,9 +85,9 @@ def dump_mdense_layer(self, f, hf):
|
||||||
name = self.name
|
name = self.name
|
||||||
print("printing layer " + name + " of type " + self.__class__.__name__)
|
print("printing layer " + name + " of type " + self.__class__.__name__)
|
||||||
weights = self.get_weights()
|
weights = self.get_weights()
|
||||||
printVector(f, weights[0], name + '_weights')
|
printVector(f, np.transpose(weights[0], (1, 2, 0)), name + '_weights')
|
||||||
printVector(f, weights[1], name + '_bias')
|
printVector(f, np.transpose(weights[1], (1, 0)), name + '_bias')
|
||||||
printVector(f, weights[1], name + '_factor')
|
printVector(f, np.transpose(weights[2], (1, 0)), name + '_factor')
|
||||||
activation = self.activation.__name__.upper()
|
activation = self.activation.__name__.upper()
|
||||||
max_mdense_tmp = max(max_mdense_tmp, weights[0].shape[0]*weights[0].shape[2])
|
max_mdense_tmp = max(max_mdense_tmp, weights[0].shape[0]*weights[0].shape[2])
|
||||||
f.write('const MDenseLayer {} = {{\n {}_bias,\n {}_weights,\n {}_factor,\n {}, {}, {}, ACTIVATION_{}\n}};\n\n'
|
f.write('const MDenseLayer {} = {{\n {}_bias,\n {}_weights,\n {}_factor,\n {}, {}, {}, ACTIVATION_{}\n}};\n\n'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue