Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
7334810
Update to NAM Core 0.4.0
mikeoliphant Jan 22, 2026
0645e40
Version check for A2. Add example A2 model for testing
mikeoliphant Jan 22, 2026
92db0d5
Update NAM Core. ModelTest now handles failure to load internal models.
mikeoliphant Jan 27, 2026
3ffa5ee
Update to latest NAM Core
mikeoliphant Feb 27, 2026
7e4efeb
Add option to enable NAM Core inline GEMM. Update NAM Core.
mikeoliphant Mar 12, 2026
c7a3d62
Added option to enable inline matrix multiplication in NAM Core.
mikeoliphant Mar 12, 2026
f046c43
Switch build NAM Core option to default ON
mikeoliphant Mar 12, 2026
b75c0d3
Update NAM Core
mikeoliphant Mar 13, 2026
52a1489
Merge branch 'nam_a2' of https://github.com/mikeoliphant/NeuralAudio …
mikeoliphant Mar 13, 2026
17842f2
only use leftCols(numFrames)
fps Apr 13, 2026
31ffaa5
Ust std::runtime_error instead of assert to signal wrong number of we…
fps Apr 13, 2026
8fd73a4
Merge pull request #33 from fps/assert_fix
mikeoliphant Apr 13, 2026
f438171
Merge pull request #34 from fps/top_rows_fix
mikeoliphant Apr 13, 2026
0cd5c1a
Don't do leftCols() ahead of time - rely on layer Process() to do the…
mikeoliphant Apr 13, 2026
bb36717
Formatting
mikeoliphant Apr 13, 2026
89fb36a
Put lefCols() back in Dense layer Process calls
mikeoliphant Apr 14, 2026
14fb7bf
Removed redundant returns. Check for correct number of weights up front.
mikeoliphant Apr 14, 2026
9ea05d9
Merge branch 'main' into nam_a2
mikeoliphant Apr 16, 2026
d2e53e9
Merge pull request #36 from mikeoliphant/nam_a2
mikeoliphant Apr 16, 2026
81ac2f2
Fix cmake
mikeoliphant Apr 16, 2026
61f3dee
Update to latest NAM Core
mikeoliphant Apr 16, 2026
e0a20bf
NAM A2 updates
mikeoliphant Apr 16, 2026
8d79bf0
Update LSTM notes
mikeoliphant Apr 16, 2026
001eb9a
Add neural_tilde to list of projects
mikeoliphant Apr 25, 2026
4510ba2
Fix issues with floating point metadata with no decimal places not be…
mikeoliphant Apr 27, 2026
701ab02
Add license section to README
mikeoliphant Apr 27, 2026
f0f3b8a
Use compile-time loop over convolution kernel. Lazy product seems to …
mikeoliphant Apr 30, 2026
fe02a71
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant Apr 30, 2026
1ab7a6a
Update NAM Core. Add support for A2 fast path wavenet.
mikeoliphant May 5, 2026
3133c3a
Add NAM_ENABLE_A2_FAST cmake option
mikeoliphant May 5, 2026
8c6db7f
Merge pull request #38 from mikeoliphant/fast_a2
mikeoliphant May 5, 2026
37b5155
Added model quality scaling
mikeoliphant May 5, 2026
5b570af
Document model quality scaling factor usage
mikeoliphant May 5, 2026
8cd830f
Add NAM Core container source files
mikeoliphant May 8, 2026
e645006
Merge pull request #39 from mikeoliphant/quality_scaling
mikeoliphant May 8, 2026
50df68d
Add quality scaling option to ModelTest
mikeoliphant May 8, 2026
05d9fbd
show max block time multiplied by total blocks in ModelTest benchmark
mikeoliphant May 13, 2026
b0d1c8c
Set NAM Core max buffer size
mikeoliphant May 18, 2026
9be7ba7
Add DEFAULT_QUALITY_SCALE cmake option
mikeoliphant May 18, 2026
2bbce1b
Update README with DEFAULT_QUALITY_SCALE option
mikeoliphant May 18, 2026
48a78f8
Added metadata interface
mikeoliphant May 18, 2026
9255a05
Update README.md
mikeoliphant May 18, 2026
82a09b1
Pass metadata field by ref
mikeoliphant May 18, 2026
580fd1f
Added GetModelVersion
mikeoliphant May 18, 2026
d43da8e
Document GetModelVersion
mikeoliphant May 18, 2026
68ef17d
Merge pull request #41 from mikeoliphant/metadata
mikeoliphant May 19, 2026
62a9327
Hide private details from public interface
mikeoliphant May 19, 2026
66d02d9
Mark method overrides explicitly
mikeoliphant May 19, 2026
71fbfbe
Fix Linux build (add includes)
mikeoliphant May 19, 2026
6293435
More linux includes
mikeoliphant May 19, 2026
fb24997
Include math for ModelTest
mikeoliphant May 19, 2026
0127fed
Don't build static LSTM models by default (saves memory and compile t…
mikeoliphant May 19, 2026
9170298
Avoid at least one of the extra A2 NAM Core prewarm calls
mikeoliphant May 20, 2026
2c6526f
Revert "Use compile-time loop over convolution kernel. Lazy product s…
mikeoliphant May 20, 2026
bd37b79
Update licensing note
mikeoliphant May 20, 2026
e13d1f1
Delete Utils/Models/wavenet_a2_max.nam
mikeoliphant May 20, 2026
6bcedc3
Avoid extra copy in FastMath tanh
mikeoliphant May 21, 2026
3a4cfa7
First shot at creating a release with ModelTest included
mikeoliphant May 22, 2026
7f10fc9
Merge pull request #45 from mikeoliphant/add_release
mikeoliphant May 22, 2026
6ec34e3
Build utils in release. Fix rpi cmake build tools path
mikeoliphant May 22, 2026
ed80e54
Fix Windows ModelTest exe path
mikeoliphant May 22, 2026
5182680
Fix Windows asset path
mikeoliphant May 22, 2026
6fef2e9
More method override annotations
mikeoliphant May 22, 2026
b5233cc
ModelTest release archive rename
mikeoliphant May 23, 2026
254753c
Look for ModelTest Model folder in current directory or up the path
mikeoliphant May 23, 2026
03280ff
Better error message when ModelTest can't find Models folder
mikeoliphant May 23, 2026
d988d4e
Merge pull request #46 from mikeoliphant/math_ref
mikeoliphant May 23, 2026
7bc4c24
Update NeuralAmpModelerCore
mikeoliphant May 27, 2026
3ba502f
Add NeuralModelLoader class in place of static model creation methods
mikeoliphant May 27, 2026
fb6f896
Fix static RTNeural model load path
mikeoliphant May 27, 2026
31bb74d
Add model loader info
mikeoliphant May 27, 2026
b108e8b
Merge pull request #48 from mikeoliphant/model_loader
mikeoliphant May 27, 2026
d9d685c
More override annotation fixes
mikeoliphant May 27, 2026
ad97ea3
Work around NAM Core prewarm issues
mikeoliphant May 27, 2026
570f0ce
Merge pull request #49 from mikeoliphant/fix_prewarm
mikeoliphant May 27, 2026
cf17eca
Remove debug code from ModelTest
mikeoliphant May 27, 2026
7b85822
Force build of static models in build test
mikeoliphant May 27, 2026
87bed1d
Fix static LSTM loading
mikeoliphant May 27, 2026
72c52b1
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant May 27, 2026
3ad5806
Fix NAM Core A2 fast path issue with Tone3000 models
mikeoliphant Jun 2, 2026
78ef473
Add a2 test model
mikeoliphant Jun 2, 2026
da5500f
Fix compiler warnings. Add A2 to default ModelTest tests
mikeoliphant Jun 10, 2026
305d866
Compiler warning fix
mikeoliphant Jun 10, 2026
7310b7f
More compiler fix
mikeoliphant Jun 10, 2026
6192f14
Expose receptive field size from NAM Core models
mikeoliphant Jun 11, 2026
aaa178b
Update NAM Core (revert A2 full optimization)
mikeoliphant Jun 11, 2026
82ac690
Merge pull request #50 from mikeoliphant/namcore_receptive_field
mikeoliphant Jun 11, 2026
951c7af
Update README.md
mikeoliphant Jun 11, 2026
539d9fe
Handle loading of composite models (A2 slimmable containers) internally
mikeoliphant Jun 11, 2026
9455577
Fix quality scaling model selection
mikeoliphant Jun 11, 2026
6c3d909
Switch from prewarm workaround to new NAM Core method
mikeoliphant Jun 12, 2026
f08ea65
Add composite model load mode and method to check quality scale RT sa…
mikeoliphant Jun 12, 2026
c6b9575
Fix static RTNeural
mikeoliphant Jun 12, 2026
bd2190a
More RTNeural fixes
mikeoliphant Jun 12, 2026
d36ea89
IsSetQualityChangeRealtimeSafe -> IsQualityChangeRealtimeSafe
mikeoliphant Jun 12, 2026
c90ceff
Add composite model loading information
mikeoliphant Jun 12, 2026
311ad84
Merge pull request #52 from mikeoliphant/composite_models
mikeoliphant Jun 12, 2026
0943ba7
Add DEFAULT_INPUT_DBU cmake option
mikeoliphant Jun 12, 2026
a3b0fa7
Add DEFAULT_INPUT_DBU
mikeoliphant Jun 12, 2026
29071b1
Fix compiler warning
mikeoliphant Jun 12, 2026
530f1ff
Extra gating check on NAM Core SetMaxAudioBufferSize()
mikeoliphant Jun 12, 2026
401727d
Update README.md
mikeoliphant Jun 13, 2026
3ab4cda
Add WaveNet oversampling if external sample rate is an even multiple …
mikeoliphant Jun 14, 2026
0966d5d
Visual Studio -> 2026
mikeoliphant Jun 14, 2026
46009de
Merge pull request #55 from mikeoliphant/oversample
mikeoliphant Jun 14, 2026
7b1aea8
Visual Studio -> 2026
mikeoliphant Jun 14, 2026
38af417
Add oversampling docs
mikeoliphant Jun 14, 2026
da199a7
Avoid deep copies of json data
mikeoliphant Jun 14, 2026
cb9a03a
Remove unused config access
mikeoliphant Jun 14, 2026
3fc1d25
Fix composite model receptive field
mikeoliphant Jun 14, 2026
7a7be0d
Update NAM Core. Fix WaveNet layer array head oversampling.
mikeoliphant Jun 15, 2026
6ccd786
Remove another unused config access
mikeoliphant Jun 17, 2026
f6a7f43
Update README.md
mikeoliphant Jun 23, 2026
d9a641b
Update NAM Core
mikeoliphant Jun 25, 2026
cf8d4d6
Remove RTNeural NAM implementation
mikeoliphant Jun 26, 2026
847f804
Update README.md
mikeoliphant Jun 26, 2026
72ee608
Fix FTNeural build
mikeoliphant Jun 26, 2026
6851161
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant Jun 26, 2026
b170780
Use gcc15 for linux builds (#57)
mikeoliphant Jun 26, 2026
81f31ec
Make layer kernel sizes configurable. Add LeakyReLU activation. Move …
mikeoliphant Jun 27, 2026
c39f8f5
Move convolution buffer into Conv1D class
mikeoliphant Jun 27, 2026
776bd71
Make WaveNet head rechannel a generalized convolution
mikeoliphant Jun 27, 2026
dc4c022
First pass at working internal A2
mikeoliphant Jun 27, 2026
ec79bfe
Gating checks for standard A2. Compiler flag for internal NAM A2 supp…
mikeoliphant Jun 27, 2026
73172de
Merge pull request #58 from mikeoliphant/internal_a2
mikeoliphant Jun 27, 2026
900c4b4
Fix layer array receptive field size for convolution head rechannel
mikeoliphant Jun 27, 2026
df230ab
Optimized paths for specific size conv/matmul (#59)
mikeoliphant Jul 6, 2026
c70ca17
Update README.md
mikeoliphant Jul 6, 2026
9a6a366
Update README.md
mikeoliphant Jul 6, 2026
6216e57
Update README.md
mikeoliphant Jul 6, 2026
e4c9fec
Default optimized 8x8 convolution based on compiler/version
mikeoliphant Jul 9, 2026
e148ada
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant Jul 9, 2026
41d0cf6
one more int->size_t
mikeoliphant Jul 9, 2026
b83c69f
Show xRT ModelTest
mikeoliphant Jul 13, 2026
b5a714d
Forward audio input level to model
apresta Jul 13, 2026
d659267
Add ChannelBuffer classes (#62)
mikeoliphant Jul 15, 2026
16e7858
Add -O3 to rpi build
mikeoliphant Jul 15, 2026
2fd2a74
Add -ffast-math for gcc
mikeoliphant Jul 15, 2026
7ac6a39
Fix build when not using NAM Core
mikeoliphant Jul 15, 2026
280c91d
int -> size_t
mikeoliphant Jul 15, 2026
3526fcb
Better compiler hints for vectorization of 8x8 conv
mikeoliphant Jul 15, 2026
c16296a
Compiler vectorization tweaks (#63)
mikeoliphant Jul 16, 2026
46f3df0
Forward audio input level to model (#61)
mikeoliphant Jul 16, 2026
5faf32f
cmake cleanup. Fix EigenMath and StdMath. Add model SetAudioInputLeve…
mikeoliphant Jul 16, 2026
5cd91f4
update 8x8 conv docs
mikeoliphant Jul 17, 2026
22e4a0f
Multiframe convolution improvements/docs (#64)
mikeoliphant Jul 17, 2026
fec4ea2
Update README.md
mikeoliphant Jul 17, 2026
b1137e1
Use 8-frame convolution for RPi5 (#66)
mikeoliphant Jul 17, 2026
bf18e10
Use template type instead of float for activations
mikeoliphant Jul 21, 2026
f19b5b9
Fix fastmath sigmoid typo
mikeoliphant Jul 21, 2026
766c1ba
use template type instead of float for WaveNet samples
mikeoliphant Jul 21, 2026
a78d32f
Faster A1 Standard
mikeoliphant Jul 21, 2026
c3d7e60
Update README.md
mikeoliphant Jul 23, 2026
08c0ada
Weight accessors for conv/dense
mikeoliphant Jul 23, 2026
faa5c06
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant Jul 23, 2026
4dbfe29
Getters for WaveNet internal structures
mikeoliphant Jul 23, 2026
606d57a
Expose some more internals
mikeoliphant Jul 23, 2026
3fb8bc3
Don't process the unused 1x1 for the last layer of the last layer array
mikeoliphant Aug 1, 2026
40724d2
Use half instead of hardcode 4 for 16 channel multiframe conv
mikeoliphant Aug 1, 2026
56f23e4
Add path for tileSize == 2
mikeoliphant Aug 1, 2026
49100f9
Update CREDITS.md
mikeoliphant Aug 1, 2026
a34cc85
data access operator for ChannelRowSpan
mikeoliphant Aug 14, 2026
87ebe0e
Add multiframe convolution for 4x4 and 2x2 (faster A1 nano and feather)
mikeoliphant Aug 21, 2026
6fc09f6
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant Aug 21, 2026
294cc6c
Try to skip NAM core submodules
mikeoliphant Aug 21, 2026
ea3bfee
another try at excluding sub-submodules
mikeoliphant Aug 21, 2026
59e8a63
Another try at excluding submodules
mikeoliphant Aug 21, 2026
af69527
Revert sub-submodule stuff - doesn't work
mikeoliphant Aug 21, 2026
9bb47fe
Update NeuralAmpModelerCore (exclude submodules)
mikeoliphant Aug 21, 2026
e59cd5d
Update NeuralAmpModelerCore
mikeoliphant Aug 21, 2026
9646564
Add NAM_A2_RING_MODE option to CMakeLists.txt (#68)
fragfz Sep 1, 2026
9f5be0a
Update README.md
mikeoliphant Sep 1, 2026
6db8445
Rename Dense In/OutSize to In/OutChannels
mikeoliphant Sep 1, 2026
8e38c92
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant Sep 1, 2026
3b36251
Add transposed Eigen maps. Added ChannelBufferDynamic.
mikeoliphant Sep 1, 2026
6b87ef3
Add SetZero for ChannelRowSpan. Base override for cols.
mikeoliphant Sep 1, 2026
0f02753
Fix SetZero
mikeoliphant Sep 1, 2026
e249431
Use stack allocation for WaveNet layer state block
mikeoliphant Sep 4, 2026
0bff115
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant Sep 4, 2026
204993a
Remove accessors
mikeoliphant Sep 4, 2026
574c8df
define for alignas
mikeoliphant Sep 7, 2026
58450ea
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant Sep 7, 2026
c5275bd
remove RTNeural-NAM source group
mikeoliphant Sep 8, 2026
f3b6a98
Make RTNeural completely optional
mikeoliphant Sep 13, 2026
8fd7137
compiler fix. headRechannel -> oneByOne
mikeoliphant Sep 15, 2026
a34cd78
Use const for Process() input. const cast workaround for NAM Core pro…
mikeoliphant Sep 29, 2026
045fcd1
Merge branch 'main' of https://github.com/mikeoliphant/NeuralAudio
mikeoliphant Sep 29, 2026
048d195
fix Process() const input in RTNeural override
mikeoliphant Sep 29, 2026
b98dfbd
Handle A1 head rechannel more cleanly (fixes A1 debug error)
mikeoliphant Oct 9, 2026
88b8909
merge conflict
dromer Nov 6, 2026
2b7e64c
Merge tag 'v0.1.3' into fix/wavenet-scalar-math-update2
dromer Nov 6, 2026
ae2068d
Merge branch 'fix/wavenet-scalar-math-update' of github.com:Wasted-Au…
dromer Nov 6, 2026
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
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Build
working-directory: ${{github.workspace}}/build
run: |
cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_UTILS=ON -DBUILD_NAMCORE=ON -DBUILD_STATIC_RTNEURAL=ON -T ClangCL ..
cmake -G "Visual Studio 18 2026" -A x64 -DBUILD_UTILS=ON -DBUILD_NAMCORE=ON -DBUILD_STATIC_RTNEURAL=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON -T ClangCL ..
cmake --build . --config=release -j4

- name: Run ModelTest
Expand All @@ -40,13 +40,18 @@ jobs:
- uses: actions/checkout@v3.3.0
with:
submodules: recursive

- name: Setup GCC 15
uses: egor-tensin/setup-gcc@v2
with:
version: '15'

- name: Build
working-directory: ${{github.workspace}}/build
env:
CXX: g++-13
CXX: g++-15
run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_UTILS=ON -DBUILD_NAMCORE=ON -DBUILD_STATIC_RTNEURAL=ON
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_UTILS=ON -DBUILD_NAMCORE=ON -DBUILD_STATIC_RTNEURAL=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON
cmake --build . --config $BUILD_TYPE -j4

- name: Run ModelTest
Expand Down
157 changes: 157 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Release

on:
workflow_dispatch:

env:
BUILD_TYPE: Release

jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{steps.create_release.outputs.upload_url}}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
draft: true
tag_name: ${{github.ref}}
release_name: Release ${{github.ref}}

build-linux-x64:
name: Build Linux x64
needs: create_release
strategy:
matrix:
native_arch: [x86-64, x86-64-v3]
runs-on: ubuntu-latest
env:
ARCHIVE_NAME: ModelTest_linux_${{ matrix.native_arch }}.tgz
steps:
- uses: actions/checkout@v3.3.0
with:
submodules: recursive

- name: Setup Clang 21
uses: egor-tensin/setup-clang@v2
with:
version: '22'

- name: Build
working-directory: ${{github.workspace}}/build
env:
CXX: clang++
CXXFLAGS: "-Wall -O3 -march=${{ matrix.native_arch }} -static-libstdc++ -static-libgcc"
run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_UTILS=ON -DBUILD_NAMCORE=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON ${{ matrix.native_arch == 'x86-64' && '-DMULTIFRAME_8X8_CONVOLUTION=0' || '' }}
cmake --build . --config $BUILD_TYPE -j4

- name: Add Archive
working-directory: ${{github.workspace}}/build
run: |
mkdir ModelTest
cp Utils/ModelTest/ModelTest ModelTest
cp -r Utils/Models ModelTest
tar -czf ${{ env.ARCHIVE_NAME }} ModelTest

- name: Upload Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build/${{ env.ARCHIVE_NAME }}
asset_name: ${{ env.ARCHIVE_NAME }}
asset_content_type: application/tgz

build-rpi:
name: Build Raspberry Pi
needs: create_release
strategy:
matrix:
native_arch: [rpi4, rpi5]
runs-on: ubuntu-latest
container:
image: ghcr.io/tttapa/docker-arm-cross-toolchain:aarch64-rpi3-linux-gnu-gcc16
env:
ARCHIVE_NAME: ModelTest_${{ matrix.native_arch }}.tgz
steps:
- uses: actions/checkout@v3.3.0
with:
submodules: recursive

- name: Build
working-directory: ${{github.workspace}}/build
env:
CXXFLAGS: "-Wall -O3 -static-libstdc++ -static-libgcc"
run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_UTILS=ON -DBUILD_NAMCORE=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON ${{ matrix.native_arch == 'rpi5' && '-DMULTIFRAME_8X8_CONVOLUTION=8' || '' }} -DCMAKE_TOOLCHAIN_FILE=/home/develop/opt/x-tools/aarch64-rpi3-linux-gnu/aarch64-${{ matrix.native_arch }}-linux-gnu.toolchain.cmake
cmake --build . --config $BUILD_TYPE -j4

- name: Add Archive
working-directory: ${{github.workspace}}/build
run: |
mkdir ModelTest
cp Utils/ModelTest/ModelTest ModelTest
cp -r Utils/Models ModelTest
tar -czf ${{ env.ARCHIVE_NAME }} ModelTest

- name: Upload Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build/${{ env.ARCHIVE_NAME }}
asset_name: ${{ env.ARCHIVE_NAME }}
asset_content_type: application/tgz

build-windows:
name: Build Windows
needs: create_release
strategy:
matrix:
native_arch: [x86-64, x86-64-v3]
runs-on: windows-latest
env:
ARCHIVE_NAME: ModelTest_win_${{ matrix.native_arch }}.zip
steps:
- uses: actions/checkout@v3.3.0
with:
submodules: recursive

- name: Build
working-directory: ${{github.workspace}}/build
env:
CXXFLAGS: "/O2 -march=${{ matrix.native_arch }}"
run: |
cmake.exe -G "Visual Studio 18 2026" -A x64 -T ClangCL -DBUILD_UTILS=ON -DBUILD_NAMCORE=ON -DBUILD_INTERNAL_STATIC_WAVENET=ON -DBUILD_INTERNAL_STATIC_LSTM=ON ${{ matrix.native_arch == 'x86-64' && '-DMULTIFRAME_8X8_CONVOLUTION=0' || '' }} ..
cmake --build . --config=release -j4

- name: Add Archive
working-directory: ${{github.workspace}}/build
run: |
mkdir ModelTest
cp Utils/ModelTest/Release/ModelTest.exe ModelTest
cp -r Utils/Models ModelTest
Compress-Archive -Path ModelTest -Destination ${{ env.ARCHIVE_NAME }}

- name: Upload Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build/${{ env.ARCHIVE_NAME }}
asset_name: ${{ env.ARCHIVE_NAME }}
asset_content_type: application/zip
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

project(NeuralAudio VERSION 0.0.1)
project(NeuralAudio VERSION 0.1.3)

add_subdirectory(NeuralAudio)
add_subdirectory(NeuralAudioCAPI)
Expand Down
2 changes: 0 additions & 2 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ https://github.com/sdatkinson/NeuralAmpModelerCore

https://github.com/jatinchowdhury18/RTNeural

https://github.com/jatinchowdhury18/RTNeural-NAM

https://gitlab.com/libeigen/eigen

https://github.com/nlohmann/json
111 changes: 80 additions & 31 deletions NeuralAudio/Activation.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include <cmath>
#include <Eigen/Core>
#include <math_approx/math_approx.hpp>
#include <NeuralAudio/ChannelBuffer.h>

#define TCONST(num) static_cast<T>(num)

namespace NeuralAudio
{
Expand All @@ -14,88 +17,134 @@ namespace NeuralAudio
#define WAVENET_MATH FastMath
#endif

template<typename T>
struct StdMath
{
template <typename Matrix>
static auto Tanh(Matrix& x)
template<size_t Channels>
static void Tanh(ChannelRowSpan<T, Channels>& channelBuffer)
{
float* data = x.data();
size_t size = x.rows() * x.cols();
T* data = channelBuffer.GetData();
size_t size = channelBuffer.GetSize();

for (size_t pos = 0; pos < size; pos++)
{
data[pos] = Tanh(data[pos]);
}

return x;
}

static inline float Tanh(const float x)
static inline T Tanh(const T x)
{
return std::tanh(x);
}

static inline float Sigmoid(float x)
static inline T Sigmoid(T x)
{
return 1.0f / (1.0f + std::exp(-x));
return TCONST(1.0) / (TCONST(1.0)+ std::exp(-x));
}

template<size_t Channels>
static void LeakyReLU(ChannelRowSpan<T, Channels> channelBuffer)
{
T* data = channelBuffer.GetData();
size_t size = channelBuffer.GetSize();

for (size_t pos = 0; pos < size; pos++)
{
data[pos] = LeakyReLU(data[pos]);
}
}

static inline T LeakyReLU(T x, T negativeSlope)
{
return x > TCONST(0) ? x : negativeSlope * x;
}

static inline T LeakyReLU(T x)
{
return LeakyReLU(x, TCONST(0.01));
}
};

template<typename T>
struct FastMath
{
template <typename Matrix>
static auto Tanh(Matrix& x)
template<size_t Channels>
static void Tanh(ChannelRowSpan<T, Channels>& channelBuffer)
{
float* data = x.data();
size_t size = x.rows() * x.cols();
T* data = channelBuffer.GetData();
size_t size = channelBuffer.GetSize();

for (size_t pos = 0; pos < size; pos++)
{
data[pos] = Tanh(data[pos]);
}

return x;
}

static inline float Tanh(const float x)
static inline T Tanh(const T x)
{
//return std::tanh(x);
const T ax = std::abs(x);

const T x2 = x * x;

//return math_approx::tanh<5>(x);
return (x * (TCONST(2.45550750702956) + TCONST(2.45550750702956) * ax + (TCONST(0.893229853513558) + TCONST(0.821226666969744) * ax) * x2)
/ (TCONST(2.44506634652299) + (TCONST(2.44506634652299) + x2) * std::abs(x + TCONST(0.814642734961073) * x * ax)));
}

const float ax = fabsf(x);
static inline T Sigmoid(T x)
{
return TCONST(0.5) * (Tanh(x * TCONST(0.5)) + TCONST(1));
}

const float x2 = x * x;
template<size_t Channels>
static void LeakyReLU(ChannelRowSpan<T, Channels> channelBuffer)
{
T* data = channelBuffer.GetData();
size_t size = channelBuffer.GetSize();

return (x * (2.45550750702956f + 2.45550750702956f * ax + (0.893229853513558f + 0.821226666969744f * ax) * x2)
/ (2.44506634652299f + (2.44506634652299f + x2) * fabsf(x + 0.814642734961073f * x * ax)));
for (size_t pos = 0; pos < size; pos++)
{
data[pos] = LeakyReLU(data[pos]);
}
}

static inline float Sigmoid(float x)
static inline T LeakyReLU(T x, T negativeSlope)
{
//return math_approx::sigmoid_exp<5>(x);
return x > TCONST(0.0) ? x : negativeSlope * x;
}

//return 1.0f / (1.0f + std::exp(-x));
return 0.5f * (Tanh(x * 0.5f) + 1);
static inline T LeakyReLU(T x)
{
return LeakyReLU(x, TCONST(0.01));
}
};

template<typename T>
struct EigenMath
{
template <typename Matrix>
static auto Tanh(const Matrix& x)
template<size_t Channels>
static void Tanh(ChannelRowSpan<T, Channels>& channelBuffer)
{
return x.array().tanh();
auto map = channelBuffer.GetEigenMap();

map = map.array().tanh();
}

static inline float Tanh(const float x)
{
return Eigen::numext::tanh(x);
}

static inline float Sigmoid(float x)
template<size_t Channels>
static void LeakyReLU(ChannelRowSpan<T, Channels> channelBuffer)
{
auto map = channelBuffer.GetEigenMap();

map = (map.array() < TCONST(0.0)).select(map.array() * TCONST(0.01), map.array());
}

static inline T Sigmoid(T x)
{
return 0.5f * (Tanh(x * 0.5f) + 1);
return TCONST(0.5) * (Tanh(x * TCONST(0.5)) + TCONST(1));
}
};
}
Loading
Loading