-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
467,286 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* Auto generated from checkpoint checkpoint_epoch_100.pth */ | ||
|
||
|
||
#ifndef RADE_CONSTANTS_H | ||
#define RADE_CONSTANTS_H | ||
|
||
#include "nnet.h" | ||
|
||
|
||
#define RADE_NUM_FEATURES 21 | ||
|
||
#define RADE_LATENT_DIM 80 | ||
|
||
#define RADE_MAX_RNN_NEURONS 96 | ||
|
||
#define RADE_MAX_CONV_INPUTS 1536 | ||
|
||
#define RADE_ENC_MAX_RNN_NEURONS 1536 | ||
|
||
#define RADE_ENC_MAX_CONV_INPUTS 1536 | ||
|
||
#define RADE_DEC_MAX_RNN_NEURONS 96 | ||
|
||
|
||
#endif /* RADE_CONSTANTS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* Copyright (c) 2022 Amazon | ||
Written by Jan Buethe */ | ||
/* | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
- Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
- Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER | ||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef RADECORE_H | ||
#define RADECORE_H | ||
|
||
#include <stdlib.h> | ||
|
||
#include "opus_types.h" | ||
|
||
typedef struct RADEDec RADEDec; | ||
typedef struct RADEEnc RADEEnc; | ||
typedef struct RADEDecStruct RADEDecState; | ||
typedef struct RADEEncStruct RADEEncState; | ||
|
||
void rade_init_encoder(RADEEncState *enc_state); | ||
void rade_core_encoder(RADEEncState *enc_state, const RADEEnc *model, float *z, const float *features, int arch); | ||
|
||
void rade_init_decoder(RADEDecState *dec_state); | ||
void rade_core_decoder(RADEDecState *dec_state, const RADEDec *model, float *features, const float *z_hat); | ||
|
||
#endif |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* Auto generated from checkpoint checkpoint_epoch_100.pth */ | ||
|
||
|
||
#ifndef RADE_DEC_DATA_H | ||
#define RADE_DEC_DATA_H | ||
|
||
#include "nnet.h" | ||
|
||
|
||
#include "opus_types.h" | ||
|
||
#include "rade.h" | ||
|
||
#include "rade_constants.h" | ||
|
||
|
||
#define DEC_DENSE1_OUT_SIZE 96 | ||
|
||
#define DEC_GLU1_OUT_SIZE 96 | ||
|
||
#define DEC_GLU2_OUT_SIZE 96 | ||
|
||
#define DEC_GLU3_OUT_SIZE 96 | ||
|
||
#define DEC_GLU4_OUT_SIZE 96 | ||
|
||
#define DEC_GLU5_OUT_SIZE 96 | ||
|
||
#define DEC_OUTPUT_OUT_SIZE 84 | ||
|
||
#define DEC_GRU1_OUT_SIZE 96 | ||
|
||
#define DEC_GRU1_STATE_SIZE 96 | ||
|
||
#define DEC_GRU2_OUT_SIZE 96 | ||
|
||
#define DEC_GRU2_STATE_SIZE 96 | ||
|
||
#define DEC_GRU3_OUT_SIZE 96 | ||
|
||
#define DEC_GRU3_STATE_SIZE 96 | ||
|
||
#define DEC_GRU4_OUT_SIZE 96 | ||
|
||
#define DEC_GRU4_STATE_SIZE 96 | ||
|
||
#define DEC_GRU5_OUT_SIZE 96 | ||
|
||
#define DEC_GRU5_STATE_SIZE 96 | ||
|
||
#define DEC_CONV1_OUT_SIZE 32 | ||
|
||
#define DEC_CONV1_IN_SIZE 192 | ||
|
||
#define DEC_CONV1_STATE_SIZE (192 * (1)) | ||
|
||
#define DEC_CONV1_DELAY 0 | ||
|
||
#define DEC_CONV2_OUT_SIZE 32 | ||
|
||
#define DEC_CONV2_IN_SIZE 320 | ||
|
||
#define DEC_CONV2_STATE_SIZE (320 * (1)) | ||
|
||
#define DEC_CONV2_DELAY 0 | ||
|
||
#define DEC_CONV3_OUT_SIZE 32 | ||
|
||
#define DEC_CONV3_IN_SIZE 448 | ||
|
||
#define DEC_CONV3_STATE_SIZE (448 * (1)) | ||
|
||
#define DEC_CONV3_DELAY 0 | ||
|
||
#define DEC_CONV4_OUT_SIZE 32 | ||
|
||
#define DEC_CONV4_IN_SIZE 576 | ||
|
||
#define DEC_CONV4_STATE_SIZE (576 * (1)) | ||
|
||
#define DEC_CONV4_DELAY 0 | ||
|
||
#define DEC_CONV5_OUT_SIZE 32 | ||
|
||
#define DEC_CONV5_IN_SIZE 704 | ||
|
||
#define DEC_CONV5_STATE_SIZE (704 * (1)) | ||
|
||
#define DEC_CONV5_DELAY 0 | ||
|
||
struct RADEDec { | ||
LinearLayer dec_dense1; | ||
LinearLayer dec_glu1; | ||
LinearLayer dec_glu2; | ||
LinearLayer dec_glu3; | ||
LinearLayer dec_glu4; | ||
LinearLayer dec_glu5; | ||
LinearLayer dec_output; | ||
LinearLayer dec_gru1_input; | ||
LinearLayer dec_gru1_recurrent; | ||
LinearLayer dec_gru2_input; | ||
LinearLayer dec_gru2_recurrent; | ||
LinearLayer dec_gru3_input; | ||
LinearLayer dec_gru3_recurrent; | ||
LinearLayer dec_gru4_input; | ||
LinearLayer dec_gru4_recurrent; | ||
LinearLayer dec_gru5_input; | ||
LinearLayer dec_gru5_recurrent; | ||
LinearLayer dec_conv1; | ||
LinearLayer dec_conv2; | ||
LinearLayer dec_conv3; | ||
LinearLayer dec_conv4; | ||
LinearLayer dec_conv5; | ||
}; | ||
|
||
int init_radedec(RADEDec *model, const WeightArray *arrays); | ||
|
||
#endif /* RADE_DEC_DATA_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* Copyright (c) 2022 Amazon | ||
Written by Jan Buethe */ | ||
/* | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
- Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
- Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER | ||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef RADE_ENC_H | ||
#define RADE_ENC_H | ||
|
||
#include "rade_core.h" | ||
|
||
#include "rade_enc_data.h" | ||
|
||
struct RADEEncStruct { | ||
int initialized; | ||
float gru1_state[ENC_GRU1_STATE_SIZE]; | ||
float gru2_state[ENC_GRU2_STATE_SIZE]; | ||
float gru3_state[ENC_GRU3_STATE_SIZE]; | ||
float gru4_state[ENC_GRU4_STATE_SIZE]; | ||
float gru5_state[ENC_GRU5_STATE_SIZE]; | ||
float conv1_state[ENC_CONV1_STATE_SIZE]; | ||
float conv2_state[2*ENC_CONV2_STATE_SIZE]; | ||
float conv3_state[2*ENC_CONV3_STATE_SIZE]; | ||
float conv4_state[2*ENC_CONV4_STATE_SIZE]; | ||
float conv5_state[2*ENC_CONV5_STATE_SIZE]; | ||
}; | ||
|
||
void rade_encode_dframe(RADEEncState *enc_state, const RADEEnc *model, float *latents, float *initial_state, const float *input); | ||
|
||
|
||
#endif |
Oops, something went wrong.