Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change code-style #100

Draft
wants to merge 133 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
a5ffa49
Pass in const reference to weights
olilarkin Dec 27, 2023
0833ea6
Introduce weights_it alias
olilarkin Dec 30, 2023
78f42d0
Use Eigen::Ref<> rather than normal references
olilarkin Dec 30, 2023
d60bcc1
Remove NAM_SAMPLE
olilarkin Jan 19, 2024
913e5b3
finalize_ -> Finalize
olilarkin Jan 19, 2024
b3ef0e2
_prewarm_samples -> mPrewarmSamples
olilarkin Jan 19, 2024
9298e8b
num_frames -> numFrames
olilarkin Jan 19, 2024
9378f8f
process -> Process
olilarkin Jan 19, 2024
af31d4e
prewarm -> Prewarm
olilarkin Jan 19, 2024
7698420
_set_receptive_field -> SetReceptiveField
olilarkin Jan 19, 2024
693bf13
_reset_input_buffer
olilarkin Jan 19, 2024
6e55afa
_update_buffers_
olilarkin Jan 19, 2024
0f4e7cb
_rewind_buffers_
olilarkin Jan 19, 2024
3955a22
_input_buffer -> mInputBuffer
olilarkin Jan 19, 2024
d3068c8
_output_buffer -> mOutputBuffer
olilarkin Jan 19, 2024
8544e1a
_input_buffer_offset
olilarkin Jan 19, 2024
dadb1a7
mReceptiveField
olilarkin Jan 19, 2024
056777a
Remove unused _input_buffer_channels
olilarkin Jan 19, 2024
53b2915
newReceptiveField
olilarkin Jan 19, 2024
df723f7
input_buffer_size
olilarkin Jan 19, 2024
86a9ca4
receptive_field
olilarkin Jan 19, 2024
5c515d8
expectedSampleRate
olilarkin Jan 19, 2024
1fc8ec1
mBias
olilarkin Jan 19, 2024
b997c70
mWeight
olilarkin Jan 19, 2024
b882f5b
_do_bias
olilarkin Jan 19, 2024
6895341
_bias -> bias
olilarkin Jan 19, 2024
023f3eb
_weight
olilarkin Jan 19, 2024
ac2c199
_dilation
olilarkin Jan 19, 2024
483f52e
_dilation
olilarkin Jan 19, 2024
cb74e17
do_bias
olilarkin Jan 19, 2024
73f9686
process_
olilarkin Jan 19, 2024
355b2d5
set_weights_
olilarkin Jan 19, 2024
6eb415a
set_size_
olilarkin Jan 19, 2024
59832b9
set_size_and_weights_
olilarkin Jan 19, 2024
513b453
in_channels
olilarkin Jan 19, 2024
265b74c
out_channels
olilarkin Jan 19, 2024
e622ae2
kernel_size
olilarkin Jan 19, 2024
3eafcee
get_in_channels
olilarkin Jan 19, 2024
1b6def1
GetKernelSize
olilarkin Jan 19, 2024
52ad4c4
get_num_weights
olilarkin Jan 19, 2024
97c0223
get_out_channels
olilarkin Jan 19, 2024
92d6769
GetDilation
olilarkin Jan 19, 2024
180a475
VerifyConfigVersion
olilarkin Jan 19, 2024
b9519c6
get_dsp
olilarkin Jan 19, 2024
7afdef8
model_file
olilarkin Jan 19, 2024
116a3c5
GetDSPLegacy
olilarkin Jan 19, 2024
0aebcdd
apply
olilarkin Jan 19, 2024
5ecaa6b
get_activation
olilarkin Jan 19, 2024
52b8bdf
enable_fast_tanh
olilarkin Jan 19, 2024
7f09e1d
disable_fast_tanh
olilarkin Jan 19, 2024
56f4015
sUsingFastTanh
olilarkin Jan 19, 2024
f454366
_verify_weights
olilarkin Jan 19, 2024
8097e06
_head
olilarkin Jan 19, 2024
b04e553
_head_output
olilarkin Jan 19, 2024
e029787
mBlockVals
olilarkin Jan 19, 2024
ae667b9
mBlocks
olilarkin Jan 19, 2024
42b469a
actual_weights
olilarkin Jan 19, 2024
d859806
_Head
olilarkin Jan 19, 2024
57a3132
mBatchnorm
olilarkin Jan 19, 2024
3774bb4
mScale
olilarkin Jan 19, 2024
61bfe24
loc
olilarkin Jan 19, 2024
c39606c
mHeadBias
olilarkin Jan 19, 2024
aadaa06
mHeadWeight
olilarkin Jan 19, 2024
f3c400f
_layers
olilarkin Jan 19, 2024
d491f55
_process_sample
olilarkin Jan 19, 2024
33ae6a2
input
olilarkin Jan 19, 2024
23171a1
num_layers
olilarkin Jan 19, 2024
a4659f8
input_size
olilarkin Jan 19, 2024
3673a3d
hidden_size
olilarkin Jan 19, 2024
045df5a
GetHiddenSize
olilarkin Jan 19, 2024
afb6ef1
_get_input_size
olilarkin Jan 19, 2024
fc3cfb1
get_hidden_state
olilarkin Jan 19, 2024
1cbec54
_set_num_frames_
olilarkin Jan 19, 2024
d5b723d
_set_condition_array
olilarkin Jan 19, 2024
4413912
_get_condition_dim
olilarkin Jan 19, 2024
6181f49
PrepareForFrames
olilarkin Jan 19, 2024
977bc78
AdvanceBuffers
olilarkin Jan 19, 2024
95f2edf
_head_output
olilarkin Jan 19, 2024
3b366e8
mHeadScale
olilarkin Jan 19, 2024
485f8a1
mHeadArrays
olilarkin Jan 19, 2024
4deb410
mCondition
olilarkin Jan 19, 2024
a98e181
mLayerArrayOutputs
olilarkin Jan 19, 2024
67bc968
mLayerArrays
olilarkin Jan 19, 2024
1040bb7
_LayerArray
olilarkin Jan 19, 2024
e9a5092
_num_frames
olilarkin Jan 19, 2024
a5e5a98
layer_array_params
olilarkin Jan 19, 2024
8d953b5
head_scale
olilarkin Jan 19, 2024
2624368
with_head
olilarkin Jan 19, 2024
ef59cb9
_apply_activation_
olilarkin Jan 19, 2024
8e968df
_buffers
olilarkin Jan 19, 2024
02e4934
mActivation
olilarkin Jan 19, 2024
f34aca9
mHead
olilarkin Jan 19, 2024
6949bd8
mLayers
olilarkin Jan 19, 2024
fea45ec
_channels
olilarkin Jan 19, 2024
2e9f0f1
set_num_frames_
olilarkin Jan 19, 2024
658fe38
GetReceptiveField
olilarkin Jan 19, 2024
ce394f8
_get_channels
olilarkin Jan 19, 2024
78df991
GetBufferSize
olilarkin Jan 19, 2024
20ff7ef
_layer_buffers
olilarkin Jan 19, 2024
f4188b7
_head_rechannel
olilarkin Jan 19, 2024
bc5cc64
_layers
olilarkin Jan 19, 2024
692847e
Layer
olilarkin Jan 19, 2024
628f1ba
mReChannel
olilarkin Jan 19, 2024
0e6018e
mBufferStart
olilarkin Jan 19, 2024
863fa4c
get_receptive_field
olilarkin Jan 19, 2024
f4b91f1
headOuputs
olilarkin Jan 19, 2024
1bceb17
headInputs
olilarkin Jan 19, 2024
9c7cddd
layerOutputs
olilarkin Jan 19, 2024
5ac7329
layer_inputs
olilarkin Jan 19, 2024
f0899d9
prepareForFrames
olilarkin Jan 19, 2024
a148e7a
advance_buffers_
olilarkin Jan 19, 2024
70bd378
LayerArrayParams
olilarkin Jan 20, 2024
018c7d1
_GetReceptiveField duplicate?? TODO
olilarkin Jan 20, 2024
fb3b52c
mGated
olilarkin Jan 20, 2024
c04902c
mActivation
olilarkin Jan 20, 2024
4b5c05b
mConv
olilarkin Jan 20, 2024
ebb212c
mInputMixin
olilarkin Jan 20, 2024
a0cfdef
DilatedConv
olilarkin Jan 20, 2024
7f94ff6
getchannels
olilarkin Jan 20, 2024
110bb40
condition_size
olilarkin Jan 20, 2024
5310784
mActivation
olilarkin Jan 20, 2024
7157123
remove all instances of this->
olilarkin Jan 20, 2024
0c83506
final_head_array
olilarkin Jan 20, 2024
a58e46c
headInput
olilarkin Jan 20, 2024
c559245
weights_it -> weightsIterator
olilarkin Jan 20, 2024
115e727
const std::filesystem::path&
olilarkin Jan 20, 2024
8622454
const std::string&
olilarkin Jan 20, 2024
c43383d
conditionSize
olilarkin Jan 20, 2024
1754a13
headSize
olilarkin Jan 20, 2024
f8743bb
layerConfig
olilarkin Jan 20, 2024
e090dfe
configFileName
olilarkin Jan 20, 2024
7ea2631
Add GetDSP(const char* jsonStr)
olilarkin Jan 21, 2024
cd6e73a
Remove non-standard header file
olilarkin Jan 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mHeadWeight
olilarkin committed May 4, 2024
commit aadaa0678694356c0c09cb46e7282200da0e6d90
6 changes: 3 additions & 3 deletions NAM/lstm.cpp
Original file line number Diff line number Diff line change
@@ -72,9 +72,9 @@ nam::lstm::LSTM::LSTM(const int num_layers, const int input_size, const int hidd
auto it = weights.begin();
for (int i = 0; i < num_layers; i++)
this->_layers.push_back(LSTMCell(i == 0 ? input_size : hidden_size, hidden_size, it));
this->_head_weight.resize(hidden_size);
this->mHeadWeight.resize(hidden_size);
for (int i = 0; i < hidden_size; i++)
this->_head_weight[i] = *(it++);
this->mHeadWeight[i] = *(it++);
this->mHeadBias = *(it++);
assert(it == weights.end());
}
@@ -93,5 +93,5 @@ float nam::lstm::LSTM::_process_sample(const float x)
this->_layers[0].Process(this->_input);
for (size_t i = 1; i < this->_layers.size(); i++)
this->_layers[i].Process(this->_layers[i - 1].get_hidden_state());
return this->_head_weight.dot(this->_layers[this->_layers.size() - 1].get_hidden_state()) + this->mHeadBias;
return this->mHeadWeight.dot(this->_layers[this->_layers.size() - 1].get_hidden_state()) + this->mHeadBias;
}
2 changes: 1 addition & 1 deletion NAM/lstm.h
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ class LSTM : public DSP
~LSTM() = default;

protected:
Eigen::VectorXf _head_weight;
Eigen::VectorXf mHeadWeight;
float mHeadBias;
void Process(float* input, float* output, const int numFrames) override;
std::vector<LSTMCell> _layers;