shithub: opus

Download patch

ref: e6390e34c79d81d870197e17c56d1d64d250a238
parent: 1978cc609408ecb004f7f61560694d2788aa1a26
author: Jan Buethe <jbuethe@amazon.de>
date: Fri Oct 21 08:33:34 EDT 2022

removed compute_dense function (conflict with opus mlp)

--- a/dnn/dred_rdovae_dec.c
+++ b/dnn/dred_rdovae_dec.c
@@ -12,9 +12,9 @@
     )
 {
     /* initialize GRU states from initial state */
-    compute_dense(&state1, h->dense2_state, initial_state);
-    compute_dense(&state2, h->dense4_state, initial_state);
-    compute_dense(&state3, h->dense6_state, initial_state);
+    _lpcnet_compute_dense(&state1, h->dense2_state, initial_state);
+    _lpcnet_compute_dense(&state2, h->dense4_state, initial_state);
+    _lpcnet_compute_dense(&state3, h->dense6_state, initial_state);
 }
 
 
@@ -43,7 +43,7 @@
 #endif
 
     /* run encoder stack and concatenate output in buffer*/
-    compute_dense(&dec_dense1, &buffer[output_index], input);
+    _lpcnet_compute_dense(&dec_dense1, &buffer[output_index], input);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), DEC_DENSE1_OUT_SIZE, fids[0]);
 #endif
@@ -58,7 +58,7 @@
     input_index = output_index;
     output_index += DEC_DENSE2_OUT_SIZE;
 
-    compute_dense(&dec_dense3, &buffer[output_index], &buffer[input_index]);
+    _lpcnet_compute_dense(&dec_dense3, &buffer[output_index], &buffer[input_index]);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), DEC_DENSE3_OUT_SIZE, fids[2]);
 #endif
@@ -73,7 +73,7 @@
     input_index = output_index;
     output_index += DEC_DENSE4_OUT_SIZE;
 
-    compute_dense(&dec_dense5, &buffer[output_index], &buffer[input_index]);
+    _lpcnet_compute_dense(&dec_dense5, &buffer[output_index], &buffer[input_index]);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), DEC_DENSE5_OUT_SIZE, fids[4]);
 #endif
@@ -88,7 +88,7 @@
     input_index = output_index;
     output_index += DEC_DENSE6_OUT_SIZE;
 
-    compute_dense(&dec_dense7, &buffer[output_index], &buffer[input_index]);
+    _lpcnet_compute_dense(&dec_dense7, &buffer[output_index], &buffer[input_index]);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), DEC_DENSE7_OUT_SIZE, fids[6]);
 #endif
@@ -95,11 +95,11 @@
     input_index = output_index;
     output_index += DEC_DENSE7_OUT_SIZE;
 
-    compute_dense(&dec_dense8, &buffer[output_index], &buffer[input_index]);
+    _lpcnet_compute_dense(&dec_dense8, &buffer[output_index], &buffer[input_index]);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), DEC_DENSE8_OUT_SIZE, fids[7]);
 #endif
     output_index += DEC_DENSE8_OUT_SIZE;
 
-    compute_dense(&dec_final, qframe, buffer);
+    _lpcnet_compute_dense(&dec_final, qframe, buffer);
 }
\ No newline at end of file
--- a/dnn/dred_rdovae_enc.c
+++ b/dnn/dred_rdovae_enc.c
@@ -41,7 +41,7 @@
 
 
     /* run encoder stack and concatenate output in buffer*/
-    compute_dense(&enc_dense1, &buffer[output_index], input);
+    _lpcnet_compute_dense(&enc_dense1, &buffer[output_index], input);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), ENC_DENSE1_OUT_SIZE, fids[0]);
 #endif
@@ -56,7 +56,7 @@
     input_index = output_index;
     output_index += ENC_DENSE2_OUT_SIZE;
 
-    compute_dense(&enc_dense3, &buffer[output_index], &buffer[input_index]);
+    _lpcnet_compute_dense(&enc_dense3, &buffer[output_index], &buffer[input_index]);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), ENC_DENSE3_OUT_SIZE, fids[2]);
 #endif
@@ -71,7 +71,7 @@
     input_index = output_index;
     output_index += ENC_DENSE4_OUT_SIZE;
 
-    compute_dense(&enc_dense5, &buffer[output_index], &buffer[input_index]);
+    _lpcnet_compute_dense(&enc_dense5, &buffer[output_index], &buffer[input_index]);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), ENC_DENSE5_OUT_SIZE, fids[4]);
 #endif
@@ -86,7 +86,7 @@
     input_index = output_index;
     output_index += ENC_DENSE6_OUT_SIZE;
 
-    compute_dense(&enc_dense7, &buffer[output_index], &buffer[input_index]);
+    _lpcnet_compute_dense(&enc_dense7, &buffer[output_index], &buffer[input_index]);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), ENC_DENSE7_OUT_SIZE, fids[6]);
 #endif
@@ -93,7 +93,7 @@
     input_index = output_index;
     output_index += ENC_DENSE7_OUT_SIZE;
 
-    compute_dense(&enc_dense8, &buffer[output_index], &buffer[input_index]);
+    _lpcnet_compute_dense(&enc_dense8, &buffer[output_index], &buffer[input_index]);
 #ifdef DEBUG
     fwrite(&buffer[output_index], sizeof(buffer[0]), ENC_DENSE8_OUT_SIZE, fids[7]);
 #endif
@@ -107,8 +107,8 @@
 
 
     /* next, calculate initial state */
-    compute_dense(&gdense1, &buffer[output_index], buffer);
+    _lpcnet_compute_dense(&gdense1, &buffer[output_index], buffer);
     input_index = output_index;
-    compute_dense(&gdense2, initial_state, &buffer[input_index]);
+    _lpcnet_compute_dense(&gdense2, initial_state, &buffer[input_index]);
 
 }
--- a/dnn/nnet.c
+++ b/dnn/nnet.c
@@ -130,11 +130,6 @@
    compute_activation(output, output, N, layer->activation);
 }
 
-void compute_dense(const DenseLayer *layer, float *output, const float *input)
-{
-   return _lpcnet_compute_dense(layer, output, input);
-}
-
 void compute_mdense(const MDenseLayer *layer, float *output, const float *input)
 {
    int i, c;
--- a/dnn/nnet.h
+++ b/dnn/nnet.h
@@ -98,8 +98,6 @@
 
 void _lpcnet_compute_dense(const DenseLayer *layer, float *output, const float *input);
 
-void compute_dense(const DenseLayer *layer, float *output, const float *input);
-
 void compute_mdense(const MDenseLayer *layer, float *output, const float *input);
 
 int sample_mdense(const MDenseLayer *layer,  const float *input, const float *sampling_logit_table, kiss99_ctx *rng);
--