diff --git a/CHANGELOG.md b/CHANGELOG.md index 2281061..0d0b776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ development artifact builds use `vMAJOR.MINOR.PATCH-dev.N`. ## Unreleased +- Added fully offline per-stem Audio-to-MIDI transcription with a bundled Basic Pitch model, native C++ inference, cancellable track progress, polyphonic Notation/MIDI notes, and project persistence. Basic Pitch is unavailable for Drum stems, and re-transcription now warns before replacing existing stem notes and rests. - Added inline flat, natural, and sharp signs to Notation with Leland glyphs, one-shot note entry, selected tied-note editing, compact duration and accidental track menus, keyboard shortcuts, persistence, and MusicXML export. - Added automatic rhythmic beaming for eighth and sixteenth notes in supported simple and compound Notation meters, including shared stem direction, sloped beams, secondary beam breaks, and beamlets. - Fixed Leland eighth-note and shorter flags separating from their stems in Notation chord and Drum rendering. diff --git a/JammLab.xcodeproj/project.pbxproj b/JammLab.xcodeproj/project.pbxproj index 9e1f894..5f91902 100644 --- a/JammLab.xcodeproj/project.pbxproj +++ b/JammLab.xcodeproj/project.pbxproj @@ -248,6 +248,23 @@ 9FCE01022F20000100112233 /* NotationDurationEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FCE00022F20000100112233 /* NotationDurationEditor.swift */; }; 9FCE01032F20000100112233 /* NotationDurationEditorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FCE00032F20000100112233 /* NotationDurationEditorTests.swift */; }; 9FD001012D20000100112233 /* ControlHelpText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FD001002D20000100112233 /* ControlHelpText.swift */; }; + 9F7001012F80000100112233 /* StemTranscriptionModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000012F80000100112233 /* StemTranscriptionModels.swift */; }; + 9F7001022F80000100112233 /* StemTranscriptionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000022F80000100112233 /* StemTranscriptionService.swift */; }; + 9F7001032F80000100112233 /* StemTranscriptionNotationMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000032F80000100112233 /* StemTranscriptionNotationMapper.swift */; }; + 9F7001042F80000100112233 /* StemTranscriptionMIDIExporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000042F80000100112233 /* StemTranscriptionMIDIExporter.swift */; }; + 9F7001052F80000100112233 /* AudioPlayerViewModel+StemTranscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000052F80000100112233 /* AudioPlayerViewModel+StemTranscription.swift */; }; + 9F7001102F80000100112233 /* BasicPitchTranscriptionEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000102F80000100112233 /* BasicPitchTranscriptionEngine.cpp */; }; + 9F7001112F80000100112233 /* BasicPitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000112F80000100112233 /* BasicPitch.cpp */; }; + 9F7001122F80000100112233 /* BasicPitchCNN.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000122F80000100112233 /* BasicPitchCNN.cpp */; }; + 9F7001132F80000100112233 /* Features.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000132F80000100112233 /* Features.cpp */; }; + 9F7001142F80000100112233 /* Notes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000142F80000100112233 /* Notes.cpp */; }; + 9F7001152F80000100112233 /* JMBasicPitchBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000152F80000100112233 /* JMBasicPitchBridge.mm */; }; + 9F7001162F80000100112233 /* libonnxruntime.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F7000162F80000100112233 /* libonnxruntime.a */; }; + 9F7001172F80000100112233 /* BasicPitchModel in Resources */ = {isa = PBXBuildFile; fileRef = 9F7000172F80000100112233 /* BasicPitchModel */; }; + 9F7001212F80000100112233 /* ThirdPartyNotices in Resources */ = {isa = PBXBuildFile; fileRef = 9F7000212F80000100112233 /* ThirdPartyNotices */; }; + 9F7001222F80000100112233 /* StemTranscriptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000222F80000100112233 /* StemTranscriptionTests.swift */; }; + 9F7001232F80000100112233 /* BasicPitchNativeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000232F80000100112233 /* BasicPitchNativeTests.mm */; }; + 9F7001242F80000100112233 /* StemTranscriptionPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7000242F80000100112233 /* StemTranscriptionPerformanceTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -535,6 +552,32 @@ 9FC100052D10000100112233 /* Signing-Local.xcconfig.example */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Signing-Local.xcconfig.example"; sourceTree = ""; }; 9FC100062D10000100112233 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 9FD001002D20000100112233 /* ControlHelpText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlHelpText.swift; sourceTree = ""; }; + 9F7000012F80000100112233 /* StemTranscriptionModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StemTranscriptionModels.swift; sourceTree = ""; }; + 9F7000022F80000100112233 /* StemTranscriptionService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StemTranscriptionService.swift; sourceTree = ""; }; + 9F7000032F80000100112233 /* StemTranscriptionNotationMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StemTranscriptionNotationMapper.swift; sourceTree = ""; }; + 9F7000042F80000100112233 /* StemTranscriptionMIDIExporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StemTranscriptionMIDIExporter.swift; sourceTree = ""; }; + 9F7000052F80000100112233 /* AudioPlayerViewModel+StemTranscription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AudioPlayerViewModel+StemTranscription.swift"; sourceTree = ""; }; + 9F7000102F80000100112233 /* BasicPitchTranscriptionEngine.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BasicPitchTranscriptionEngine.cpp; sourceTree = ""; }; + 9F7000182F80000100112233 /* BasicPitchTranscriptionEngine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BasicPitchTranscriptionEngine.h; sourceTree = ""; }; + 9F7000112F80000100112233 /* BasicPitch.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BasicPitch.cpp; sourceTree = ""; }; + 9F7000192F80000100112233 /* BasicPitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BasicPitch.h; sourceTree = ""; }; + 9F7000122F80000100112233 /* BasicPitchCNN.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BasicPitchCNN.cpp; sourceTree = ""; }; + 9F70001A2F80000100112233 /* BasicPitchCNN.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BasicPitchCNN.h; sourceTree = ""; }; + 9F7000132F80000100112233 /* Features.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Features.cpp; sourceTree = ""; }; + 9F70001B2F80000100112233 /* Features.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Features.h; sourceTree = ""; }; + 9F7000142F80000100112233 /* Notes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Notes.cpp; sourceTree = ""; }; + 9F70001C2F80000100112233 /* Notes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Notes.h; sourceTree = ""; }; + 9F70001D2F80000100112233 /* BasicPitchConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BasicPitchConstants.h; sourceTree = ""; }; + 9F70001E2F80000100112233 /* Utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Utils.h; sourceTree = ""; }; + 9F7000152F80000100112233 /* JMBasicPitchBridge.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = JMBasicPitchBridge.mm; sourceTree = ""; }; + 9F70001F2F80000100112233 /* JMBasicPitchBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JMBasicPitchBridge.h; sourceTree = ""; }; + 9F7000162F80000100112233 /* libonnxruntime.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = ThirdParty/onnxruntime/lib/libonnxruntime.a; sourceTree = ""; }; + 9F7000172F80000100112233 /* BasicPitchModel */ = {isa = PBXFileReference; lastKnownFileType = folder; path = BasicPitchModel; sourceTree = ""; }; + 9F7000202F80000100112233 /* JammLab-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "JammLab-Bridging-Header.h"; sourceTree = ""; }; + 9F7000212F80000100112233 /* ThirdPartyNotices */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ThirdPartyNotices; sourceTree = ""; }; + 9F7000222F80000100112233 /* StemTranscriptionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StemTranscriptionTests.swift; sourceTree = ""; }; + 9F7000232F80000100112233 /* BasicPitchNativeTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BasicPitchNativeTests.mm; sourceTree = ""; }; + 9F7000242F80000100112233 /* StemTranscriptionPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StemTranscriptionPerformanceTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -542,6 +585,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9F7001162F80000100112233 /* libonnxruntime.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -593,8 +637,10 @@ 9F8A03062C00000100112233 /* Views */, 9F8A03072C00000100112233 /* Utilities */, 9F2700062EA0000100112233 /* Resources */, + 9F7003002F80000100112233 /* Transcription */, 9F8A000B2C00000100112233 /* Assets.xcassets */, 9F8A000C2C00000100112233 /* JammLab.entitlements */, + 9F7000202F80000100112233 /* JammLab-Bridging-Header.h */, ); path = JammLab; sourceTree = ""; @@ -618,6 +664,7 @@ 9FCE00022F20000100112233 /* NotationDurationEditor.swift */, 9F9300012C90000100112233 /* StemBackendResolver.swift */, 9F8D00012C30000100112233 /* StemModels.swift */, + 9F7000012F80000100112233 /* StemTranscriptionModels.swift */, 9F8E00012C40000100112233 /* StemSeparationJobModels.swift */, 9F8A00122C00000100112233 /* TimecodedNote.swift */, 9F8B00012C10000100112233 /* TimelineViewport.swift */, @@ -659,6 +706,9 @@ 9F8D00032C30000100112233 /* MultiTrackAudioPlayer.swift */, 9F9200012C80000100112233 /* StemHelperProcessController.swift */, 9F8D00022C30000100112233 /* StemSeparationService.swift */, + 9F7000022F80000100112233 /* StemTranscriptionService.swift */, + 9F7000032F80000100112233 /* StemTranscriptionNotationMapper.swift */, + 9F7000042F80000100112233 /* StemTranscriptionMIDIExporter.swift */, 9F9100012C70000100112233 /* TempoGridCalculator.swift */, 9FBA00022D40000100112233 /* TrackPitchAnalyzer.swift */, 9FBA00032D40000100112233 /* TunerInputService.swift */, @@ -673,6 +723,8 @@ isa = PBXGroup; children = ( 9F2700072EA0000100112233 /* Fonts */, + 9F7000172F80000100112233 /* BasicPitchModel */, + 9F7000212F80000100112233 /* ThirdPartyNotices */, ); path = Resources; sourceTree = ""; @@ -697,6 +749,7 @@ 9FDE00052F60000100112233 /* AudioPlayerViewModel+Peakform.swift */, 9FB201022D30000100112233 /* AudioPlayerViewModel+Playback.swift */, 9FB201032D30000100112233 /* AudioPlayerViewModel+Stems.swift */, + 9F7000052F80000100112233 /* AudioPlayerViewModel+StemTranscription.swift */, 9FB201042D30000100112233 /* AudioPlayerViewModel+Timeline.swift */, 9FB201082D30000100112233 /* AudioPlayerViewModel+Markers.swift */, 9FB201092D30000100112233 /* AudioPlayerViewModel+LoopEditing.swift */, @@ -708,6 +761,44 @@ path = ViewModels; sourceTree = ""; }; + 9F7003002F80000100112233 /* Transcription */ = { + isa = PBXGroup; + children = ( + 9F7003012F80000100112233 /* Native */, + ); + path = Transcription; + sourceTree = ""; + }; + 9F7003012F80000100112233 /* Native */ = { + isa = PBXGroup; + children = ( + 9F7000102F80000100112233 /* BasicPitchTranscriptionEngine.cpp */, + 9F7000182F80000100112233 /* BasicPitchTranscriptionEngine.h */, + 9F7000152F80000100112233 /* JMBasicPitchBridge.mm */, + 9F70001F2F80000100112233 /* JMBasicPitchBridge.h */, + 9F7003022F80000100112233 /* Engine */, + 9F7000162F80000100112233 /* libonnxruntime.a */, + ); + path = Native; + sourceTree = ""; + }; + 9F7003022F80000100112233 /* Engine */ = { + isa = PBXGroup; + children = ( + 9F7000112F80000100112233 /* BasicPitch.cpp */, + 9F7000192F80000100112233 /* BasicPitch.h */, + 9F7000122F80000100112233 /* BasicPitchCNN.cpp */, + 9F70001A2F80000100112233 /* BasicPitchCNN.h */, + 9F70001D2F80000100112233 /* BasicPitchConstants.h */, + 9F7000132F80000100112233 /* Features.cpp */, + 9F70001B2F80000100112233 /* Features.h */, + 9F7000142F80000100112233 /* Notes.cpp */, + 9F70001C2F80000100112233 /* Notes.h */, + 9F70001E2F80000100112233 /* Utils.h */, + ); + path = Engine; + sourceTree = ""; + }; 9F8A03062C00000100112233 /* Views */ = { isa = PBXGroup; children = ( @@ -762,6 +853,8 @@ 9F8B03012C10000100112233 /* JammLabTests */ = { isa = PBXGroup; children = ( + 9F7000222F80000100112233 /* StemTranscriptionTests.swift */, + 9F7000232F80000100112233 /* BasicPitchNativeTests.mm */, 9FAB00012CE0000100112233 /* AudioFileImporterDurationTests.swift */, 9FAB00022CE0000100112233 /* PeakformLogicTests.swift */, 9FBA00052D40000100112233 /* PitchDetectionTests.swift */, @@ -876,6 +969,7 @@ isa = PBXGroup; children = ( 9FCD00012D50000100112233 /* PerformanceBenchmarkTests.swift */, + 9F7000242F80000100112233 /* StemTranscriptionPerformanceTests.swift */, ); path = JammLabPerformanceTests; sourceTree = ""; @@ -1073,6 +1167,8 @@ 9F2701032EA0000100112233 /* Leland-LICENSE.txt in Resources */, 9F2701042EA0000100112233 /* Leland-OFL-FAQ.txt in Resources */, 9F2701052EA0000100112233 /* Leland-README.md in Resources */, + 9F7001172F80000100112233 /* BasicPitchModel in Resources */, + 9F7001212F80000100112233 /* ThirdPartyNotices in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1129,6 +1225,7 @@ 9F8F01032C50000100112233 /* AudioPlaybackControlling.swift in Sources */, 9FCB01012D80000100112233 /* AudioSampleConverter.swift in Sources */, 9F8A01032C00000100112233 /* AudioPlayerViewModel.swift in Sources */, + 9F7001052F80000100112233 /* AudioPlayerViewModel+StemTranscription.swift in Sources */, 9FB200012D30000100112233 /* AudioPlayerViewModel+Project.swift in Sources */, 9FDE01042F60000100112233 /* AudioPlayerViewModel+Analysis.swift in Sources */, 9FDE01052F60000100112233 /* AudioPlayerViewModel+Peakform.swift in Sources */, @@ -1166,6 +1263,7 @@ 9F8A01012C00000100112233 /* JammLabApp.swift in Sources */, 9FAF01012D02000100112233 /* JammLabAppDelegate.swift in Sources */, 9F8A01112C00000100112233 /* JammLabProject.swift in Sources */, + 9F7001012F80000100112233 /* StemTranscriptionModels.swift in Sources */, 9F8C01062C20000100112233 /* MainWorkspacePanels.swift in Sources */, 9F8C01052C20000100112233 /* NoteRowView.swift in Sources */, 9FEA01042D70000100112233 /* NotationTrackView.swift in Sources */, @@ -1208,6 +1306,9 @@ 9F9201012C80000100112233 /* StemHelperProcessController.swift in Sources */, 9F8E01012C40000100112233 /* StemSeparationJobModels.swift in Sources */, 9F8D01022C30000100112233 /* StemSeparationService.swift in Sources */, + 9F7001022F80000100112233 /* StemTranscriptionService.swift in Sources */, + 9F7001032F80000100112233 /* StemTranscriptionNotationMapper.swift in Sources */, + 9F7001042F80000100112233 /* StemTranscriptionMIDIExporter.swift in Sources */, 9F9101012C70000100112233 /* TempoGridCalculator.swift in Sources */, 9F9101022C70000100112233 /* TempoGridRulerView.swift in Sources */, 9FDD01062D60000100112233 /* SettingsContentViews.swift in Sources */, @@ -1243,6 +1344,12 @@ 9F8A010C2C00000100112233 /* PeakformProvider.swift in Sources */, 9FAF01022D02000100112233 /* WindowCloseGuard.swift in Sources */, 9F8C01082C20000100112233 /* WindowTitleUpdater.swift in Sources */, + 9F7001102F80000100112233 /* BasicPitchTranscriptionEngine.cpp in Sources */, + 9F7001112F80000100112233 /* BasicPitch.cpp in Sources */, + 9F7001122F80000100112233 /* BasicPitchCNN.cpp in Sources */, + 9F7001132F80000100112233 /* Features.cpp in Sources */, + 9F7001142F80000100112233 /* Notes.cpp in Sources */, + 9F7001152F80000100112233 /* JMBasicPitchBridge.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1250,6 +1357,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 9F7001222F80000100112233 /* StemTranscriptionTests.swift in Sources */, + 9F7001232F80000100112233 /* BasicPitchNativeTests.mm in Sources */, 9FAB01012CE0000100112233 /* AudioFileImporterDurationTests.swift in Sources */, 9FAB01022CE0000100112233 /* PeakformLogicTests.swift in Sources */, 9FBA01052D40000100112233 /* PitchDetectionTests.swift in Sources */, @@ -1364,6 +1473,7 @@ buildActionMask = 2147483647; files = ( 9FCD01012D50000100112233 /* PerformanceBenchmarkTests.swift in Sources */, + 9F7001242F80000100112233 /* StemTranscriptionPerformanceTests.swift in Sources */, 9FCD01022D50000100112233 /* TestSupport.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1512,6 +1622,20 @@ AUTOMATION_APPLE_EVENTS = NO; CODE_SIGN_ENTITLEMENTS = JammLab/JammLab.entitlements; CODE_SIGN_STYLE = Automatic; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "RTNEURAL_USE_STL=1", + "RTNEURAL_USE_EIGEN=0", + "RTNEURAL_USE_XSIMD=0", + "RTNEURAL_NO_DEBUG=1", + "RTNEURAL_DEFAULT_ALIGNMENT=16", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/JammLab/Transcription/Native", + "$(SRCROOT)/JammLab/Transcription/Native/ThirdParty", + "$(SRCROOT)/JammLab/Transcription/Native/ThirdParty/onnxruntime/include", + ); COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = ""; @@ -1541,6 +1665,10 @@ "$(inherited)", "@executable_path/../Frameworks", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/JammLab/Transcription/Native/ThirdParty/onnxruntime/lib", + ); MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.cyberflow.JammLab; RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO; @@ -1550,6 +1678,7 @@ RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO; RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = NO; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "JammLab/JammLab-Bridging-Header.h"; }; name = Debug; }; @@ -1562,6 +1691,20 @@ AUTOMATION_APPLE_EVENTS = NO; CODE_SIGN_ENTITLEMENTS = JammLab/JammLab.entitlements; CODE_SIGN_STYLE = Automatic; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "RTNEURAL_USE_STL=1", + "RTNEURAL_USE_EIGEN=0", + "RTNEURAL_USE_XSIMD=0", + "RTNEURAL_NO_DEBUG=1", + "RTNEURAL_DEFAULT_ALIGNMENT=16", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/JammLab/Transcription/Native", + "$(SRCROOT)/JammLab/Transcription/Native/ThirdParty", + "$(SRCROOT)/JammLab/Transcription/Native/ThirdParty/onnxruntime/include", + ); COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = ""; @@ -1590,6 +1733,10 @@ "$(inherited)", "@executable_path/../Frameworks", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/JammLab/Transcription/Native/ThirdParty/onnxruntime/lib", + ); MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.cyberflow.JammLab; RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO; @@ -1599,6 +1746,7 @@ RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO; RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = NO; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "JammLab/JammLab-Bridging-Header.h"; }; name = Release; }; diff --git a/JammLab/ContentView.swift b/JammLab/ContentView.swift index d0946a4..b4e01ae 100644 --- a/JammLab/ContentView.swift +++ b/JammLab/ContentView.swift @@ -65,9 +65,11 @@ struct ContentView: View { } .onChange(of: viewModel.importedFile?.sourceMediaURL) { _, _ in stemMIDIPageStartTimes.removeAll() + viewModel.cancelPendingStemTranscriptionOverwrite() } .onChange(of: viewModel.currentProjectURL) { _, _ in stemMIDIPageStartTimes.removeAll() + viewModel.cancelPendingStemTranscriptionOverwrite() } .sheet(isPresented: $isEditingMarker) { RenameNoteDialog( @@ -92,6 +94,20 @@ struct ContentView: View { viewModel.clearError() } } + .confirmationDialog( + "Replace \(viewModel.pendingStemTranscriptionOverwrite?.stemType.title ?? "stem") notation?", + isPresented: pendingStemTranscriptionOverwriteBinding, + titleVisibility: .visible + ) { + Button("Replace Existing Notes", role: .destructive) { + viewModel.confirmPendingStemTranscriptionOverwrite() + } + Button("Cancel", role: .cancel) { + viewModel.cancelPendingStemTranscriptionOverwrite() + } + } message: { + Text("All existing notes and rests on this stem will be deleted and replaced by the new transcription.") + } } private var errorAlertBinding: Binding { @@ -105,6 +121,17 @@ struct ContentView: View { ) } + private var pendingStemTranscriptionOverwriteBinding: Binding { + Binding( + get: { viewModel.pendingStemTranscriptionOverwrite != nil }, + set: { isPresented in + if !isPresented { + viewModel.cancelPendingStemTranscriptionOverwrite() + } + } + ) + } + private func cancelMarkerEditing() { isEditingMarker = false editingMarkerID = nil diff --git a/JammLab/JammLab-Bridging-Header.h b/JammLab/JammLab-Bridging-Header.h new file mode 100644 index 0000000..973a41d --- /dev/null +++ b/JammLab/JammLab-Bridging-Header.h @@ -0,0 +1 @@ +#import "Transcription/Native/JMBasicPitchBridge.h" diff --git a/JammLab/Models/JammLabProject.swift b/JammLab/Models/JammLabProject.swift index e23db49..e87b870 100644 --- a/JammLab/Models/JammLabProject.swift +++ b/JammLab/Models/JammLabProject.swift @@ -24,6 +24,7 @@ struct JammLabProject: Codable { var notes: [TimecodedNote] var harmonySymbols: [HarmonySymbol] var notationItems: [NotationMeasureItem] + var stemTranscriptionTracks: [StemTranscriptionTrack] var notationPartClefs: [NotationPartID: Clef] var projectKeySelection: ProjectKeySelection? var loopStart: TimeInterval @@ -48,7 +49,7 @@ struct JammLabProject: Codable { var visibleNotationPartIDs: Set init( - formatVersion: Int = 14, + formatVersion: Int = 15, audioBookmarkData: Data, artifactRootBookmarkData: Data? = nil, audioDisplayName: String, @@ -57,6 +58,7 @@ struct JammLabProject: Codable { notes: [TimecodedNote], harmonySymbols: [HarmonySymbol] = [], notationItems: [NotationMeasureItem] = [], + stemTranscriptionTracks: [StemTranscriptionTrack] = [], notationPartClefs: [NotationPartID: Clef] = [:], projectKeySelection: ProjectKeySelection? = nil, loopStart: TimeInterval, @@ -89,6 +91,7 @@ struct JammLabProject: Codable { self.notes = notes self.harmonySymbols = harmonySymbols self.notationItems = notationItems + self.stemTranscriptionTracks = stemTranscriptionTracks self.notationPartClefs = notationPartClefs self.projectKeySelection = projectKeySelection self.loopStart = loopStart @@ -123,6 +126,7 @@ struct JammLabProject: Codable { case notes case harmonySymbols case notationItems + case stemTranscriptionTracks case notationPartClefs case projectKeySelection case loopStart @@ -158,6 +162,10 @@ struct JammLabProject: Codable { notes = try container.decode([TimecodedNote].self, forKey: .notes) harmonySymbols = try container.decodeIfPresent([HarmonySymbol].self, forKey: .harmonySymbols) ?? [] notationItems = try container.decodeIfPresent([NotationMeasureItem].self, forKey: .notationItems) ?? [] + stemTranscriptionTracks = try container.decodeIfPresent( + [StemTranscriptionTrack].self, + forKey: .stemTranscriptionTracks + ) ?? [] notationPartClefs = try container.decodeIfPresent([NotationPartID: Clef].self, forKey: .notationPartClefs) ?? [:] projectKeySelection = try container.decodeIfPresent(ProjectKeySelection.self, forKey: .projectKeySelection) loopStart = try container.decode(TimeInterval.self, forKey: .loopStart) @@ -195,6 +203,7 @@ struct JammLabProject: Codable { try container.encode(notes, forKey: .notes) try container.encode(harmonySymbols, forKey: .harmonySymbols) try container.encode(notationItems, forKey: .notationItems) + try container.encode(stemTranscriptionTracks, forKey: .stemTranscriptionTracks) try container.encode(notationPartClefs, forKey: .notationPartClefs) try container.encodeIfPresent(projectKeySelection, forKey: .projectKeySelection) try container.encode(loopStart, forKey: .loopStart) diff --git a/JammLab/Models/NotationScoreModels.swift b/JammLab/Models/NotationScoreModels.swift index a3d1637..216b91b 100644 --- a/JammLab/Models/NotationScoreModels.swift +++ b/JammLab/Models/NotationScoreModels.swift @@ -170,9 +170,18 @@ struct NotationPartID: Codable, Hashable, Identifiable, Equatable { NotationPartID(rawValue: "stem:\(type.rawValue)") } + static func stemTranscription(_ type: StemType, trackID: UUID) -> NotationPartID { + NotationPartID(rawValue: "transcription:\(type.rawValue):\(trackID.uuidString.lowercased())") + } + var stemType: StemType? { - guard rawValue.hasPrefix("stem:") else { return nil } - return StemType(rawValue: String(rawValue.dropFirst("stem:".count))) + if rawValue.hasPrefix("stem:") { + return StemType(rawValue: String(rawValue.dropFirst("stem:".count))) + } + guard rawValue.hasPrefix("transcription:") else { return nil } + let components = rawValue.split(separator: ":", omittingEmptySubsequences: false) + guard components.count == 3 else { return nil } + return StemType(rawValue: String(components[1])) } var isMain: Bool { @@ -245,6 +254,21 @@ struct NotationPartDescriptor: Equatable, Identifiable { } } + static func stemTranscription( + _ type: StemType, + id: NotationPartID, + sequence: Int + ) -> NotationPartDescriptor { + let base = stem(type) + return NotationPartDescriptor( + id: id, + title: "\(base.title) Transcription \(sequence)", + abbreviation: "\(base.abbreviation) T\(sequence)", + instrumentName: base.instrumentName, + instrumentSound: base.instrumentSound + ) + } + private static func make( id: NotationPartID, title: String, diff --git a/JammLab/Models/ProjectEditableState.swift b/JammLab/Models/ProjectEditableState.swift index a393511..37ddab8 100644 --- a/JammLab/Models/ProjectEditableState.swift +++ b/JammLab/Models/ProjectEditableState.swift @@ -4,6 +4,7 @@ struct ProjectEditableState: Equatable { var notes: [TimecodedNote] var harmonySymbols: [HarmonySymbol] = [] var notationItems: [NotationMeasureItem] = [] + var stemTranscriptionTracks: [StemTranscriptionTrack] = [] var notationPartClefs: [NotationPartID: Clef] = [:] var visibleNotationPartIDs: Set = [.main] var projectKeySelection: ProjectKeySelection? = nil @@ -28,6 +29,7 @@ struct ProjectPersistedEditableState: Equatable { var notes: [TimecodedNote] var harmonySymbols: [HarmonySymbol] = [] var notationItems: [NotationMeasureItem] = [] + var stemTranscriptionTracks: [StemTranscriptionTrack] = [] var notationPartClefs: [NotationPartID: Clef] = [:] var stemNotationTrackCollapsed: [StemType: Bool] = [:] var stemNoteDisplayModes: [StemType: StemNoteDisplayMode] = [:] diff --git a/JammLab/Models/ProjectStateNormalizer.swift b/JammLab/Models/ProjectStateNormalizer.swift index 5e48b7a..ce21d11 100644 --- a/JammLab/Models/ProjectStateNormalizer.swift +++ b/JammLab/Models/ProjectStateNormalizer.swift @@ -184,6 +184,92 @@ struct ProjectStateNormalizer { } } + static func normalizedStemTranscriptionTracks( + _ tracks: [StemTranscriptionTrack], + duration: TimeInterval, + notationItems: [NotationMeasureItem] + ) -> [StemTranscriptionTrack] { + let duration = normalizedDuration(duration) + let notationItemsByID = Dictionary( + notationItems.map { ($0.id, $0) }, + uniquingKeysWith: { first, _ in first } + ) + var seenTrackIDs = Set() + + return tracks.compactMap { track in + guard seenTrackIDs.insert(track.id).inserted, + !track.sourceFingerprint.path.isEmpty, + track.sourceFingerprint.fileSize >= 0, + track.sourceFingerprint.modificationTime.isFinite + else { + return nil + } + + let partID = track.notationPartID.stemType == track.stemType + ? track.notationPartID + : .stem(track.stemType) + let notes = track.notes.compactMap { note -> StemTranscriptionNote? in + guard (0...127).contains(note.midiPitch), + note.rawStartTimeSeconds.isFinite, + note.rawEndTimeSeconds.isFinite, + note.rawStartTimeSeconds >= 0, + note.rawEndTimeSeconds > note.rawStartTimeSeconds, + note.projectStartTimeSeconds.isFinite, + note.projectEndTimeSeconds.isFinite, + note.projectEndTimeSeconds > note.projectStartTimeSeconds, + note.confidence.isFinite + else { + return nil + } + let projectStart = min(duration, max(0, note.projectStartTimeSeconds)) + let projectEnd = min(duration, max(0, note.projectEndTimeSeconds)) + guard projectEnd > projectStart else { return nil } + + return StemTranscriptionNote( + id: note.id, + midiPitch: note.midiPitch, + rawStartTimeSeconds: note.rawStartTimeSeconds, + rawEndTimeSeconds: note.rawEndTimeSeconds, + projectStartTimeSeconds: projectStart, + projectEndTimeSeconds: projectEnd, + confidence: min(1, max(0, note.confidence)), + pitchBends: note.pitchBends, + notationItemIDs: note.notationItemIDs.filter { + notationItemsByID[$0]?.partID == partID + } + ) + } + let timings = track.timings.flatMap(normalizedTranscriptionTimings) + return StemTranscriptionTrack( + id: track.id, + stemType: track.stemType, + notationPartID: partID, + sourceFingerprint: track.sourceFingerprint, + createdAt: track.createdAt, + configuration: track.configuration, + notes: notes, + timings: timings, + warnings: track.warnings + ) + } + .sorted { $0.createdAt < $1.createdAt } + } + + private static func normalizedTranscriptionTimings( + _ timings: StemTranscriptionTimings + ) -> StemTranscriptionTimings? { + let values = [ + timings.audioPreparationSeconds, + timings.modelLoadSeconds, + timings.inferenceSeconds, + timings.postProcessingSeconds, + timings.totalSeconds, + timings.processedDurationSeconds + ] + guard values.allSatisfy({ $0.isFinite && $0 >= 0 }) else { return nil } + return timings + } + private static func normalizedTieTargetItemID( for item: NotationMeasureItem, availableItemsByID: [String: NotationMeasureItem] diff --git a/JammLab/Models/StemModels.swift b/JammLab/Models/StemModels.swift index ea13f82..b10b3a2 100644 --- a/JammLab/Models/StemModels.swift +++ b/JammLab/Models/StemModels.swift @@ -14,6 +14,7 @@ enum PlaybackMode: String, Codable, CaseIterable, Identifiable { return "Stems" } } + } enum StemType: String, Codable, CaseIterable, Identifiable { @@ -46,6 +47,13 @@ enum StemType: String, Codable, CaseIterable, Identifiable { } } + /// Spotify Basic Pitch is intended for pitched audio, not percussion. + /// Keep this policy centralized so UI and application/service boundaries + /// cannot accidentally diverge. + var supportsBasicPitchTranscription: Bool { + self != .drums + } + var canonicalStemFilename: String { "\(rawValue).wav" } diff --git a/JammLab/Models/StemTranscriptionModels.swift b/JammLab/Models/StemTranscriptionModels.swift new file mode 100644 index 0000000..bdaadf5 --- /dev/null +++ b/JammLab/Models/StemTranscriptionModels.swift @@ -0,0 +1,187 @@ +import Foundation + +enum StemTranscriptionPhase: String, Codable, Equatable { + case idle + case preparingAudio + case loadingModel + case transcribing + case processingNotes + case completed + case failed + case cancelled +} + +struct StemTranscriptionViewState: Equatable { + var phase: StemTranscriptionPhase = .idle + var progress: Double = 0 + var status: String = "" + + var isRunning: Bool { + switch phase { + case .preparingAudio, .loadingModel, .transcribing, .processingNotes: + return true + default: + return false + } + } +} + +struct StemTranscriptionOverwriteRequest: Equatable { + var stemType: StemType + var projectURL: URL? + var importedFileURL: URL? + var stemURL: URL + var sourceFingerprint: StemSourceFingerprint + var configuration: StemTranscriptionConfiguration +} + +struct StemTranscriptionConfiguration: Codable, Equatable { + var minimumNoteDurationMilliseconds: Double = 125 + var noteSensitivity: Double = 0.7 + var splitSensitivity: Double = 0.5 + var includePitchBends = false + var quantizationDenominator = 16 + + static let neuralNoteDefaults = StemTranscriptionConfiguration() +} + +struct StemTranscriptionNote: Codable, Equatable, Identifiable { + var id: UUID + var midiPitch: Int + var rawStartTimeSeconds: TimeInterval + var rawEndTimeSeconds: TimeInterval + var projectStartTimeSeconds: TimeInterval + var projectEndTimeSeconds: TimeInterval + var confidence: Double + var pitchBends: [Int] + var notationItemIDs: [String] + + init( + id: UUID = UUID(), + midiPitch: Int, + rawStartTimeSeconds: TimeInterval, + rawEndTimeSeconds: TimeInterval, + projectStartTimeSeconds: TimeInterval, + projectEndTimeSeconds: TimeInterval, + confidence: Double, + pitchBends: [Int] = [], + notationItemIDs: [String] = [] + ) { + self.id = id + self.midiPitch = midiPitch + self.rawStartTimeSeconds = rawStartTimeSeconds + self.rawEndTimeSeconds = rawEndTimeSeconds + self.projectStartTimeSeconds = projectStartTimeSeconds + self.projectEndTimeSeconds = projectEndTimeSeconds + self.confidence = confidence + self.pitchBends = pitchBends + self.notationItemIDs = notationItemIDs + } +} + +struct StemTranscriptionTimings: Codable, Equatable { + var audioPreparationSeconds: Double + var modelLoadSeconds: Double + var inferenceSeconds: Double + var postProcessingSeconds: Double + var totalSeconds: Double + var processedDurationSeconds: Double + + var processingTimeRatio: Double { + guard processedDurationSeconds > 0 else { return 0 } + return totalSeconds / processedDurationSeconds + } +} + +struct StemTranscriptionTrack: Codable, Equatable, Identifiable { + var id: UUID + var stemType: StemType + var notationPartID: NotationPartID + var sourceFingerprint: StemSourceFingerprint + var createdAt: Date + var configuration: StemTranscriptionConfiguration + /// Immutable detection provenance. Editable/quantized notation remains in + /// the project's shared `notationItems` collection. + var notes: [StemTranscriptionNote] + var timings: StemTranscriptionTimings? + var warnings: [String] + + init( + id: UUID = UUID(), + stemType: StemType, + notationPartID: NotationPartID? = nil, + sourceFingerprint: StemSourceFingerprint, + createdAt: Date = Date(), + configuration: StemTranscriptionConfiguration, + notes: [StemTranscriptionNote], + timings: StemTranscriptionTimings? = nil, + warnings: [String] = [] + ) { + self.id = id + self.stemType = stemType + self.notationPartID = notationPartID ?? .stem(stemType) + self.sourceFingerprint = sourceFingerprint + self.createdAt = createdAt + self.configuration = configuration + self.notes = notes + self.timings = timings + self.warnings = warnings + } + + private enum CodingKeys: String, CodingKey { + case id + case stemType + case notationPartID + case sourceFingerprint + case createdAt + case configuration + case notes + case timings + case warnings + } + + init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + id = try container.decode(UUID.self, forKey: .id) + stemType = try container.decode(StemType.self, forKey: .stemType) + notationPartID = try container.decodeIfPresent( + NotationPartID.self, + forKey: .notationPartID + ) ?? .stem(stemType) + sourceFingerprint = try container.decode(StemSourceFingerprint.self, forKey: .sourceFingerprint) + createdAt = try container.decode(Date.self, forKey: .createdAt) + configuration = try container.decode( + StemTranscriptionConfiguration.self, + forKey: .configuration + ) + notes = try container.decode([StemTranscriptionNote].self, forKey: .notes) + timings = try container.decodeIfPresent(StemTranscriptionTimings.self, forKey: .timings) + warnings = try container.decodeIfPresent([String].self, forKey: .warnings) ?? [] + } + + var notationItemIDs: Set { + Set(notes.flatMap(\.notationItemIDs)) + } +} + +struct StemTimelineMapping: Equatable { + var sourceStartTime: TimeInterval + var sourceDuration: TimeInterval + var projectStartTime: TimeInterval + var projectDuration: TimeInterval + + static func aligned(duration: TimeInterval) -> StemTimelineMapping { + StemTimelineMapping( + sourceStartTime: 0, + sourceDuration: duration, + projectStartTime: 0, + projectDuration: duration + ) + } + + func projectTime(forSourceTime sourceTime: TimeInterval) -> TimeInterval { + guard sourceDuration > 0 else { return projectStartTime } + let sourceProgress = (sourceTime - sourceStartTime) / sourceDuration + return projectStartTime + sourceProgress * projectDuration + } +} diff --git a/JammLab/Resources/BasicPitchModel/cnn_contour_model.json b/JammLab/Resources/BasicPitchModel/cnn_contour_model.json new file mode 100644 index 0000000..50965f6 --- /dev/null +++ b/JammLab/Resources/BasicPitchModel/cnn_contour_model.json @@ -0,0 +1,10327 @@ +{ + "in_shape": [ + 1, + null, + 264, + 8 + ], + "layers": [ + { + "type": "conv2d", + "activation": "relu", + "shape": [ + 1, + null, + 264, + 8 + ], + "kernel_size_time": 3, + "kernel_size_feature": 39, + "dilation": 1, + "strides": 1, + "num_filters_in": 8, + "num_features_in": 264, + "num_filters_out": 8, + "padding": "same", + "weights": [ + [ + [ + [ + [ + 0.022235464304685593, + 0.12644557654857635, + -0.019513731822371483, + 0.008993071503937244, + 0.005676493048667908, + -0.03184245526790619, + -0.003874695161357522, + 0.0017621004953980446 + ], + [ + -0.05232696980237961, + 0.05170194432139397, + -0.006704402156174183, + 0.061710067093372345, + -0.003483690321445465, + -0.021386953070759773, + 0.004079383332282305, + -0.04041877016425133 + ], + [ + 0.013914952985942364, + 0.03777508810162544, + -0.00270700897090137, + 0.07291053235530853, + 0.02247735485434532, + -0.013676331378519535, + 0.0036198899615556, + 0.01919560693204403 + ], + [ + 0.004582306835800409, + -0.025379642844200134, + -0.02947649545967579, + -0.024576930329203606, + 0.15691761672496796, + -0.02018500491976738, + -0.007045423146337271, + 0.01869312860071659 + ], + [ + -0.025012051686644554, + -0.041520364582538605, + 0.04374866560101509, + -0.03835153579711914, + -0.025467531755566597, + -0.002976842690259218, + -0.008783360943198204, + 0.060937389731407166 + ], + [ + 0.003583863377571106, + -0.02184070274233818, + -0.002791644772514701, + 0.05034444108605385, + 0.013469302095472813, + -0.012055132538080215, + -0.006561734713613987, + 0.006368257571011782 + ], + [ + -0.016420934349298477, + -0.029597068205475807, + -0.045799996703863144, + -0.023617858067154884, + 0.0018877382390201092, + -0.017183998599648476, + -0.0007590560126118362, + -0.0063958303071558475 + ], + [ + -0.037002015858888626, + -0.03119487129151821, + 0.0033363052643835545, + -0.05453155189752579, + -0.008176961913704872, + 0.01803756132721901, + 0.002405173610895872, + 0.07108523696660995 + ] + ], + [ + [ + 0.015560653991997242, + -0.028215713798999786, + -0.01019179169088602, + -0.006182027980685234, + 0.042752284556627274, + 0.00378150655888021, + -0.006398215889930725, + -0.006785248406231403 + ], + [ + -0.017630990594625473, + 0.03120465762913227, + 0.005011255387216806, + 0.0847846046090126, + -0.007034486159682274, + 0.004546181298792362, + 0.003564009442925453, + -0.040373120456933975 + ], + [ + 0.03380727767944336, + 0.00465942919254303, + -0.04390568286180496, + 0.02688531018793583, + 0.0508088655769825, + -0.028628448024392128, + -0.0012356945080682635, + -0.01194258127361536 + ], + [ + 0.029846712946891785, + -0.01329704187810421, + -0.019763626158237457, + 0.07735968381166458, + 0.1271095722913742, + 0.02257220260798931, + -0.002953483024612069, + -0.013235040009021759 + ], + [ + -0.0010791976237669587, + -0.0008485896978527308, + 0.01629459299147129, + 0.004993936512619257, + -0.0030903357546776533, + -0.001869024010375142, + 0.003238455858081579, + 0.03629472479224205 + ], + [ + -0.0013478194596245885, + -0.01382285077124834, + -0.01214813906699419, + 0.030711371451616287, + 0.05905970185995102, + 0.010752944275736809, + 0.000265252310782671, + -0.023287836462259293 + ], + [ + -0.0010589660378172994, + -0.0281875841319561, + -0.018244905397295952, + 0.06000158190727234, + 0.06102447956800461, + -0.01336828526109457, + -0.0006791662890464067, + -0.01892756298184395 + ], + [ + -0.03647073358297348, + -0.008094938471913338, + -0.0029176692478358746, + -0.05202382057905197, + 0.04304306209087372, + 0.008528396487236023, + 0.008362235501408577, + -0.04738091677427292 + ] + ], + [ + [ + -0.016823263838887215, + -0.004366897977888584, + -0.01823221705853939, + -0.037581443786621094, + 0.02694634348154068, + -0.017024731263518333, + 0.003985974472016096, + 0.0018107679206877947 + ], + [ + -0.011843329295516014, + 0.07504546642303467, + -0.01685096137225628, + 0.012750407680869102, + -0.022838294506072998, + 0.005926860496401787, + 0.0025199870578944683, + -0.0424792654812336 + ], + [ + 0.011060439981520176, + 0.058556199073791504, + -0.019469786435365677, + 0.036385055631399155, + 0.013489220291376114, + 0.0001548125728731975, + 0.0025923089124262333, + -0.004607853014022112 + ], + [ + 0.027755344286561012, + 0.029301518574357033, + 0.02607894130051136, + -0.0007426803931593895, + 0.047103673219680786, + 0.029597340151667595, + -0.0028491104021668434, + 0.03242543712258339 + ], + [ + -0.01581093668937683, + -0.016657091677188873, + 0.02387949638068676, + -0.009551185183227062, + -0.08178254216909409, + -0.006872786208987236, + 0.006394826341420412, + 0.10345522314310074 + ], + [ + -0.00016978765779640526, + -0.025133000686764717, + 0.01541024912148714, + -0.07947726547718048, + 0.00773949921131134, + 0.023387834429740906, + 0.00045220874017104506, + 0.04416127875447273 + ], + [ + 0.009047816507518291, + -0.006677203346043825, + 0.038462236523628235, + -0.05021427571773529, + 0.031809575855731964, + 0.004782309755682945, + -0.0027064906898885965, + -0.008594758808612823 + ], + [ + -0.013260701671242714, + -0.018810201436281204, + 0.011797698214650154, + 0.029345015063881874, + -0.023170992732048035, + 0.024784306064248085, + 0.007895532064139843, + -0.018747635185718536 + ] + ], + [ + [ + 0.0057707056403160095, + -0.0204930417239666, + 0.002769286511465907, + 0.010132224299013615, + 0.02334810607135296, + -0.010387936607003212, + -0.0006680868100374937, + 0.002129195723682642 + ], + [ + -0.013970589265227318, + -0.03278077766299248, + 0.010115734301507473, + 0.014573562890291214, + 0.002545877592638135, + -0.0030834111385047436, + -0.0009585557272657752, + -0.012784413993358612 + ], + [ + -0.0007548778085038066, + -0.06416552513837814, + -0.026276277378201485, + 0.060121145099401474, + -0.028378328308463097, + -0.05593034252524376, + 0.0012310013407841325, + -0.05229663476347923 + ], + [ + 0.033074457198381424, + 0.035842038691043854, + -0.014351144433021545, + 0.01621762476861477, + 0.0057068620808422565, + -0.012334870174527168, + -0.004315447062253952, + -0.010443567298352718 + ], + [ + -0.03354040905833244, + 0.022786710411310196, + 0.02577042579650879, + -0.02929891273379326, + -0.07407773286104202, + 0.014297251589596272, + 0.011030596680939198, + 0.02959544211626053 + ], + [ + -0.02282162569463253, + -0.005241031292825937, + -0.017921118065714836, + 0.008651603013277054, + 0.019511127844452858, + -0.0030766159761697054, + -0.007739419117569923, + 0.01616954244673252 + ], + [ + 0.0031913078855723143, + 0.0009484397014603019, + -0.03610454872250557, + 0.03282289579510689, + 0.003820748534053564, + -0.013024115934967995, + 0.0011526633752509952, + -0.03325885906815529 + ], + [ + 0.027511175721883774, + 0.0029972747433930635, + 0.00570986932143569, + -0.035369873046875, + -0.008223328739404678, + 0.023436594754457474, + -0.002204890362918377, + 0.03487518057227135 + ] + ], + [ + [ + 0.011303921230137348, + 0.028303783386945724, + 0.010019144043326378, + 0.02747066505253315, + -0.02193966880440712, + 0.0018709165742620826, + -0.006884337402880192, + -0.007487744092941284 + ], + [ + -0.003547257510945201, + -0.0032532508485019207, + 0.030139915645122528, + -0.04061159864068031, + -0.015734415501356125, + 0.015703555196523666, + -3.3762673410819843e-05, + 0.0008010396850295365 + ], + [ + 0.004342515487223864, + -0.022638238966464996, + 4.755840927828103e-05, + 0.058410074561834335, + -0.025339830666780472, + -0.04429657384753227, + 0.007314715534448624, + -0.019359422847628593 + ], + [ + 0.026940319687128067, + 0.04886886477470398, + -0.025590738281607628, + -0.00377338076941669, + 0.015572890639305115, + -0.018565692007541656, + -0.0016691256314516068, + -0.03703920915722847 + ], + [ + -0.04334361478686333, + -0.025176821276545525, + 0.07419151812791824, + -0.04973282292485237, + -0.07073139399290085, + -0.02166164480149746, + 0.013029152527451515, + -0.059011153876781464 + ], + [ + -0.039386872202157974, + 0.018117057159543037, + -0.00576524855569005, + -0.004947022069245577, + -0.039579689502716064, + 0.023693304508924484, + 0.002464504912495613, + 0.014489566907286644 + ], + [ + -0.015139085240662098, + 0.008358307182788849, + -0.024858159944415092, + 0.018372707068920135, + 0.03260691836476326, + 0.020735299214720726, + -0.003381146816536784, + 0.007735520601272583 + ], + [ + 0.00820154044777155, + -0.04142729938030243, + -0.025799978524446487, + -0.02855108678340912, + 0.03330245614051819, + 0.0038844163063913584, + -0.0030980417504906654, + -0.04071376472711563 + ] + ], + [ + [ + 0.007889635860919952, + 0.04295783489942551, + 0.0034598747733980417, + -0.05868241935968399, + 0.011131289415061474, + -0.011307686567306519, + 0.0051597352139651775, + 0.011460067704319954 + ], + [ + -0.01667891815304756, + 0.033943142741918564, + 0.0141826206818223, + -0.02169637754559517, + 0.025603437796235085, + 0.03426206856966019, + -0.0015753483166918159, + 0.005207948852330446 + ], + [ + 0.010059953667223454, + 0.002121220575645566, + -0.00618642196059227, + 0.02929786778986454, + 0.039950180798769, + 0.008554732427001, + -0.0004180255637038499, + 0.006468053907155991 + ], + [ + 0.010246681980788708, + 0.02913084626197815, + -0.003997581545263529, + -0.029581496492028236, + 0.0448671355843544, + -0.027189400047063828, + 0.005028913728892803, + 0.03533196076750755 + ], + [ + 0.034569788724184036, + 0.006752095650881529, + -0.0047640735283494, + -0.06725426763296127, + -0.032103702425956726, + 0.008698106743395329, + -0.00019600741507019848, + 0.044467389583587646 + ], + [ + -0.006730103399604559, + -0.02291121892631054, + -0.007513339165598154, + -0.04208074137568474, + -0.035711705684661865, + 0.011442085728049278, + -0.0021993762347847223, + 0.07475803047418594 + ], + [ + -0.0165804922580719, + -0.028416041284799576, + 0.03870989382266998, + -0.03871094807982445, + -0.012425223365426064, + 0.05496881902217865, + -0.005223952233791351, + 0.017976747825741768 + ], + [ + 0.0033240318298339844, + -0.018295997753739357, + -0.011653776280581951, + 0.05221997946500778, + -0.005206412635743618, + -0.010865059681236744, + -0.0013333753449842334, + -0.03887780383229256 + ] + ], + [ + [ + 0.01299725566059351, + -0.009790003299713135, + 0.010116975754499435, + -0.08255843073129654, + 0.008512875065207481, + -0.01789231412112713, + -0.003925927449017763, + 0.006162574049085379 + ], + [ + -0.0079413540661335, + -0.019605783745646477, + 0.021434606984257698, + -0.0029194799717515707, + -0.011883272789418697, + -0.017675170674920082, + 0.0019800704903900623, + -0.023192845284938812 + ], + [ + 0.03595408424735069, + -0.038897547870874405, + -0.0005803395179100335, + 0.025954095646739006, + 0.02673749066889286, + -0.011774351820349693, + -0.0026443200185894966, + -0.017563695088028908 + ], + [ + 0.009468981996178627, + 0.004766495898365974, + -0.012855788692831993, + -0.02593761868774891, + 0.04314328730106354, + -0.037367526441812515, + 0.00533562246710062, + -0.031118465587496758 + ], + [ + 0.00359335052780807, + -0.07114684581756592, + -0.0770656168460846, + -0.007933095097541809, + 0.05640508607029915, + -0.023698067292571068, + -0.0034948838874697685, + -0.011824805289506912 + ], + [ + -0.007358294911682606, + 0.0057081240229308605, + -0.008933493867516518, + 0.08766347914934158, + -0.015428909100592136, + 0.019965684041380882, + 0.004400032572448254, + -0.00037128786789253354 + ], + [ + 0.013578114099800587, + -0.011762567795813084, + -0.004543669056147337, + 0.024814430624246597, + -0.03604408726096153, + -0.012372205033898354, + -0.0006603982183150947, + 0.010370751842856407 + ], + [ + 0.018318068236112595, + -0.0069355713203549385, + 0.020939422771334648, + -0.02170470543205738, + -0.001145902439020574, + 0.010214881040155888, + -0.007656617555767298, + 0.01514099445194006 + ] + ], + [ + [ + -0.02564692497253418, + -0.0009123572381213307, + 0.024494672194123268, + -0.0028341023717075586, + -0.03667068108916283, + 0.0023433479946106672, + -0.0034248409792780876, + 0.013042906299233437 + ], + [ + -0.017497530207037926, + -0.02337179332971573, + 0.009679537266492844, + 0.01005761232227087, + -0.02555718459188938, + 0.024409744888544083, + -0.006808471865952015, + 0.0022560455836355686 + ], + [ + 0.044981662184000015, + 0.0038882421795278788, + 0.006299558561295271, + -0.004904119297862053, + -0.012430408969521523, + 0.019306616857647896, + -0.0014685897622257471, + -0.047424767166376114 + ], + [ + -0.00535705778747797, + 0.04303525388240814, + -0.01672915555536747, + 0.013650781475007534, + 0.01971958577632904, + -0.02712901122868061, + 0.0031558817718178034, + -0.09046825021505356 + ], + [ + -0.003289637388661504, + -0.02178281731903553, + -0.06271251291036606, + 0.04729741811752319, + 0.013853282667696476, + -0.00492807338014245, + -0.0020696590654551983, + -0.04912311211228371 + ], + [ + 9.613043221179396e-05, + -0.008868562988936901, + 0.04326125234365463, + 0.052340563386678696, + 0.027305399999022484, + -0.01956017315387726, + 0.005736886989325285, + -0.047495901584625244 + ], + [ + 0.006131057161837816, + 0.034303441643714905, + -0.0021111066453158855, + 0.034056104719638824, + -0.014085622504353523, + 0.02447618544101715, + -0.0025021263863891363, + 0.06804835051298141 + ], + [ + -0.025150826200842857, + -0.024552443996071815, + -0.007870230823755264, + -0.008334384299814701, + 0.004533487372100353, + -0.01332863699644804, + -0.0066953375935554504, + 0.009205751121044159 + ] + ], + [ + [ + -0.006551462225615978, + 0.011475191451609135, + -0.02238963358104229, + -0.05396297946572304, + -0.030397789552807808, + -0.018702758476138115, + -0.0031281281262636185, + 0.0005271499394439161 + ], + [ + -0.01701163686811924, + 0.0008293474675156176, + -0.00015612051356583834, + -0.0791376382112503, + -0.006719175260514021, + 0.018299249932169914, + 0.00018336280481889844, + -0.003697182983160019 + ], + [ + -0.017391664907336235, + -0.0120485695078969, + 0.041576217859983444, + -0.0493382103741169, + 0.013750803656876087, + -0.0041121309623122215, + -0.0033255063463002443, + 0.018538927659392357 + ], + [ + 0.00025515182642266154, + 0.0345531702041626, + -0.012106959708034992, + 0.006450527347624302, + -0.029608644545078278, + -0.02260645292699337, + 0.007478002924472094, + -0.004361065104603767 + ], + [ + 0.015987124294042587, + 0.011847319081425667, + 0.019011301919817924, + -0.020751236006617546, + 0.019520243629813194, + 0.002644637832418084, + -0.00025139813078567386, + 0.0424727201461792 + ], + [ + 0.027873557060956955, + 0.006367124617099762, + 0.030444661155343056, + 0.022303221747279167, + 0.010554761625826359, + 0.0338013619184494, + 0.00545452069491148, + 0.025910882279276848 + ], + [ + -0.027791636064648628, + -0.017398007214069366, + 0.035113804042339325, + -0.0086144944652915, + -0.01999053731560707, + 0.004517904948443174, + -0.0020812894217669964, + 0.05898110941052437 + ], + [ + -0.0097757987678051, + -0.03094254434108734, + -0.013558193109929562, + -0.053676143288612366, + 0.012116537429392338, + 0.008779252879321575, + 0.001232703449204564, + 0.027316709980368614 + ] + ], + [ + [ + -0.019064312800765038, + -0.032102763652801514, + -0.023698074743151665, + 0.026869015768170357, + -0.007107054814696312, + -0.01686258055269718, + 5.602967576123774e-05, + -0.0034729645121842623 + ], + [ + -0.039511580020189285, + -0.03923137113451958, + -0.029749397188425064, + 0.043385181576013565, + -0.010539100505411625, + -0.011326381005346775, + 0.004066178109496832, + -0.02529854327440262 + ], + [ + -0.024141840636730194, + -0.03681115433573723, + -0.017411483451724052, + 0.004290698561817408, + 0.07484297454357147, + -0.04703889042139053, + 0.002497951267287135, + -0.016598807647824287 + ], + [ + 0.030259234830737114, + -0.05595444142818451, + 0.03314133733510971, + 0.04178731143474579, + -0.0014475437346845865, + -0.023959040641784668, + 0.006222892086952925, + -0.003452085889875889 + ], + [ + 0.031579796224832535, + -0.019805708900094032, + -0.04957373067736626, + 0.0216908548027277, + 0.01818738505244255, + -0.004228613805025816, + -0.0005087238387204707, + -0.04097728058695793 + ], + [ + 0.021468600258231163, + -0.029785161837935448, + -0.04685544967651367, + -0.004856846295297146, + -0.001649131765589118, + -0.02552623301744461, + -0.003429814474657178, + -0.01705152913928032 + ], + [ + -0.02311214990913868, + 0.00046091637341305614, + 0.02002202719449997, + -0.04629921540617943, + -0.05296372249722481, + 0.0029424650128930807, + 0.006842109840363264, + -0.0407988615334034 + ], + [ + 0.0023608580231666565, + -0.0180065780878067, + -0.00627207662910223, + -0.0013127799611538649, + -0.009018034674227238, + 0.005110245198011398, + 0.003237388329580426, + 0.0329466387629509 + ] + ], + [ + [ + -0.01835530623793602, + -0.008089987561106682, + 0.003993176855146885, + 0.04339226707816124, + -0.031178642064332962, + -0.028623133897781372, + 0.0012194417649880052, + 0.005541378632187843 + ], + [ + -0.012605872005224228, + -0.030721288174390793, + -0.017791898921132088, + -0.02779308892786503, + -0.023006007075309753, + 0.025875940918922424, + 0.0005424357368610799, + -0.023963844403624535 + ], + [ + -0.0084352046251297, + 0.06838401407003403, + -0.04183843731880188, + 0.09145063161849976, + -0.004947497975081205, + -0.0034526053350418806, + 0.0006924367626197636, + -0.04278752580285072 + ], + [ + 0.0008905791328288615, + -0.003864163998514414, + 0.017941966652870178, + 0.034392647445201874, + -0.028962289914488792, + -0.02011922374367714, + 0.006482762284576893, + -0.03312624245882034 + ], + [ + 0.003818195080384612, + -0.010422424413263798, + -0.07099077850580215, + 0.024606801569461823, + -0.03701210394501686, + 0.00016984976537059993, + 0.0009947471553459764, + -0.09914976358413696 + ], + [ + 0.029687054455280304, + -0.016776321455836296, + -0.03506264090538025, + 0.04352445900440216, + 0.020676666870713234, + -0.033677052706480026, + 0.000619731203187257, + -0.006308916490525007 + ], + [ + 0.0007058251067064703, + -0.007873846217989922, + 0.010244021192193031, + -0.020188527181744576, + 0.029879268258810043, + -0.007714883890002966, + 0.004534406587481499, + 0.0005578184500336647 + ], + [ + 0.007710936013609171, + 0.02216540463268757, + -0.030730951577425003, + 0.041000768542289734, + -0.037250541150569916, + -0.012742152437567711, + 0.003823777660727501, + -0.00740682240575552 + ] + ], + [ + [ + -0.00702858017757535, + 0.005512475501745939, + -0.0235478263348341, + 0.02965281344950199, + -0.013506203889846802, + -0.012077094055712223, + 0.0023321250919252634, + 0.010860583744943142 + ], + [ + -0.013708779588341713, + 0.00023421405057888478, + 0.00047265092143788934, + -0.011336290277540684, + -0.0059189763851463795, + 0.03353799507021904, + -0.004360864404588938, + 0.00639130687341094 + ], + [ + 8.224845805671066e-05, + 0.03043152019381523, + 0.026983879506587982, + -0.02216101810336113, + -0.02136177383363247, + 0.020617762580513954, + -0.0012498976429924369, + 0.02961159497499466 + ], + [ + 0.008031469769775867, + -0.018099892884492874, + 0.023884059861302376, + -0.08260664343833923, + 0.0811632052063942, + 0.011863232590258121, + 0.0011160110589116812, + 0.025238581001758575 + ], + [ + 0.0017406046390533447, + -0.004376810975372791, + -0.019079366698861122, + -0.03884325921535492, + 0.01838478073477745, + -0.04414737597107887, + 0.0007696285028941929, + 0.007262398488819599 + ], + [ + 0.027545688673853874, + 0.023495176807045937, + 0.028669534251093864, + 0.01729307696223259, + 0.015200896188616753, + -0.007549470756202936, + -0.0002313519362360239, + 0.019949685782194138 + ], + [ + 0.0383465401828289, + -0.015054803341627121, + 0.0026421938091516495, + -0.0036642730701714754, + 0.03461287543177605, + 0.008846827782690525, + -0.002388979075476527, + 0.02814342826604843 + ], + [ + 0.003012412926182151, + -0.02310941554605961, + 0.04856410622596741, + 0.020769763737916946, + -0.03782738372683525, + 0.0015737027861177921, + 0.0017553620273247361, + -0.005003652535378933 + ] + ], + [ + [ + 0.0028403110336512327, + -0.0267125703394413, + -0.020615002140402794, + -0.003283717203885317, + -0.009698173962533474, + -0.030504990369081497, + 0.005806685891002417, + -0.006075989920645952 + ], + [ + -0.007253296207636595, + -0.04015545919537544, + 0.027508161962032318, + -0.015199803747236729, + -0.05051993578672409, + -0.004159131553024054, + 0.004413182381540537, + 0.01836898922920227 + ], + [ + -0.026632076129317284, + -0.07041507959365845, + 0.026808811351656914, + -0.016850048676133156, + -0.00822350475937128, + 0.0030515454709529877, + 0.0005790474824607372, + -0.020466642454266548 + ], + [ + 0.0018812237540259957, + -0.002007627161219716, + 0.011842492036521435, + -0.04964768514037132, + 0.07358335703611374, + -0.016321491450071335, + -0.008585081435739994, + -0.03084101527929306 + ], + [ + 0.005681124981492758, + -0.024501711130142212, + 0.015316341072320938, + 0.03402228280901909, + 0.01711939461529255, + -0.00587298022583127, + -0.00042709027184173465, + 0.019185518845915794 + ], + [ + 0.01424433570355177, + 0.019934706389904022, + -0.02005893550813198, + -0.0025457541923969984, + 0.007962919771671295, + -0.043680839240550995, + -0.0009455169201828539, + -0.017988944426178932 + ], + [ + 0.02490965835750103, + -0.0461127944290638, + -0.028151394799351692, + -0.022954236716032028, + -0.010462426580488682, + -0.00955620501190424, + -0.001648438978008926, + -0.024530455470085144 + ], + [ + 0.04222862049937248, + -0.021635083481669426, + 0.0189148411154747, + -0.01998710259795189, + -0.014566706493496895, + 0.01279832236468792, + -0.004455898888409138, + 0.007094039581716061 + ] + ], + [ + [ + -0.005113836843520403, + -0.03684377297759056, + -0.0056229704059660435, + 0.031198887154459953, + -0.030521210283041, + -0.019159968942403793, + 0.0024523038882762194, + -0.00649395352229476 + ], + [ + -0.013492259196937084, + -0.004579652566462755, + -0.0036230687983334064, + 0.0361771360039711, + -0.07502341270446777, + 0.0427078977227211, + -0.008125923573970795, + 0.025255661457777023 + ], + [ + 0.008091756142675877, + -0.0062435343861579895, + 0.0002125377650372684, + 0.03751135617494583, + -0.06228489428758621, + 0.017414934933185577, + -0.0024647319223731756, + -0.03216655179858208 + ], + [ + 0.0014933438505977392, + 0.03805873915553093, + -0.012956496328115463, + 0.05355922132730484, + -0.007566344924271107, + -0.0023036671336740255, + 0.0013013840653002262, + -0.040997155010700226 + ], + [ + 0.00970747321844101, + 0.008139340206980705, + 0.007930705323815346, + -0.0058319540694355965, + -0.027623048052191734, + -0.004362271632999182, + 0.0018949653021991253, + -0.010745068080723286 + ], + [ + 0.009179162792861462, + 0.014367690309882164, + -0.018432362005114555, + -0.009120112285017967, + -0.0010850197868421674, + -0.014168069697916508, + 0.0014544581063091755, + -0.0019432518165558577 + ], + [ + 0.012165888212621212, + 0.014038724824786186, + -0.005503388121724129, + 0.06495963037014008, + 0.014887501485645771, + -0.011752082966268063, + 0.001974117709323764, + -0.0365934818983078 + ], + [ + 0.018843118101358414, + -0.03378033638000488, + -0.06614726036787033, + -0.03885936364531517, + -0.016586733981966972, + 0.004830543417483568, + -0.0008090520277619362, + -0.02722693793475628 + ] + ], + [ + [ + 0.011096267029643059, + 0.002463543089106679, + -0.03369567543268204, + 0.025326287373900414, + -0.017030129209160805, + -0.025938833132386208, + -0.0005355315515771508, + -0.002528565935790539 + ], + [ + -0.07193358987569809, + 0.04789124056696892, + 0.03699028864502907, + 0.016608674079179764, + -0.05257345736026764, + 0.04768119379878044, + -0.003883429802954197, + 0.07116680592298508 + ], + [ + -0.021404290571808815, + 0.04720957577228546, + 0.03245756775140762, + -0.018813764676451683, + -0.0671902447938919, + 0.0338742733001709, + 0.002387960208579898, + 0.07454796135425568 + ], + [ + -0.0008500116528011858, + -0.011500389315187931, + -0.0018730086740106344, + 0.024664754047989845, + 0.02834327705204487, + 0.02641095593571663, + -0.00326456013135612, + 0.015561754815280437 + ], + [ + 0.02743368037045002, + -0.013530661351978779, + 0.021766429767012596, + -0.041475217789411545, + 0.05833788216114044, + 0.0037718508392572403, + -0.0006826737080700696, + 0.018615471199154854 + ], + [ + 0.009515209123492241, + -0.02395343966782093, + 0.028370752930641174, + -0.05109116807579994, + 0.04538363218307495, + -0.010927025228738785, + -0.0038037593476474285, + -0.007539236918091774 + ], + [ + 0.017294980585575104, + 0.022014044225215912, + 0.024777600541710854, + -0.021518561989068985, + 0.05194985121488571, + 0.0011628282954916358, + -0.0026660540606826544, + -0.008232304826378822 + ], + [ + -0.02059284597635269, + -0.008858388289809227, + -0.04237817972898483, + 0.08289200067520142, + 0.017494162544608116, + -0.0339827835559845, + -0.00645774370059371, + -0.036064475774765015 + ] + ], + [ + [ + -0.0017936640651896596, + -0.024200834333896637, + -0.05882785841822624, + 0.0011657659197226167, + -0.010709168389439583, + -0.018474487587809563, + 0.005439652595669031, + -0.04056774079799652 + ], + [ + 0.04473930224776268, + -0.029290365055203438, + 0.07042510062456131, + -0.016189919784665108, + -0.10109858959913254, + 0.019782941788434982, + -0.005963423755019903, + 0.008998609147965908 + ], + [ + -0.04267789050936699, + -0.004337817896157503, + 0.029328102245926857, + 0.03771814703941345, + -0.09369296580553055, + -0.010162025690078735, + -0.0017721661133691669, + 0.06113213673233986 + ], + [ + -0.007319124415516853, + -0.0230509452521801, + 0.014186984859406948, + 0.024228116497397423, + 0.029913710430264473, + -0.037697162479162216, + 0.002515278523787856, + 0.026720639318227768 + ], + [ + -0.025196591392159462, + 0.025278287008404732, + -0.014730632305145264, + 0.01803640089929104, + 0.0659201368689537, + -0.021524703130126, + -0.0030718576163053513, + -0.0018939422443509102 + ], + [ + 0.025813410058617592, + 0.004824167583137751, + 0.0013664207654073834, + 0.032371409237384796, + 0.04336687922477722, + -0.02109353430569172, + -0.0016540114302188158, + 0.0020546591840684414 + ], + [ + -0.004435519687831402, + -0.005118674132972956, + -0.010773041285574436, + 0.019072482362389565, + 0.009197943843901157, + -0.0033990442752838135, + -0.007563642226159573, + 0.011976007372140884 + ], + [ + 0.03284922242164612, + 0.01039752084761858, + 0.006667858920991421, + -0.0034051823895424604, + 0.03333090618252754, + -0.031377729028463364, + -0.003084589494392276, + 0.024296998977661133 + ] + ], + [ + [ + 0.030148455873131752, + -0.00864435639232397, + -0.05375289544463158, + -0.014680670574307442, + -0.020796896889805794, + -0.010513050481677055, + -0.0016474747098982334, + -0.06651037931442261 + ], + [ + 0.09882839769124985, + 0.02703351341187954, + 0.1489020735025406, + -0.08214478939771652, + -0.10652537643909454, + 0.07616814970970154, + 0.0035422558430582285, + 0.12067253887653351 + ], + [ + -0.00834409799426794, + 0.031742554157972336, + 0.018161652609705925, + -0.03539811447262764, + -0.08460931479930878, + 0.03173321112990379, + -0.0017724111676216125, + 0.10564067959785461 + ], + [ + 0.02007751353085041, + 0.0284567903727293, + 0.015325553715229034, + 0.05747886374592781, + -0.025592749938368797, + -0.0034981160424649715, + 0.010967481881380081, + -0.003012916771695018 + ], + [ + -0.03078330121934414, + 0.014911814592778683, + 0.0014165197499096394, + 0.027587739750742912, + 0.02573663927614689, + 0.019114622846245766, + 0.0007500678184442222, + -0.006231146864593029 + ], + [ + 0.030661262571811676, + 0.023174811154603958, + 0.0031534628942608833, + 0.015078706666827202, + 0.021301664412021637, + -0.023839561268687248, + 0.005871518049389124, + 0.042406920343637466 + ], + [ + -0.02105780318379402, + -0.028779448941349983, + -0.025709429755806923, + -0.0004717730334959924, + 0.018080782145261765, + -0.0354524701833725, + 0.006008810829371214, + -0.007720983121544123 + ], + [ + 0.05429144576191902, + -0.008666365407407284, + -0.03551860526204109, + 0.009427406825125217, + 0.02285725623369217, + -0.017079509794712067, + 0.00026889072614721954, + 0.02496388368308544 + ] + ], + [ + [ + 0.02781885489821434, + 0.0018768343143165112, + -0.039836522191762924, + -0.021861424669623375, + -0.023211324587464333, + -0.006453522946685553, + 0.004141750745475292, + -0.09007439017295837 + ], + [ + 0.004982838407158852, + 0.007989739067852497, + 0.08537696301937103, + -0.13103286921977997, + -0.13559892773628235, + -0.0731678158044815, + 0.0013012838317081332, + 0.15000535547733307 + ], + [ + -0.038516364991664886, + -0.03565213829278946, + 0.0013591994065791368, + -0.0613744743168354, + -0.05812767520546913, + -0.042250294238328934, + 0.007330593187361956, + 0.14563700556755066 + ], + [ + 0.0051372176967561245, + -0.005017885006964207, + -0.011037653312087059, + -0.06429912894964218, + -0.010301020927727222, + -0.014054377563297749, + 0.013740983791649342, + 0.0676840990781784 + ], + [ + -0.014096032828092575, + -0.025397853925824165, + -0.0049273185431957245, + -0.04990721866488457, + 0.00751075753942132, + -0.010869694873690605, + -0.001473587704822421, + 0.05941850319504738 + ], + [ + -0.028614502400159836, + -0.0038576717488467693, + 0.02520683966577053, + -0.04103272035717964, + 0.028035597875714302, + 0.0010174746857956052, + -0.002698564203456044, + 0.05821256712079048 + ], + [ + -0.0054826391860842705, + 0.0010778383584693074, + -0.026636548340320587, + -0.014158876612782478, + 0.03178582713007927, + 0.01879614032804966, + 0.0029575773514807224, + 0.021603316068649292 + ], + [ + -0.004924132954329252, + -0.04520997032523155, + -0.02424447610974312, + -0.025678567588329315, + 0.03774625062942505, + -0.023272186517715454, + -0.001842218916863203, + 0.06028072163462639 + ] + ], + [ + [ + 0.029509631916880608, + -0.04376767948269844, + -0.03909436613321304, + 0.017614202573895454, + -0.06183529645204544, + -0.07199552655220032, + -0.00214286963455379, + -0.03633756935596466 + ], + [ + -0.10305291414260864, + -0.04953385889530182, + 0.05717933177947998, + 0.012080973945558071, + -0.0004232772043906152, + -0.09002150595188141, + 0.020243467763066292, + 0.21153853833675385 + ], + [ + -0.01754043810069561, + -0.035948626697063446, + 0.013262792490422726, + 0.16174878180027008, + -0.0063409884460270405, + -0.0566931888461113, + 0.013227841816842556, + 0.06371674686670303 + ], + [ + -0.0080918213352561, + 0.015424764715135098, + 0.010038774460554123, + -0.061069078743457794, + -0.040020279586315155, + -0.027921613305807114, + 0.018687346950173378, + 0.018717996776103973 + ], + [ + 0.0190231092274189, + 0.00783687923103571, + -0.04061852768063545, + 0.05273864045739174, + 0.052126362919807434, + -0.02657187543809414, + 0.004607892595231533, + -0.0033029878977686167 + ], + [ + -0.0023713347036391497, + -0.007307725492864847, + 0.014031074941158295, + -0.020980075001716614, + 0.03876960650086403, + -0.014204996638000011, + 0.009711461141705513, + -0.04195787012577057 + ], + [ + 0.018701979890465736, + 0.010566899552941322, + -0.027094673365354538, + 0.08134369552135468, + -0.002072785748168826, + -0.028376508504152298, + 0.001953767379745841, + -0.03422284871339798 + ], + [ + -0.03244802728295326, + 0.01013082917779684, + 0.03250707685947418, + 0.009358251467347145, + 0.025600580498576164, + -0.02044057846069336, + -0.0010542672825977206, + 0.02102203108370304 + ] + ], + [ + [ + 0.017321303486824036, + -0.06413477659225464, + -0.06115972250699997, + 0.07949606329202652, + -0.04986269026994705, + -0.04505620896816254, + 0.0033408210147172213, + -0.014890485443174839 + ], + [ + -0.09125269949436188, + 0.07736203074455261, + 0.12280024588108063, + -0.023846304044127464, + 0.07942315191030502, + -0.11308924853801727, + 0.017987091094255447, + 0.025294525548815727 + ], + [ + -0.032439056783914566, + 0.006084774620831013, + 0.08589301258325577, + 0.10457293689250946, + 0.05005994439125061, + -0.07591217756271362, + 0.011012163944542408, + -0.08709149062633514 + ], + [ + -0.03284597396850586, + -0.030422713607549667, + 0.06616276502609253, + -0.08815494179725647, + -0.04062599316239357, + -0.03463836386799812, + 0.008589544333517551, + -0.06664149463176727 + ], + [ + -0.030295437201857567, + -0.02442793734371662, + 0.016200607642531395, + 0.03640361502766609, + -0.02871651016175747, + -0.02055424451828003, + 0.006568847224116325, + -0.04611688107252121 + ], + [ + 0.026517800986766815, + -0.01577404886484146, + 0.006866747979074717, + 0.02734300121665001, + -0.008837216533720493, + -0.006769601721316576, + 0.002073135692626238, + -0.020781852304935455 + ], + [ + 0.007285844534635544, + -0.016439635306596756, + 0.018294548615813255, + 0.05914950370788574, + -0.009468656964600086, + -0.0120975561439991, + 0.007334298919886351, + -0.007756736595183611 + ], + [ + 0.003266588319092989, + 0.01356316264718771, + 0.033725738525390625, + -0.0968233123421669, + 0.02488594688475132, + 0.01387367770075798, + 0.004182963166385889, + -0.07827442139387131 + ] + ], + [ + [ + -0.009028857573866844, + -0.040097612887620926, + -0.03335530683398247, + 0.031098786741495132, + -0.021318964660167694, + -0.035973504185676575, + 0.0021352949552237988, + -0.0055869463831186295 + ], + [ + -0.005789934657514095, + 0.16319429874420166, + 0.039049241691827774, + -0.08754780888557434, + 0.18935982882976532, + 0.07485946267843246, + 0.006714486982673407, + 0.0617864727973938 + ], + [ + 0.013323400169610977, + 0.08019065111875534, + 0.035635583102703094, + 0.026099583134055138, + 0.1721264123916626, + 0.050172895193099976, + 0.01221743505448103, + 0.057247281074523926 + ], + [ + 0.015249219723045826, + -0.01818089559674263, + -0.02721533179283142, + -0.056658387184143066, + 0.007047994993627071, + 0.01845673657953739, + 0.004721953067928553, + 0.020323367789387703 + ], + [ + 0.04382536560297012, + -0.019859984517097473, + 0.02667899988591671, + 0.034443777054548264, + 0.0021962022874504328, + 0.02478097751736641, + -0.0013193802442401648, + 0.0012128957314416766 + ], + [ + 0.037114907056093216, + -0.003309066640213132, + 0.005320486146956682, + -0.016965962946414948, + -0.026465080678462982, + 0.010018556378781796, + -0.0021883987355977297, + 0.01813485473394394 + ], + [ + 0.0456928014755249, + -0.011669783852994442, + 0.03657731041312218, + -0.01745733991265297, + -0.016790242865681648, + 0.02742769941687584, + 0.002379809506237507, + -0.004307745024561882 + ], + [ + 0.02736145816743374, + -0.007712895516306162, + -0.024750081822276115, + 0.02780979312956333, + 0.003106111893430352, + 0.003955588676035404, + -0.0009938975563272834, + 0.022406823933124542 + ] + ], + [ + [ + 0.006007181014865637, + -0.0793798640370369, + -0.022004736587405205, + 0.008776436559855938, + -0.006154397968202829, + -0.04735204204916954, + 0.003014405956491828, + 0.009456072002649307 + ], + [ + -0.042650096118450165, + -0.008920791558921337, + -0.04360422119498253, + -0.18445822596549988, + 0.24962477385997772, + -0.00669131800532341, + -0.0015378016978502274, + 0.054153140634298325 + ], + [ + -0.029509099200367928, + -0.024571465328335762, + -0.03434547409415245, + -0.07986897975206375, + 0.027085190638899803, + 0.002260953886434436, + -0.0012798354728147388, + -0.026897847652435303 + ], + [ + -0.00754946144297719, + -0.054637376219034195, + -0.08165226876735687, + -0.032315075397491455, + 0.04462827369570732, + -0.013978929258883, + 0.0009115959401242435, + -0.03236134722828865 + ], + [ + 0.012475861236453056, + -0.033302903175354004, + -0.046690307557582855, + -0.019278699532151222, + -0.005517739336937666, + -0.011918489821255207, + -0.0002506935561541468, + -0.029432734474539757 + ], + [ + 0.019501391798257828, + -0.03485596179962158, + -0.035716526210308075, + 0.02229304611682892, + -0.02720843069255352, + -0.009777804836630821, + -0.005110834259539843, + -0.03685935214161873 + ], + [ + 0.0030816690996289253, + -0.0034131009597331285, + -0.03789491206407547, + -0.06813221424818039, + -0.04504116624593735, + -0.009426170960068703, + -0.004116535652428865, + -0.019848033785820007 + ], + [ + 0.026778437197208405, + -0.033035676926374435, + -0.012619122862815857, + -0.04743068665266037, + 0.003595219226554036, + -0.007447108160704374, + -0.007843850180506706, + -0.0039643398486077785 + ] + ], + [ + [ + -0.0035392900463193655, + -0.005088335834443569, + -0.013706156983971596, + 0.04689578339457512, + 0.0019225148716941476, + -0.015270467847585678, + 0.0030583860352635384, + -0.004154577851295471 + ], + [ + 0.04130914434790611, + -0.09355935454368591, + -0.08720480650663376, + 0.08506705611944199, + 0.1390412598848343, + 0.02402966283261776, + 0.0016013052081689239, + 0.010080354288220406 + ], + [ + -0.00943001452833414, + -0.030709968879818916, + -0.045670416206121445, + 0.033716700971126556, + -0.03822609409689903, + 0.02853790670633316, + -0.0007508274866268039, + -0.041246719658374786 + ], + [ + 0.0010999365476891398, + 0.007578269578516483, + -0.051765259355306625, + 0.09290412068367004, + 0.02115662954747677, + -0.0027912924997508526, + 0.0006841446156613529, + -0.06701391190290451 + ], + [ + 0.007051353342831135, + 0.0073605007492005825, + -0.026751937344670296, + 0.037574686110019684, + -0.02326788194477558, + -0.010569948703050613, + 0.002994181588292122, + -0.01891464740037918 + ], + [ + -0.011359039694070816, + 0.0010105830151587725, + -0.0070452215149998665, + -0.001919457339681685, + -0.005338813178241253, + -0.02818641997873783, + -0.0017427279381081462, + -0.042424026876688004 + ], + [ + -0.016179488971829414, + -0.005342352669686079, + -0.028760675340890884, + 0.0002650187525432557, + -0.02017773501574993, + -0.02394545078277588, + -0.0014888664009049535, + -0.020623493939638138 + ], + [ + 0.010845501907169819, + -0.03710756078362465, + -0.04581858962774277, + 0.0009257964557036757, + -0.05303311347961426, + -0.012522363103926182, + 0.002940493170171976, + 0.0012283353134989738 + ] + ], + [ + [ + -0.01361575722694397, + 0.001788036897778511, + -0.008100580424070358, + -0.032479602843523026, + 0.0002521513670217246, + -0.017857279628515244, + -0.0006145825027488172, + -0.007156998384743929 + ], + [ + -0.009482594206929207, + 0.03651123121380806, + -0.0007460868218913674, + -0.09659106284379959, + 0.09153319150209427, + 0.04600735008716583, + -0.006763688288629055, + 0.01022733561694622 + ], + [ + -0.008568613789975643, + 0.019808340817689896, + 0.031919874250888824, + -0.08951947093009949, + -0.02277739904820919, + 0.021183816716074944, + 0.001014410168863833, + -0.004451190121471882 + ], + [ + 0.016587965190410614, + 0.03938861936330795, + 0.03249772638082504, + 0.01705648936331272, + 0.023173844441771507, + -0.0032108186278492212, + -0.0023149875923991203, + 0.018422551453113556 + ], + [ + 0.004334042780101299, + 0.02475845254957676, + 0.03137379139661789, + -0.05592537671327591, + 0.004248801153153181, + 0.002905499655753374, + 0.0012183854123577476, + -0.00802667997777462 + ], + [ + 0.024244964122772217, + 0.007999448105692863, + 0.030570337548851967, + -0.051721133291721344, + 0.04026414453983307, + -0.01367291808128357, + 0.0007309718057513237, + 0.025082049891352654 + ], + [ + 0.017571832984685898, + 0.042426206171512604, + 0.0202243123203516, + 0.04903385788202286, + 0.010459869168698788, + -0.017010398209095, + 0.0021308534778654575, + 0.00589166721329093 + ], + [ + -0.011219949461519718, + 0.03778315335512161, + 0.004707208834588528, + -0.009205994196236134, + -0.014284570701420307, + -0.0016406916547566652, + -0.0006578245083801448, + 0.046569060534238815 + ] + ], + [ + [ + -0.016376545652747154, + -0.039754290133714676, + -0.021503880620002747, + 0.05352792888879776, + -0.014503497630357742, + -0.0036725373938679695, + 0.0012732043396681547, + -0.026181170716881752 + ], + [ + -0.03353780135512352, + -0.03943168371915817, + -0.030919436365365982, + 0.03982216492295265, + 0.03917445242404938, + 0.0021502685267478228, + -0.006050342693924904, + 0.007355798967182636 + ], + [ + 0.013333536684513092, + -0.010897179134190083, + -0.03783715143799782, + -0.015298279002308846, + -0.021706996485590935, + 0.014799977652728558, + 0.0021620572078973055, + -0.035996370017528534 + ], + [ + 0.022118808701634407, + -0.007659084163606167, + -0.05516528710722923, + 0.06702879816293716, + 0.03846999257802963, + -0.02222575806081295, + -0.004068519454449415, + -0.06001220643520355 + ], + [ + 0.012962407432496548, + 0.01151991356164217, + -0.04321752116084099, + -0.027355166152119637, + 0.01429521944373846, + -0.03863951191306114, + -0.001678523258306086, + -0.03282380849123001 + ], + [ + -0.0282405037432909, + -0.007044041529297829, + -0.017288517206907272, + -0.042548295110464096, + -0.019121864810585976, + -0.004836145788431168, + -0.0066246348433196545, + 0.0052515179850161076 + ], + [ + 0.057624977082014084, + 0.007601036224514246, + -0.015514180064201355, + -0.008143983781337738, + -0.054190970957279205, + 0.01489365752786398, + 0.0017100468976423144, + 0.020674340426921844 + ], + [ + -0.026540720835328102, + -0.016407759860157967, + -0.007989992387592793, + -0.0634397566318512, + 0.01567765325307846, + -0.007900838740170002, + -0.0031799122225493193, + 0.05374807491898537 + ] + ], + [ + [ + 0.005898910108953714, + -0.021104956045746803, + -0.011627387255430222, + 0.004473726265132427, + -0.0006428448250517249, + 0.004197260364890099, + -0.001953550847247243, + -0.011679264716804028 + ], + [ + 0.0003372178180143237, + -0.03319251537322998, + -0.02542107366025448, + -0.021117208525538445, + 0.018732953816652298, + 0.03264530748128891, + -0.004858957603573799, + -0.012720385566353798 + ], + [ + -0.004182827193289995, + 0.007232206407934427, + -0.022011617198586464, + -0.01774243265390396, + -0.08121871948242188, + 0.014032304286956787, + 0.004277226980775595, + -0.04607727378606796 + ], + [ + -0.0038525015115737915, + 0.004936723504215479, + -0.0818343311548233, + 0.03130481392145157, + -0.007637481205165386, + -0.012133276090025902, + -0.0006358051323331892, + -0.11784104257822037 + ], + [ + -0.0012929674703627825, + 0.014758731238543987, + -0.02809973433613777, + 0.030513808131217957, + 0.011991468258202076, + 0.0024115913547575474, + -0.005955506581813097, + -0.017024915665388107 + ], + [ + -0.03182581439614296, + -0.001860841060988605, + 0.00029695293051190674, + 0.02498752251267433, + -0.010670364834368229, + 0.01328130904585123, + -0.0016839468153193593, + 0.0064654164016246796 + ], + [ + -0.005964308511465788, + -0.05137510597705841, + -0.011904079467058182, + 0.02796851098537445, + -0.0074960519559681416, + -0.013788249343633652, + 0.005681382026523352, + 0.07679128646850586 + ], + [ + 0.0052648624405264854, + 0.02194236032664776, + -0.04722492769360542, + 0.09563226997852325, + 0.009540356695652008, + -0.0015426736790686846, + -0.0037380224093794823, + -0.06985487043857574 + ] + ], + [ + [ + 0.013142564333975315, + 0.01750161498785019, + 0.004132880829274654, + 0.021695256233215332, + -0.01852998323738575, + 0.012978342361748219, + -0.007398843299597502, + 0.009055987000465393 + ], + [ + -0.00022947683464735746, + 0.031463831663131714, + 0.0047997054643929005, + -0.018824033439159393, + -0.015892844647169113, + 0.038359083235263824, + -0.005327050108462572, + 0.02625974640250206 + ], + [ + -0.024713359773159027, + -0.02787996083498001, + 0.0026817938778549433, + -0.015474238432943821, + -0.01670076511800289, + -0.008748471736907959, + 0.000777386303525418, + 0.018672356382012367 + ], + [ + 0.005801113322377205, + -0.004271801561117172, + -0.01889893040060997, + 0.017575375735759735, + -0.010973130352795124, + -0.009562008082866669, + -0.0025658104568719864, + -0.01086603756994009 + ], + [ + -0.01657452993094921, + -0.018590329214930534, + 0.015404308214783669, + 0.0018109462689608335, + 0.015596186742186546, + -0.006940584629774094, + -0.0070718456991016865, + 0.008664987981319427 + ], + [ + -0.010375645942986012, + 0.010492287576198578, + -0.00039021397242322564, + -0.004761490970849991, + 0.01883499138057232, + 0.010639801621437073, + 0.0006980517646297812, + 0.01789085380733013 + ], + [ + -0.04415551945567131, + 0.015712881460785866, + 0.016951683908700943, + -0.01630944013595581, + -0.021096661686897278, + 0.025866353884339333, + 0.0005202155443839729, + 0.014025659300386906 + ], + [ + 0.0055330898612737656, + 0.009820445440709591, + -0.0020605018362402916, + 0.10360436886548996, + -0.019353630021214485, + -0.011858363635838032, + 0.002548510441556573, + -0.02645721659064293 + ] + ], + [ + [ + -0.002717643277719617, + -0.036024440079927444, + 0.008816132321953773, + -0.006945063825696707, + -0.010295652784407139, + -0.022920707240700722, + -0.0012536688009276986, + -0.029919981956481934 + ], + [ + -0.029353715479373932, + -0.04745062068104744, + 0.0001117979409173131, + 0.01932831108570099, + 0.008515988476574421, + -0.02462596260011196, + 0.005941751878708601, + -0.012018777430057526 + ], + [ + 0.007290070876479149, + -0.030545946210622787, + -0.02105436660349369, + 0.03764719516038895, + 0.026653477922081947, + 0.000675741583108902, + 0.006240263115614653, + -0.037685833871364594 + ], + [ + 0.011341961100697517, + -0.004436252638697624, + -0.008462370373308659, + 0.051884718239307404, + 0.012532705441117287, + -0.036423202604055405, + -2.9369535695877858e-05, + -0.01874753087759018 + ], + [ + 0.013416334055364132, + -0.02068285271525383, + -0.018824037164449692, + -0.047680772840976715, + -0.0015649598790332675, + -0.009696434251964092, + -0.0030544644687324762, + 0.0026201391592621803 + ], + [ + -0.011718332767486572, + 0.02899770997464657, + -0.03537032753229141, + 0.02893485687673092, + -0.010716930963099003, + 0.021876806393265724, + 0.009727503173053265, + -0.03550545871257782 + ], + [ + -0.004743734374642372, + 0.011317994445562363, + 0.007668473292142153, + -0.02359725721180439, + 0.0008648823131807148, + -0.001484819920733571, + 0.0028161718510091305, + -0.07707846909761429 + ], + [ + 0.04013708233833313, + -0.03157418593764305, + 0.0406864769756794, + -0.039632756263017654, + 0.039011646062135696, + 0.009789115749299526, + -0.0027834484353661537, + 0.027378682047128677 + ] + ], + [ + [ + 0.003992538899183273, + -0.024282312020659447, + 0.03521653637290001, + -0.03540008142590523, + -0.01548567321151495, + -0.009696461260318756, + -0.0005981716094538569, + 0.004261058289557695 + ], + [ + -0.011119147762656212, + -0.034465570002794266, + -0.0002346354303881526, + 0.01863187365233898, + -0.006425297819077969, + -0.005833946168422699, + 0.0016418659361079335, + -0.030070964246988297 + ], + [ + -0.009139573201537132, + 0.02249818667769432, + -0.05241279676556587, + -0.03413619101047516, + -0.03036988154053688, + 0.026807677000761032, + 0.0018601096235215664, + -0.09710799157619476 + ], + [ + -0.004022710025310516, + -0.0071505713276565075, + -0.009538015350699425, + 0.004058562219142914, + -0.011348055675625801, + 0.0010216138325631618, + -0.0007484802044928074, + -0.026296064257621765 + ], + [ + 0.014692412689328194, + 0.03385847806930542, + 0.0005839724908582866, + 0.017131293192505836, + -0.0238761268556118, + 0.006317678838968277, + -0.0033509472850710154, + 0.05711374804377556 + ], + [ + 0.009671634063124657, + -0.029059575870633125, + 0.01651710458099842, + -0.019757717847824097, + -0.016252974048256874, + 0.001204245607368648, + -0.00014389313582796603, + -0.03063022717833519 + ], + [ + 0.009695366956293583, + 0.003639927366748452, + -0.026176685467362404, + 9.860256977844983e-05, + 0.016065916046500206, + 0.003917505498975515, + -0.0009130636462941766, + 0.02246440015733242 + ], + [ + -0.015604650601744652, + -0.043048471212387085, + -0.02723853476345539, + -0.050969198346138, + 0.012202349491417408, + 0.0023514297790825367, + -0.00854506716132164, + -0.005383154843002558 + ] + ], + [ + [ + 0.00040157680632546544, + 0.02129259519279003, + 0.0015632190043106675, + -0.029113130643963814, + 0.002023383742198348, + -0.010433297604322433, + 0.0041716513223946095, + -0.018578924238681793 + ], + [ + -0.007128266151994467, + 0.03215425834059715, + -0.0017713323468342423, + -0.061824947595596313, + -0.0030295245815068483, + 0.02635316550731659, + 0.0011827173875644803, + -0.01399894431233406 + ], + [ + 0.0039141541346907616, + 0.001285251579247415, + -0.039359886199235916, + 0.038631074130535126, + 0.010466761887073517, + -0.020123396068811417, + 0.005446953233331442, + -0.0009450945071876049 + ], + [ + 0.013785341754555702, + -0.023904193192720413, + 0.01601436175405979, + -0.03224816545844078, + 0.0035403843503445387, + 0.0008099959813989699, + -0.002048494527116418, + 0.025419408455491066 + ], + [ + -0.02498799003660679, + 0.002362275728955865, + 0.03142847120761871, + 0.00295807933434844, + -0.059215985238552094, + 0.007850936613976955, + 0.0009248165297321975, + 0.04535813629627228 + ], + [ + 0.020599139854311943, + 0.003563855541869998, + 0.0458180233836174, + -0.012519598007202148, + -0.03569488972425461, + 0.0062444438226521015, + 0.0028903570491820574, + 0.008220741525292397 + ], + [ + 0.01271554920822382, + -0.014647772535681725, + -0.0025687296874821186, + -0.0044232383370399475, + 0.0376615896821022, + 0.007906519807875156, + -0.0064039090648293495, + 0.010460537858307362 + ], + [ + -0.012960635125637054, + 0.02727828361093998, + -0.025612957775592804, + 0.02819317765533924, + -0.0073761302046477795, + -0.006716197822242975, + -0.0018940508598461747, + 0.06702262163162231 + ] + ], + [ + [ + 0.02795885130763054, + -0.017546050250530243, + -0.018369439989328384, + 0.007331667002290487, + -0.020879579707980156, + -0.03534386307001114, + 0.006447501014918089, + -0.011274963617324829 + ], + [ + -0.0048421514220535755, + -0.020176386460661888, + 0.00019153962784912437, + 0.02562103420495987, + -0.02132178097963333, + -0.03351036459207535, + 0.004000373184680939, + 0.0018595217261463404 + ], + [ + 0.02697288990020752, + -0.0767933577299118, + -0.010822524316608906, + 0.05487346276640892, + 0.012983106076717377, + -0.027789926156401634, + -0.00029530294705182314, + -0.008136505261063576 + ], + [ + -0.031038224697113037, + 0.021298378705978394, + 0.0014218812575563788, + -0.0041955700144171715, + -0.01679360307753086, + -0.01858697459101677, + -0.0022203484550118446, + 0.017866455018520355 + ], + [ + -0.03574793413281441, + -0.0037247613072395325, + 0.005961978808045387, + -0.010485490784049034, + -0.005107740871608257, + -0.001208026777021587, + 0.008456452749669552, + -0.05146345868706703 + ], + [ + 0.004190330859273672, + -0.01197721529752016, + -0.05248004198074341, + -0.08276401460170746, + -0.04422162100672722, + -0.0030356368515640497, + -0.0020566072780638933, + -0.0397442989051342 + ], + [ + 0.01229606382548809, + -0.05192750319838524, + -0.04660769924521446, + 0.06353597342967987, + 0.0033752943854779005, + -0.009442253969609737, + -0.005564114078879356, + -0.012329289689660072 + ], + [ + 0.0015914865070953965, + -0.02677479013800621, + 0.04146946221590042, + -0.0036283221561461687, + -0.013002106919884682, + 0.006330444477498531, + 0.00013648658932652324, + 0.09749321639537811 + ] + ], + [ + [ + 0.02643367275595665, + 0.02376185730099678, + -0.011922935955226421, + 0.005670730024576187, + -0.0076800561510026455, + -0.007699334528297186, + 0.00301837339065969, + -0.0036921382416039705 + ], + [ + 0.027720674872398376, + -0.00912806112319231, + -0.028843892738223076, + 0.08797967433929443, + -0.02951275184750557, + -0.0008374552708119154, + -0.00025857469881884754, + -0.007879376411437988 + ], + [ + 0.03261328861117363, + -0.014485800638794899, + -0.010214618407189846, + 0.020525075495243073, + 0.011113720014691353, + 8.335912571055815e-05, + 0.00020430010044947267, + -0.04673580080270767 + ], + [ + -0.025927625596523285, + 0.006059521343559027, + 0.0061348797753453255, + -0.019206563010811806, + -0.028083648532629013, + 0.010304628871381283, + 0.004785127006471157, + 0.024735227227211 + ], + [ + -0.0017592982621863484, + -0.016162758693099022, + 0.00790207739919424, + -0.023530907928943634, + -0.011087433435022831, + 0.008505881763994694, + 0.00430923281237483, + -0.019721776247024536 + ], + [ + -0.029353003948926926, + 0.00043745801667682827, + -0.02994466759264469, + 0.02997434139251709, + -0.020244119688868523, + -0.03255278244614601, + -0.00010153645416721702, + -0.010196808725595474 + ], + [ + -0.000702035496942699, + 0.021152058616280556, + -0.0011077916715294123, + -0.01984836719930172, + -0.027556655928492546, + 0.012868592515587807, + -0.006037835963070393, + 0.049428585916757584 + ], + [ + 0.01930440589785576, + -0.011416634544730186, + -0.023621825501322746, + 0.022121071815490723, + -0.02976379729807377, + -0.006532140076160431, + 0.004992068279534578, + -0.058094002306461334 + ] + ], + [ + [ + 0.017499102279543877, + 0.04581628367304802, + 0.0277546513825655, + -0.055101994425058365, + 0.08537370711565018, + -0.01675495132803917, + -0.0023068739101290703, + 0.009317639283835888 + ], + [ + 0.026507090777158737, + 0.035204626619815826, + 0.023703113198280334, + -0.021988950669765472, + 0.041123177856206894, + 0.0034460797905921936, + -0.0044802455231547356, + 0.058641791343688965 + ], + [ + -0.004136473871767521, + 0.008640822023153305, + 0.029827358201146126, + -0.042657915502786636, + -0.014877286739647388, + 0.015233127400279045, + -0.002110511064529419, + 0.02700236067175865 + ], + [ + -0.01875213347375393, + -0.00935500580817461, + -0.010168123058974743, + -0.06148868799209595, + -0.05856400728225708, + 0.0038254116661846638, + 0.004355683457106352, + 0.06737526506185532 + ], + [ + 0.013973659835755825, + 0.02120240032672882, + 0.007393413223326206, + -0.037546057254076004, + 0.030450209975242615, + 0.011616700328886509, + 0.0024166982620954514, + 0.02868053875863552 + ], + [ + 0.01912948116660118, + 0.01965058408677578, + 0.024939265102148056, + 0.008952860720455647, + 0.007888119667768478, + -0.010222881101071835, + -0.0010882540373131633, + 0.029199235141277313 + ], + [ + -0.006467668805271387, + -0.017481500282883644, + 0.01144382357597351, + -0.007669669110327959, + 0.006638977210968733, + -0.012831605039536953, + -0.00134558929130435, + 0.05762423574924469 + ], + [ + 0.028997836634516716, + 0.023221764713525772, + -0.020027661696076393, + -0.04051118344068527, + -0.07320909202098846, + 0.008588583208620548, + -0.0006037681014277041, + -0.08158788830041885 + ] + ], + [ + [ + -0.01909785345196724, + -0.02059527486562729, + 0.04270008206367493, + -0.00409022718667984, + 0.03724062442779541, + -0.019208742305636406, + -0.003998613450676203, + 0.014020929113030434 + ], + [ + 0.00161431182641536, + -0.04245728254318237, + 0.019393235445022583, + 0.010053792968392372, + 0.031622759997844696, + -0.010624203830957413, + -0.005394468083977699, + -0.01526116207242012 + ], + [ + 0.0015528929652646184, + 0.027383308857679367, + -0.017225338146090508, + -0.05063651502132416, + -0.013734085485339165, + -0.018484890460968018, + -0.01100222859531641, + -0.031573336571455 + ], + [ + -0.011290663853287697, + -0.007710059639066458, + -0.039759259670972824, + 0.09833025932312012, + 0.0017567637842148542, + 0.015833085402846336, + 0.005532299634069204, + -0.01222904585301876 + ], + [ + 0.01389816589653492, + -0.04135885462164879, + -0.04369537532329559, + -0.06653688102960587, + -0.017426623031497, + -0.023743871599435806, + -0.0020522535778582096, + -0.045079223811626434 + ], + [ + 0.0713033601641655, + 0.015955312177538872, + -0.006646857131272554, + 0.033904120326042175, + -0.01123032160103321, + -0.0009381925920024514, + 0.0004132907197345048, + 0.04343848302960396 + ], + [ + 0.018393298611044884, + 0.026430154219269753, + -0.043365478515625, + 0.0781613439321518, + 0.007138947956264019, + -0.0360729917883873, + -0.0005375480395741761, + -0.04935665801167488 + ], + [ + 0.06291136890649796, + -0.017557917162775993, + 0.04341656714677811, + -0.05805842950940132, + -0.030563542619347572, + -0.017399705946445465, + -0.006310869473963976, + 0.05087970197200775 + ] + ], + [ + [ + 0.0004447382816579193, + -0.004386397078633308, + 0.008821114897727966, + 0.014038103632628918, + -0.012709015049040318, + 0.00034197387867607176, + -0.006953168660402298, + -0.01899830996990204 + ], + [ + 0.001578022143803537, + -0.02162407524883747, + 0.004388004541397095, + 0.024478347972035408, + -0.04258778691291809, + -0.00704857986420393, + -0.0036664544604718685, + -0.031404104083776474 + ], + [ + 0.007227383088320494, + 0.03463605418801308, + -0.018084025010466576, + 0.026621907949447632, + -0.045132603496313095, + -6.761773693142459e-05, + -0.004385700915008783, + -0.022471833974123 + ], + [ + -0.0052924384362995625, + -0.04149025306105614, + 0.023794282227754593, + 0.05458718538284302, + -0.015883678570389748, + -0.022904783487319946, + 0.010059360414743423, + -0.04729205369949341 + ], + [ + 0.014974558725953102, + 0.012797228991985321, + -0.037745311856269836, + -0.0233783982694149, + -0.02252015471458435, + -0.026103558018803596, + 0.0016079518245533109, + -0.017812492325901985 + ], + [ + -0.01446443796157837, + -0.04172385111451149, + -0.010515674948692322, + -0.031094802543520927, + -0.048948027193546295, + 0.010647624731063843, + 0.002482972340658307, + 0.08021999150514603 + ], + [ + 0.015158555470407009, + 0.007924109697341919, + -0.0021903349552303553, + 0.06867896020412445, + -0.0303651113063097, + -0.010243814438581467, + -0.003049481427296996, + -0.03381290286779404 + ], + [ + 0.0050307889468967915, + -0.07134716212749481, + -0.08423495292663574, + -0.013588003814220428, + -0.029606113210320473, + -0.013033577241003513, + -0.005898215342313051, + -0.017672071233391762 + ] + ], + [ + [ + 0.0060718427412211895, + -0.019854720681905746, + -0.013292793184518814, + -0.06251529604196548, + 0.022326845675706863, + 0.022029070183634758, + 0.0005851666210219264, + -0.014693544246256351 + ], + [ + -0.003233099589124322, + -0.02820943482220173, + 0.015005163848400116, + -0.04788457974791527, + 0.012241607531905174, + 0.04476936534047127, + -0.006349232979118824, + -0.01953512616455555 + ], + [ + -0.015739401802420616, + -0.001957777887582779, + 0.017164895310997963, + -0.022466007620096207, + -0.05795599892735481, + 0.021230001002550125, + -0.004921807441860437, + 0.044734254479408264 + ], + [ + 0.02614787593483925, + 0.0015169987455010414, + 0.02381114475429058, + -0.04412663355469704, + 0.015300032682716846, + 0.03616116940975189, + 0.00460527278482914, + 0.021092327311635017 + ], + [ + 0.020666327327489853, + 0.020618796348571777, + 0.026991989463567734, + 0.015402701683342457, + -0.008411251939833164, + -0.005389300175011158, + -0.0008688889793120325, + 0.016048293560743332 + ], + [ + -0.04911161959171295, + 0.02179277315735817, + 0.03231910243630409, + -0.025327440351247787, + 0.0174326803535223, + -0.01584060862660408, + -0.000590043026022613, + 0.016375038772821426 + ], + [ + 0.017458723857998848, + -0.011067649349570274, + 0.04507347196340561, + 0.00236575398594141, + 0.017554206773638725, + 0.04458872228860855, + -0.0008350535063073039, + 0.02213863469660282 + ], + [ + -0.04372201859951019, + 0.03648972138762474, + -0.06983516365289688, + 0.0007637189701199532, + -0.07043685764074326, + -0.011675314977765083, + -0.0015686176484450698, + 0.13244615495204926 + ] + ], + [ + [ + 0.008428818546235561, + -0.09998466074466705, + 0.023613756522536278, + 0.004684499464929104, + 0.04319937154650688, + -0.0070672230795025826, + -0.001510395435616374, + 0.007011654786765575 + ], + [ + -0.017619138583540916, + -0.006482650991529226, + -0.015049690380692482, + 0.01865360140800476, + -0.07180187851190567, + -0.0236499160528183, + 0.0023413635790348053, + -0.03584384173154831 + ], + [ + -0.03128651902079582, + -0.027227528393268585, + 0.02612942084670067, + -0.003429725533351302, + -0.04747042432427406, + -0.007665604818612337, + -0.0062392158433794975, + 0.044083062559366226 + ], + [ + 0.01798432506620884, + -0.027103759348392487, + -0.03644976764917374, + -0.032621171325445175, + -0.032843101769685745, + -0.008617674000561237, + -0.0035885581746697426, + -0.025560695677995682 + ], + [ + -0.023069849237799644, + 0.0011161152506247163, + -0.02168533019721508, + 0.010652860626578331, + 0.026523571461439133, + -0.0016174552729353309, + -0.00341759342700243, + -0.003934325184673071 + ], + [ + 0.0012011175276711583, + 0.018595198169350624, + 0.01733183115720749, + -0.07200539857149124, + 0.03233800083398819, + 0.009580639190971851, + -0.0005684696370735765, + -0.08570310473442078 + ], + [ + 0.0011742967180907726, + -0.037803202867507935, + -0.05337223783135414, + -0.06499306112527847, + -0.015149539336562157, + -0.026007989421486855, + -0.004808143246918917, + 0.002303047338500619 + ], + [ + -0.02952693961560726, + -0.049518365412950516, + 0.013333001174032688, + -0.0021692330483347178, + 0.020110705867409706, + 0.008798555471003056, + -0.0033372354228049517, + 0.05487209931015968 + ] + ], + [ + [ + -0.0005591188673861325, + -0.05718311667442322, + 0.033161863684654236, + -0.046961646527051926, + -0.0003828643821179867, + 0.019626660272479057, + -0.004093860741704702, + 0.028527013957500458 + ], + [ + -0.012964743189513683, + -0.025845788419246674, + -0.019089512526988983, + -0.005850179120898247, + -0.11567653715610504, + 0.016433458775281906, + -0.005962203722447157, + -0.03472881764173508 + ], + [ + -0.0009482680470682681, + 0.024766510352492332, + 0.02017413079738617, + -0.02840499021112919, + -0.07204686105251312, + 0.030615687370300293, + 0.0061282869428396225, + 0.04537783935666084 + ], + [ + 0.014095732010900974, + -0.006632072851061821, + -0.01061874721199274, + 0.020387941971421242, + -0.04424198344349861, + -0.014970452524721622, + 0.004433169960975647, + -0.04411343112587929 + ], + [ + -0.030036643147468567, + -0.02357761189341545, + -1.3749807294516359e-05, + -8.057260856730863e-06, + -0.02115590125322342, + -0.004666578024625778, + 0.004630946088582277, + 0.023513352498412132 + ], + [ + 0.004898412618786097, + 0.0036397427320480347, + -0.022303957492113113, + 0.024766890332102776, + -0.01892733760178089, + 0.026814740151166916, + 0.00095053092809394, + 0.008640147745609283 + ], + [ + -0.010098660364747047, + 0.036478299647569656, + -0.025453345850110054, + 0.07485852390527725, + -0.023504871875047684, + -0.00878962129354477, + -0.0030162252951413393, + 0.052069999277591705 + ], + [ + 0.047721702605485916, + 0.015476119704544544, + -0.02184872142970562, + 0.04788801074028015, + -0.018688740208745003, + 0.001683799084275961, + -0.007366447243839502, + -0.14508022367954254 + ] + ], + [ + [ + -0.026537751778960228, + -0.05914111062884331, + 0.038982149213552475, + -0.07123607397079468, + 0.010244728066027164, + -0.010778295807540417, + -0.006107930559664965, + 0.0645059272646904 + ], + [ + -0.008812044747173786, + -0.017957916483283043, + -0.011636734940111637, + -0.004467382095754147, + -0.0408036895096302, + -0.013324531726539135, + -0.0055585759691894054, + 0.0115595031529665 + ], + [ + -0.020401332527399063, + -0.008152944967150688, + 0.022042738273739815, + -0.05620477348566055, + -0.0476926751434803, + 0.0033723320811986923, + -0.0011945049045607448, + 0.09105583280324936 + ], + [ + 0.02334972284734249, + 0.005365884397178888, + 0.024272071197628975, + -0.04905787482857704, + 0.026643693447113037, + 0.010946475900709629, + -0.003522598883137107, + 0.00029266157071106136 + ], + [ + -0.020140523090958595, + -0.0016408123774453998, + -0.0014707747614011168, + -0.01010986603796482, + -0.011081731878221035, + -0.014323420822620392, + 0.0012052619131281972, + 0.00971866026520729 + ], + [ + 0.022165920585393906, + -0.026754453778266907, + -0.014772986993193626, + 0.01649131067097187, + -0.00047961753443814814, + -0.024472001940011978, + -0.00929025188088417, + -0.004921439103782177 + ], + [ + -0.0057018818333745, + -0.007628202438354492, + 0.029892198741436005, + 0.007584621198475361, + 0.02746555581688881, + -0.008200138807296753, + 0.0011568913469091058, + 0.09321479499340057 + ], + [ + 0.004765355493873358, + 0.0012685843976214528, + -0.01205132994800806, + 0.08111895620822906, + -0.006965477950870991, + 0.019909130409359932, + -0.008540026843547821, + 0.029773404821753502 + ] + ] + ], + [ + [ + [ + 0.042998477816581726, + 0.19938364624977112, + 0.01489727757871151, + -0.029845448210835457, + 0.03243442624807358, + -0.0037655429914593697, + 0.0011453917250037193, + 0.040719110518693924 + ], + [ + -0.04034204035997391, + 0.1258695125579834, + 0.009282730519771576, + 0.04146720841526985, + -0.03710538521409035, + -0.01814665086567402, + 0.00977284274995327, + -0.0026151046622544527 + ], + [ + -0.006315178237855434, + 0.06932850927114487, + -0.0016915559535846114, + 0.017050879076123238, + 0.04116693139076233, + 0.010444620624184608, + 0.0006367245223373175, + 0.040617357939481735 + ], + [ + 0.02527259849011898, + -0.01996319182217121, + -0.029996467754244804, + -0.026180051267147064, + 0.16820059716701508, + -0.03049975447356701, + -0.0027326797135174274, + 0.0423969067633152 + ], + [ + -0.048929207026958466, + -0.04380697011947632, + 0.0038014117162674665, + 0.03389083966612816, + 0.0077115194872021675, + -0.007207234390079975, + -0.009458835236728191, + 0.041690509766340256 + ], + [ + -0.020313594490289688, + -0.02632625214755535, + -0.010308663360774517, + 0.07287666201591492, + -0.017852412536740303, + 0.0009790185140445828, + 0.0007506957626901567, + 0.018748553469777107 + ], + [ + -0.012823488563299179, + -0.022733047604560852, + -0.044957585632801056, + -0.029688259586691856, + 0.06076624244451523, + 0.009285208769142628, + 0.0037535973824560642, + -0.010971378535032272 + ], + [ + -0.02557508274912834, + -0.021146830171346664, + 0.047565117478370667, + -0.07057531923055649, + -0.008649416267871857, + 0.0014024502597749233, + 0.00015214273298624903, + 0.08306913822889328 + ] + ], + [ + [ + 0.010146784596145153, + 0.0345519483089447, + 0.022038588300347328, + 0.07622489333152771, + 0.04662046581506729, + 0.02388687990605831, + 0.003778307931497693, + 0.043019771575927734 + ], + [ + -0.00877960491925478, + 0.091257244348526, + -0.0039586266502738, + 0.029667379334568977, + -0.0013205945724621415, + -0.02074342779815197, + 0.0037162424996495247, + -0.014668748714029789 + ], + [ + 0.03760058805346489, + 0.047145336866378784, + -0.016808457672595978, + 0.08475124090909958, + 0.025039218366146088, + -0.004904455039650202, + 0.0043917507864534855, + 0.006390227936208248 + ], + [ + 0.019335780292749405, + -0.00991736724972725, + -0.0026827030815184116, + 0.10449156165122986, + 0.09388388693332672, + -0.0004804918135050684, + -0.005328092724084854, + 0.0004789171216543764 + ], + [ + 0.004947458393871784, + 0.013117589056491852, + 0.008636999875307083, + 0.0031920592300593853, + 0.04803544282913208, + 0.021251197904348373, + 0.002129462780430913, + 0.03787960112094879 + ], + [ + -0.004563733469694853, + -0.05002160370349884, + 0.010384531691670418, + 0.017230063676834106, + 0.003635741537436843, + 0.006658877246081829, + -0.0027939428109675646, + -0.01911754719913006 + ], + [ + -0.00056228949688375, + -0.05118267983198166, + -0.012451538816094398, + 0.03755904734134674, + 0.051179688423871994, + -0.006767935119569302, + 0.0023738050367683172, + -0.016169317066669464 + ], + [ + -0.04784543439745903, + -0.006650404538959265, + 0.013543469831347466, + -0.057491060346364975, + 0.010665916837751865, + 0.004435202572494745, + 0.005536895245313644, + -0.015831414610147476 + ] + ], + [ + [ + 0.00899673905223608, + 0.04667368158698082, + 0.0080463457852602, + 0.02453889325261116, + 0.06318219006061554, + -0.01538887619972229, + -0.00015053211245685816, + 0.050032973289489746 + ], + [ + -0.021342091262340546, + 0.10192017257213593, + -0.01473990362137556, + 0.08952081203460693, + -0.019976695999503136, + -0.003518846118822694, + 0.011244265362620354, + -0.020025739446282387 + ], + [ + 0.0273133534938097, + 0.09168317168951035, + -0.02468532882630825, + 0.019979795441031456, + 0.038684554398059845, + -0.0026693318504840136, + 0.005835226271301508, + -0.00032637614640407264 + ], + [ + 0.026978040114045143, + 0.028553511947393417, + 0.05166766047477722, + -0.08283241093158722, + 0.024588191881775856, + 0.00635948171839118, + 0.0007707785116508603, + 0.01992063783109188 + ], + [ + -0.020197950303554535, + -0.0034396497067064047, + 0.023127466440200806, + -0.05396741256117821, + -0.006124891806393862, + -0.013830358162522316, + 0.003929320722818375, + 0.09149187803268433 + ], + [ + -0.001936072134412825, + -0.041506119072437286, + 0.022493060678243637, + -0.07645458728075027, + 0.04316791892051697, + 0.021961789578199387, + -0.0004839620378334075, + 0.015350384637713432 + ], + [ + 0.02819751389324665, + -0.016644882038235664, + 0.023479336872696877, + -0.020696690306067467, + 0.019873103126883507, + 0.02722199819982052, + -0.005958935711532831, + -0.02184671349823475 + ], + [ + -0.0004636717203538865, + -0.016646409407258034, + -3.63886974810157e-05, + -0.035642389208078384, + -0.002334941178560257, + -0.0011401637457311153, + 0.00283991452306509, + -0.025397514924407005 + ] + ], + [ + [ + 0.020070921629667282, + 0.0289110466837883, + -0.0012013694504275918, + 0.05025898292660713, + 0.010643799789249897, + -0.005350594408810139, + 0.0027429889887571335, + 0.04382771626114845 + ], + [ + -0.019489560276269913, + 0.005677905865013599, + 0.0047510042786598206, + 0.10048939287662506, + -0.012338187545537949, + -0.0018468688940629363, + 0.0024690821301192045, + 0.02418486587703228 + ], + [ + -0.0187191404402256, + -0.02320234104990959, + -0.03108854964375496, + 0.07219633460044861, + -0.03695297613739967, + -0.07148773223161697, + 0.008526138961315155, + -0.03723624721169472 + ], + [ + 0.034574273973703384, + 0.05132600665092468, + -0.018545793369412422, + -0.0023505722638219595, + 0.008036565966904163, + 0.006616529077291489, + -0.00033168791560456157, + 0.003999536857008934 + ], + [ + -0.0639839693903923, + 0.018585868179798126, + 0.03743042051792145, + -0.04361371323466301, + -0.1389906406402588, + 0.0022773221135139465, + 0.019383033737540245, + 0.04425736889243126 + ], + [ + -0.05830403417348862, + 0.04491322487592697, + -0.013198145665228367, + -0.01967054232954979, + -0.005281790159642696, + 0.0017724739154800773, + -0.0007037022151052952, + -0.0010248369071632624 + ], + [ + -0.01653434894979, + 0.010560676455497742, + -0.032302118837833405, + -0.022391827777028084, + -0.010333656333386898, + -0.002979908837005496, + -0.001608734717592597, + -0.04419723525643349 + ], + [ + 0.018223127350211143, + 0.0009945192141458392, + 0.019003475084900856, + -0.025428587570786476, + 0.009895209223031998, + 0.032706085592508316, + 0.003396524814888835, + 0.021109573543071747 + ] + ], + [ + [ + 0.039966873824596405, + 0.03163120523095131, + 0.02498839609324932, + 0.03277754783630371, + 0.011409868486225605, + 0.005580452736467123, + -0.0008023420232348144, + 0.029606284573674202 + ], + [ + 0.003060384653508663, + 0.014347934164106846, + 0.029635343700647354, + 0.08225651830434799, + 0.0028218075167387724, + 0.014798951335251331, + 0.006548217963427305, + 0.010696595534682274 + ], + [ + -0.0027290477883070707, + -0.011024500243365765, + 0.006681413855403662, + 0.08051123470067978, + -0.008078908547759056, + -0.038818322122097015, + 0.007836900651454926, + -0.004556928761303425 + ], + [ + 0.04396064206957817, + 0.060399655252695084, + 0.007698867004364729, + 0.007841148413717747, + 0.027637818828225136, + -0.006317405495792627, + 0.003760657273232937, + -0.0010302637238055468 + ], + [ + -0.056850507855415344, + -0.025039900094270706, + 0.05937255918979645, + -0.02103959396481514, + -0.12152060121297836, + 0.0014400279615074396, + 0.009334187023341656, + -0.05901864916086197 + ], + [ + -0.055104948580265045, + 0.029785970225930214, + 0.015512790530920029, + -0.032713863998651505, + -0.0033829316962510347, + 0.03891250491142273, + -0.0031639481894671917, + 0.010717008262872696 + ], + [ + -0.0015849812189117074, + 0.020633162930607796, + -0.01592431031167507, + 0.02221294306218624, + -0.002160662319511175, + 0.00315401260741055, + -0.0017223904142156243, + -0.008813627064228058 + ], + [ + 0.0018570938846096396, + -0.058834005147218704, + -0.02788645587861538, + -0.052889540791511536, + 0.02528241090476513, + 0.00789792463183403, + -0.0019906964153051376, + -0.033881328999996185 + ] + ], + [ + [ + 0.026961592957377434, + 0.05391969159245491, + 0.012634225189685822, + 0.004973435774445534, + 0.023677218705415726, + 0.018059955909848213, + 0.0028578615747392178, + 0.01836898736655712 + ], + [ + 0.014194883406162262, + 0.07192608714103699, + 0.026228245347738266, + -0.0034124618396162987, + 0.00042242612107656896, + 0.029626239091157913, + -0.0035832813009619713, + 0.017860237509012222 + ], + [ + 0.01912047155201435, + 0.00485237454995513, + 0.01007548626512289, + -0.01254570484161377, + 0.0242884811013937, + -0.019539859145879745, + -0.0027030876372009516, + 0.03782839700579643 + ], + [ + 0.008771353401243687, + 0.043950509279966354, + 0.034593623131513596, + 0.01219031773507595, + 0.05664800852537155, + -0.03776297718286514, + 0.001415961072780192, + 0.042227424681186676 + ], + [ + 0.0055290814489126205, + 0.037210021167993546, + -0.011144105345010757, + -0.0547453835606575, + 0.011917514726519585, + 0.043971944600343704, + 0.006183322984725237, + 0.042700693011283875 + ], + [ + 0.0010990571463480592, + 0.012879887595772743, + 0.02371690794825554, + -0.020925790071487427, + -0.06379544734954834, + -0.002021254040300846, + 0.0029079867526888847, + 0.09720602631568909 + ], + [ + -0.022765284404158592, + -0.03909159451723099, + 0.04724951088428497, + -0.04943820834159851, + -0.01838153973221779, + 0.013652590103447437, + 0.00040995722520165145, + 0.016025453805923462 + ], + [ + 0.0012006252072751522, + -0.02362549677491188, + -0.0029725537169724703, + 0.010388168506324291, + -0.014519349671900272, + -0.030366774648427963, + 0.00099376926664263, + -0.04389309510588646 + ] + ], + [ + [ + 0.016804026439785957, + 0.02061847783625126, + 0.016981001943349838, + 0.03388063609600067, + -0.025866836309432983, + 0.013164502568542957, + -0.0013149222359061241, + 0.022166309878230095 + ], + [ + -0.012067471630871296, + 0.009525220841169357, + 0.019704284146428108, + -0.05160149186849594, + -0.002963688923045993, + -0.00016584074182901531, + 0.0017404468962922692, + 0.0024365398567169905 + ], + [ + 0.026040220633149147, + -0.027340088039636612, + -0.0015576438745483756, + 0.03623490780591965, + 0.006746015977114439, + -0.010310529731214046, + -0.0009047621279023588, + 0.007071762345731258 + ], + [ + 0.0027665847446769476, + 0.01873735338449478, + 0.005321215838193893, + -0.002172445645555854, + 0.04641091078519821, + -0.04755161330103874, + 0.004331229720264673, + -0.006594603415578604 + ], + [ + 0.007497329730540514, + -0.04636160656809807, + -0.0701950266957283, + -0.065707266330719, + 0.09320733696222305, + 0.027883345261216164, + -0.0049562412314116955, + -0.0032029172871261835 + ], + [ + -0.018624145537614822, + 0.015761859714984894, + 0.015330709517002106, + 0.0633082389831543, + -0.033996544778347015, + 0.00988477747887373, + 0.0016575015615671873, + 0.02046154998242855 + ], + [ + 0.01479823887348175, + -0.010843884199857712, + 0.010835022665560246, + -0.01854168064892292, + -0.050903692841529846, + -0.019758783280849457, + 0.005494390614330769, + -0.02036825753748417 + ], + [ + -0.0007188020972535014, + 0.01591777428984642, + 0.012740688398480415, + 0.04065856337547302, + -0.02491617016494274, + -0.004189751576632261, + 0.0020776137243956327, + 0.008516836911439896 + ] + ], + [ + [ + -0.0113237788900733, + 0.046003520488739014, + 0.013542743399739265, + 0.011191491037607193, + -0.0261113028973341, + 0.012981432490050793, + 0.00452449219301343, + 0.03824338689446449 + ], + [ + 0.0003946992219425738, + 0.022476086392998695, + 0.02478598989546299, + 0.04978647455573082, + -0.029387345537543297, + 0.019307676702737808, + -0.0028542685322463512, + 0.042179450392723083 + ], + [ + 0.037954576313495636, + -0.003447843249887228, + 0.019101785495877266, + -0.014221221208572388, + -0.01409358624368906, + 0.031001711264252663, + -0.0011146485339850187, + -0.010479996912181377 + ], + [ + -0.0009219914209097624, + 0.06213204190135002, + -0.020989956334233284, + 0.030223868787288666, + 0.013169931247830391, + -0.028489185497164726, + -0.0034090683329850435, + -0.06638463586568832 + ], + [ + 0.006640338804572821, + -0.01535496860742569, + -0.04293454438447952, + 0.03718996420502663, + 0.0022645913995802402, + -0.0035373622085899115, + -0.0005865826969966292, + -0.039046332240104675 + ], + [ + -0.02562563680112362, + -0.011415530927479267, + 0.03371668979525566, + 0.022444022819399834, + 0.004098269157111645, + -0.02864563837647438, + 0.008406173437833786, + -0.03900492191314697 + ], + [ + 0.015984928235411644, + 0.03573554754257202, + 0.01790614426136017, + 0.019627176225185394, + -0.022252874448895454, + 0.0029529232997447252, + -0.002007489325478673, + 0.05243372917175293 + ], + [ + -0.015516177751123905, + -0.023413406684994698, + -0.013292532414197922, + -0.030297962948679924, + -0.012633721344172955, + 0.020614078268408775, + 0.002953575225546956, + 0.004833463113754988 + ] + ], + [ + [ + 0.009538018144667149, + 0.06289735436439514, + -0.01042983029037714, + -0.06340009719133377, + -0.00039327831473201513, + -0.0018423472065478563, + 0.003112827194854617, + 0.01936090551316738 + ], + [ + -0.009032088331878185, + 0.06995902955532074, + 0.02044784650206566, + -0.001903949654661119, + -0.030952883884310722, + 0.019603507593274117, + -0.0047660935670137405, + 0.0418136790394783 + ], + [ + 0.014582008123397827, + 0.044685982167720795, + 0.04488970339298248, + -0.06523018330335617, + 0.011740508489310741, + 0.014156599529087543, + -0.006290786899626255, + 0.049392588436603546 + ], + [ + -0.012027175165712833, + 0.08577888458967209, + -0.017941320315003395, + 0.03519586846232414, + -0.040680624544620514, + -0.03207451105117798, + 0.0056480662897229195, + 0.007674936205148697 + ], + [ + 0.025097301229834557, + 0.02543996088206768, + 0.03178815171122551, + -0.06074165180325508, + 0.01626049540936947, + -0.0001887048128992319, + 0.0009878157870844007, + 0.05639766529202461 + ], + [ + 0.035954613238573074, + 0.02140561118721962, + 0.023585792630910873, + 0.029600488021969795, + 0.054056718945503235, + 0.02869025617837906, + 0.003914496395736933, + 0.027015024796128273 + ], + [ + -0.026777328923344612, + -0.017709435895085335, + 0.05295976251363754, + -0.013391369953751564, + -0.04332241788506508, + -0.0030386492144316435, + -0.0004162559343967587, + 0.06636087596416473 + ], + [ + -0.039115872234106064, + -0.034196462482213974, + 0.026665953919291496, + -0.06433174014091492, + -0.000949581153690815, + 0.026117784902453423, + -0.0012524885823950171, + 0.011681050062179565 + ] + ], + [ + [ + -0.002571266843006015, + 0.04995045065879822, + -0.0057260747998952866, + 0.024829132482409477, + -0.01279242429882288, + 0.003199429251253605, + -0.0006037906277924776, + 0.024502426385879517 + ], + [ + -0.021018562838435173, + 0.026878727599978447, + 0.009486324153840542, + 0.03302035853266716, + -0.03416866436600685, + 0.006650648545473814, + 0.005283081438392401, + 0.017746051773428917 + ], + [ + -0.02832367643713951, + 0.022198127582669258, + -0.0033807093277573586, + -0.07902909070253372, + 0.04812466353178024, + -0.017768217250704765, + 0.0003298724186606705, + 0.0051366486586630344 + ], + [ + 0.017035357654094696, + -0.02947331592440605, + 0.00851522572338581, + 0.042859531939029694, + -0.03827992081642151, + -0.027428632602095604, + 0.004149948246777058, + 0.015147535130381584 + ], + [ + 0.0344812236726284, + -0.02033172734081745, + -0.03038850985467434, + -0.014111828990280628, + 0.01449014712125063, + 0.016746273264288902, + -0.0061598848551511765, + -0.03445681557059288 + ], + [ + 0.02238285169005394, + -0.01930018700659275, + -0.033292267471551895, + -0.036732207983732224, + 0.010412262752652168, + -0.01256417203694582, + -0.00493326410651207, + -0.011485157534480095 + ], + [ + -0.013886249624192715, + -0.006918683182448149, + 0.013800827786326408, + -0.011365576647222042, + -0.031936995685100555, + 0.01813124306499958, + 0.0056534321047365665, + -0.019311513751745224 + ], + [ + -0.005504447501152754, + -0.0013594283955171704, + 0.03787052258849144, + -0.07605962455272675, + 0.001402215682901442, + 0.007047442253679037, + 0.006300472654402256, + 0.037195734679698944 + ] + ], + [ + [ + -0.00828264094889164, + 0.07036963850259781, + 0.0003257484931964427, + -0.001049395534209907, + 0.010908538475632668, + 0.005593464709818363, + 0.006677707191556692, + 0.03749193251132965 + ], + [ + 0.01259308960288763, + 0.043850336223840714, + -0.0025188755244016647, + 0.008874325081706047, + -0.03355869650840759, + 0.005296200048178434, + 0.0034398091956973076, + 0.006319589447230101 + ], + [ + 0.011704199016094208, + 0.13179051876068115, + -0.018410589545965195, + -0.023477021604776382, + 0.02908114530146122, + 0.010809099301695824, + -0.0005368026904761791, + -0.03635956719517708 + ], + [ + 0.031125012785196304, + -0.039942074567079544, + 0.0002608276845421642, + 0.06142652779817581, + -0.05349482223391533, + -0.01381279993802309, + 0.0031469478271901608, + -0.027409881353378296 + ], + [ + 0.013853168115019798, + -0.0031366576440632343, + -0.04405290260910988, + 0.03603782504796982, + 0.014451393857598305, + 0.0085670854896307, + 0.004178328905254602, + -0.0689389631152153 + ], + [ + 0.02643820457160473, + -0.02124784328043461, + 0.005207039415836334, + 0.048491086810827255, + -0.009045121259987354, + 0.007191753014922142, + 0.0032430486753582954, + -0.020145826041698456 + ], + [ + -0.018475763499736786, + -0.0050697047263383865, + -0.0007260540733113885, + -0.04368395358324051, + 0.0033189556561410427, + -0.0012115312274545431, + 0.00042882448178716004, + 0.008540024049580097 + ], + [ + 0.0044791605323553085, + 0.040423739701509476, + -0.01481938548386097, + 0.03726433217525482, + -0.019571032375097275, + 0.024565614759922028, + 0.006797021254897118, + 0.026549356058239937 + ] + ], + [ + [ + 0.007746933493763208, + 0.056808289140462875, + -0.005207301117479801, + -0.03707142546772957, + 0.039069220423698425, + 0.019477857276797295, + 0.0073922621086239815, + 0.04113610088825226 + ], + [ + -0.023684266954660416, + 0.027577463537454605, + 0.0378289632499218, + -0.058611877262592316, + -0.01102469488978386, + 0.042337920516729355, + 0.0014399635838344693, + 0.024107933044433594 + ], + [ + 0.014254063367843628, + 0.06996475905179977, + 0.015493032522499561, + -0.049844928085803986, + 0.0011613949900493026, + 0.023808522149920464, + 6.323729030555114e-05, + 0.03544863685965538 + ], + [ + -0.005065315403044224, + -0.031090831384062767, + 0.00793821457773447, + -0.08254893869161606, + 0.0321129709482193, + 0.022511335089802742, + 0.00014679548621643335, + 0.029102405533194542 + ], + [ + 0.012182687409222126, + 0.04284684360027313, + 0.010305166244506836, + 0.04678845778107643, + -0.0276811346411705, + -0.016175610944628716, + -0.0015977296279743314, + 0.014714711345732212 + ], + [ + 0.025197992101311684, + 0.013558083213865757, + 0.04277787357568741, + -0.03293780982494354, + 0.010377153754234314, + -0.0076436568051576614, + -0.0003958510351367295, + -0.00601566256955266 + ], + [ + 0.030342647805809975, + 0.003829934634268284, + 0.015271480195224285, + 0.02839452028274536, + 0.043836578726768494, + 0.02121633291244507, + 0.0012770594330504537, + 0.02361530251801014 + ], + [ + -0.010236679576337337, + -0.027590947225689888, + 0.04457877576351166, + -0.003556647337973118, + -0.022321665659546852, + 0.006641879212111235, + 0.0063163419254124165, + -0.010044222697615623 + ] + ], + [ + [ + -0.00548953702673316, + 0.031851112842559814, + 0.003763276617974043, + 0.08205848187208176, + -0.0015430173370987177, + 0.0009602203499525785, + 0.0037432233802974224, + 0.030673924833536148 + ], + [ + -0.039002057164907455, + -0.011749274097383022, + 0.04929187148809433, + -0.02627282589673996, + -0.01489965058863163, + 0.0010605938732624054, + 0.0012471864465624094, + 0.024169418960809708 + ], + [ + -0.03324509784579277, + -0.029144607484340668, + 0.03267065808176994, + 0.03373020142316818, + -0.020044120028614998, + -0.008516906760632992, + -7.051711872918531e-05, + -0.015467943623661995 + ], + [ + -0.022818205878138542, + 0.0025796983391046524, + -0.017293421551585197, + -0.019986087456345558, + 0.038799989968538284, + -0.004580306354910135, + -0.0016324515454471111, + -0.003331958781927824 + ], + [ + 0.023659637197852135, + -0.0019552898593246937, + 0.004502623341977596, + 0.027879873290657997, + 0.006521852687001228, + -0.03467337787151337, + -0.002811025595292449, + 0.012067144736647606 + ], + [ + 0.011486819013953209, + 0.003297524992376566, + -0.015943201258778572, + 0.04065745323896408, + 0.029834888875484467, + -0.029717573896050453, + -0.0007188129820860922, + -0.007003722246736288 + ], + [ + 0.004154355730861425, + -0.03640788421034813, + -0.039459049701690674, + -0.008522813208401203, + 0.004252681042999029, + 0.0033199351746588945, + 0.0003320438845548779, + -0.017336351796984673 + ], + [ + 0.02384844794869423, + -0.014753716066479683, + 0.04721315950155258, + 0.02530626393854618, + 0.022847967222332954, + 0.015918709337711334, + 0.002784267533570528, + 0.010478826239705086 + ] + ], + [ + [ + 0.004194630775600672, + 0.036646872758865356, + 0.019267357885837555, + 0.07057150453329086, + 0.013420190662145615, + 0.0007740844157524407, + 0.007302774582058191, + 0.031358398497104645 + ], + [ + 0.009958927519619465, + 0.012683842331171036, + 0.0409364327788353, + 0.06935576349496841, + -0.010556676425039768, + 0.01866360567510128, + 0.003629234852269292, + 0.022966980934143066 + ], + [ + 0.009823845699429512, + 0.0019045716617256403, + -0.00014629449287895113, + -0.053410306572914124, + -0.013917805626988411, + 0.023474195972085, + 0.0012966408394277096, + -0.04474033787846565 + ], + [ + -0.0021568445954471827, + 0.026081085205078125, + -0.010430990718305111, + -0.005070842802524567, + 0.02155333384871483, + 0.014135663397610188, + -0.0072769117541611195, + -0.010416421107947826 + ], + [ + 0.0045775906182825565, + -0.04897192493081093, + 0.0012236733455210924, + 0.03974290192127228, + -0.0060940999537706375, + -0.002153892768546939, + -0.00023976145894266665, + -0.022632740437984467 + ], + [ + 0.020743004977703094, + 0.024965403601527214, + -0.016661008819937706, + 0.014436911791563034, + -0.0026798213366419077, + -0.006846749223768711, + 0.0034906668588519096, + -0.001675717532634735 + ], + [ + 0.022435201331973076, + -0.012942436151206493, + -0.014811132103204727, + -0.02886037342250347, + 0.029454130679368973, + -0.008022964000701904, + 0.0021334670018404722, + -0.03863103315234184 + ], + [ + 0.033705271780490875, + -0.027439622208476067, + -0.06377942860126495, + -0.015736721456050873, + 0.026079978793859482, + 0.00010748840577434748, + -0.0002489046601112932, + -0.02930794656276703 + ] + ], + [ + [ + 0.003220537444576621, + 0.04691672325134277, + 0.0034802171867340803, + -0.01631399802863598, + 0.03243424370884895, + 0.005761491134762764, + 0.008145741187036037, + 0.03719242662191391 + ], + [ + -0.07327664643526077, + 0.05856793746352196, + 0.05575251206755638, + -0.05868099257349968, + -0.008412252180278301, + 0.021700354292988777, + 3.3852116757771e-05, + 0.04903397709131241 + ], + [ + -0.015763331204652786, + 0.08353963494300842, + 0.0136560732498765, + -0.05168149992823601, + -0.012173169292509556, + 0.017266370356082916, + -0.003719913074746728, + 0.053398195654153824 + ], + [ + -0.030785895884037018, + 0.021448832005262375, + -0.0009476044797338545, + 0.021399689838290215, + 0.06014516204595566, + 0.021167168393731117, + -0.006100354250520468, + 0.0006892578094266355 + ], + [ + 0.01712007448077202, + -0.030103670433163643, + 0.011211994104087353, + -0.012121288105845451, + 0.024359898641705513, + -0.008124848827719688, + -0.0045176162384450436, + 0.010204008780419827 + ], + [ + -0.012693437747657299, + -0.0014785456005483866, + 0.014796608127653599, + -0.049315061420202255, + 0.017876822501420975, + -0.003064640099182725, + -0.00044017424806952477, + -0.0059758140705525875 + ], + [ + 0.021939093247056007, + 0.024029135704040527, + 0.031413767486810684, + -0.04060874879360199, + 0.04723501577973366, + -0.037853725254535675, + 0.0010752876987680793, + -0.012698314152657986 + ], + [ + -0.022183438763022423, + -0.011292386800050735, + -0.027730880305171013, + 0.03551990166306496, + 0.014207689091563225, + -0.05564763769507408, + 0.0034377500414848328, + -0.03919512405991554 + ] + ], + [ + [ + 0.017665527760982513, + 0.02584412507712841, + -0.005686011165380478, + 0.07403957098722458, + 0.01931527629494667, + -0.0004867102252319455, + 0.009754050523042679, + 0.023235727101564407 + ], + [ + 0.05509273335337639, + 0.010476022958755493, + 0.07664868235588074, + -0.022635379806160927, + -0.05696525424718857, + 0.0019894614815711975, + -0.004077325575053692, + -0.02418496087193489 + ], + [ + -0.03363822028040886, + 0.03086673840880394, + 0.019837604835629463, + 0.011534682475030422, + -0.046340152621269226, + -0.020885910838842392, + 0.00340621848590672, + -0.0012978595914319158 + ], + [ + -0.031596116721630096, + 0.005718749016523361, + 0.02363886497914791, + 0.049452319741249084, + -0.006638370454311371, + -0.03828440606594086, + 0.0031606685370206833, + -0.004262927453964949 + ], + [ + -0.04079686850309372, + 0.06434120982885361, + -0.008060974068939686, + -0.02411559224128723, + 0.019676553085446358, + -0.0004182986740488559, + -0.000598226091824472, + -0.015753846615552902 + ], + [ + -0.012212902307510376, + -0.0035351456608623266, + -0.011044967919588089, + -0.058244504034519196, + 0.03637499734759331, + -0.019577886909246445, + 0.0010957111371681094, + -0.022616146132349968 + ], + [ + -0.027338765561580658, + -0.006887834053486586, + -0.005746159236878157, + -0.002384669380262494, + 0.029074860736727715, + -0.021904606372117996, + 0.0038412187714129686, + -0.010842666029930115 + ], + [ + -0.006566227879375219, + 0.03930990770459175, + 0.018889661878347397, + -0.015460547991096973, + 0.03399643674492836, + 0.004218080081045628, + 0.0009903317550197244, + 0.004346251953393221 + ] + ], + [ + [ + 0.030879944562911987, + 0.028885049745440483, + -0.013850043527781963, + 0.03694538399577141, + -0.005180442705750465, + 0.011282284744083881, + -0.002433119574561715, + -0.021003209054470062 + ], + [ + 0.12259355932474136, + 0.022295862436294556, + 0.1897198110818863, + -0.1402541846036911, + -0.010814499109983444, + 0.08736183494329453, + -0.004174996633082628, + 0.30340269207954407 + ], + [ + -0.009325620718300343, + 0.047747448086738586, + 0.044572409242391586, + -0.0025907044764608145, + -0.012971427291631699, + 0.04710910841822624, + 0.0031675598584115505, + 0.10882578045129776 + ], + [ + 0.01497171726077795, + 0.03169722855091095, + 0.01262550801038742, + 0.06214401125907898, + -0.01480111014097929, + -0.001684309565462172, + 0.009241396561264992, + -0.00862998329102993 + ], + [ + -0.026988856494426727, + 0.020340289920568466, + 0.022071463987231255, + -0.019979629665613174, + 0.035327017307281494, + 0.003403899958357215, + -0.0004152222245465964, + -0.005350247025489807 + ], + [ + 0.0333445779979229, + 0.0234694667160511, + 0.02128487080335617, + 0.025157175958156586, + 0.02705111727118492, + 0.006696535274386406, + 0.005178219638764858, + 0.02249695360660553 + ], + [ + -0.020285382866859436, + -0.03343268483877182, + 0.005234679207205772, + -0.04024139791727066, + 0.03343258798122406, + -0.009428367018699646, + 0.004559269640594721, + -0.010640962049365044 + ], + [ + 0.047331955283880234, + -0.02570519596338272, + -0.0050963545218110085, + -0.0004887181567028165, + 0.0369843952357769, + 0.0016845650970935822, + -0.0025435343850404024, + -0.013113277964293957 + ] + ], + [ + [ + 0.04708777740597725, + 0.0546407513320446, + -0.019778253510594368, + -0.03020212985575199, + 0.04295117408037186, + -0.011064196936786175, + 0.005273774731904268, + -0.06307312846183777 + ], + [ + 0.02373342402279377, + 0.008690428920090199, + 0.13126248121261597, + -0.15886718034744263, + -0.11903645843267441, + -0.06723484396934509, + 0.010034335777163506, + 0.38366520404815674 + ], + [ + -0.021705718711018562, + -0.0017231324454769492, + 0.02339080162346363, + 0.002156130038201809, + -0.06332606077194214, + -0.027919650077819824, + 0.004089817870408297, + 0.1876179575920105 + ], + [ + 0.009987455792725086, + 0.021744379773736, + 0.01557222194969654, + -0.04061278700828552, + 0.012890533544123173, + -0.013378339819610119, + 0.014072220772504807, + 0.08491210639476776 + ], + [ + 0.002385040745139122, + 0.009911761619150639, + 0.03644455224275589, + -0.03119037114083767, + 0.05329178273677826, + 0.006067113485187292, + -0.0031332923099398613, + 0.0707654356956482 + ], + [ + -0.027113385498523712, + 0.022774750366806984, + 0.019746411591768265, + 0.025245368480682373, + 0.010035448707640171, + 0.012227477505803108, + 0.003915358334779739, + 0.055243562906980515 + ], + [ + -0.0063345348462462425, + 0.02745645120739937, + 0.013698599301278591, + -0.0013396875001490116, + 0.03583969175815582, + 0.0021140098106116056, + 0.0032817081082612276, + 0.025703664869070053 + ], + [ + 0.007595096714794636, + -0.05127161741256714, + 0.018067358061671257, + 0.004845688585191965, + 0.012249483726918697, + -0.01593918167054653, + -0.00196365499868989, + 0.060166556388139725 + ] + ], + [ + [ + 0.016169100999832153, + 0.015862340107560158, + -0.034561093896627426, + 0.1274254471063614, + -0.05113687366247177, + -0.07104127109050751, + 0.001111703459173441, + -0.0124658877030015 + ], + [ + -0.08562838286161423, + -0.02200344391167164, + 0.09687243402004242, + 0.005644212476909161, + -0.170273557305336, + -0.0846066027879715, + 0.01938086561858654, + 0.2188040167093277 + ], + [ + -0.03147229924798012, + -0.018969368189573288, + 0.026662304997444153, + 0.09535887092351913, + -0.10537650436162949, + -0.07057502865791321, + 0.011506779119372368, + 0.08022982627153397 + ], + [ + -0.020279644057154655, + 0.02046308107674122, + 0.026706155389547348, + -0.04811036214232445, + -0.0694994404911995, + -0.02081410586833954, + 0.02150288037955761, + 0.0415726862847805 + ], + [ + -0.0013376087881624699, + -0.01326598972082138, + -0.009371246211230755, + 0.05787783861160278, + 0.019228894263505936, + -0.004149371758103371, + 0.0028852131217718124, + 0.01626676693558693 + ], + [ + -0.004703984130173922, + -0.004668634384870529, + -0.007519465405493975, + -0.0021265544928610325, + -0.03659944608807564, + -0.035296935588121414, + 0.0010330276563763618, + -0.027365025132894516 + ], + [ + 0.01449507661163807, + 0.01224221009761095, + -0.013604113832116127, + 0.013627513311803341, + -0.003761444240808487, + -0.013962718658149242, + 0.0019797710701823235, + 0.00248170318081975 + ], + [ + -0.041097719222307205, + 0.01336254458874464, + 0.030096007511019707, + -0.05458754301071167, + 0.020814640447497368, + -0.027607381343841553, + -0.0019918824546039104, + 0.05074363201856613 + ] + ], + [ + [ + 0.02314540185034275, + -0.016008121892809868, + -0.04159478098154068, + 0.07366753369569778, + -0.03850163519382477, + -0.06541289389133453, + 0.010036026127636433, + 0.04126209765672684 + ], + [ + -0.07927850633859634, + 0.11211354285478592, + 0.05694792792201042, + -0.07297089695930481, + -0.010149702429771423, + -0.09250883758068085, + 0.015601404942572117, + -0.08281136304140091 + ], + [ + -0.04661364108324051, + 0.04807087406516075, + 0.060821160674095154, + 0.12104525417089462, + -0.01340529415756464, + -0.07738678902387619, + 0.011063961312174797, + -0.10044616460800171 + ], + [ + -0.05714194476604462, + -0.009717494249343872, + 0.07285498827695847, + -0.007560129277408123, + -0.08152791857719421, + -0.027731476351618767, + 0.011731580831110477, + -0.04754829779267311 + ], + [ + -0.008494297042489052, + -0.014200201258063316, + 0.030893530696630478, + -0.009737287648022175, + -0.018739944323897362, + -0.02910281904041767, + 0.009979317896068096, + -0.03538310155272484 + ], + [ + 0.006399458274245262, + -0.015949133783578873, + 0.002267714822664857, + 0.0177000779658556, + -0.010105075314640999, + 0.007993895560503006, + 0.0010534122120589018, + -0.018530748784542084 + ], + [ + -0.024193719029426575, + -0.037368640303611755, + 0.05385681241750717, + 0.006880240049213171, + -0.04035865142941475, + -0.007657474372535944, + 0.005702108610421419, + -0.007152618374675512 + ], + [ + -0.01313439104706049, + 0.035078950226306915, + 0.03262544423341751, + -0.10286692529916763, + 0.007873139344155788, + 0.004375115968286991, + 0.0034721933770924807, + -0.057828906923532486 + ] + ], + [ + [ + 0.0015094551490619779, + -0.0037783412262797356, + -0.041453149169683456, + 0.05343955010175705, + -0.05641055107116699, + -0.032581623643636703, + 0.009075518697500229, + 0.03308048099279404 + ], + [ + 0.01080410648137331, + 0.19108712673187256, + -0.026222683489322662, + -0.1049545407295227, + 0.20901824533939362, + 0.08332358300685883, + 0.01803429052233696, + 0.04640057310461998 + ], + [ + 0.017513934522867203, + 0.13038626313209534, + 0.032652925699949265, + 0.011465733870863914, + 0.18698011338710785, + 0.051278501749038696, + 0.0050444649532437325, + 0.06500063091516495 + ], + [ + 0.026574837043881416, + 0.0370124913752079, + -0.007568896748125553, + -0.04658748582005501, + -0.00966734066605568, + 0.019052013754844666, + -0.00022309199266601354, + 0.04766188934445381 + ], + [ + 0.03181733563542366, + 0.037934962660074234, + 0.04109204187989235, + 0.028533408418297768, + 0.046855855733156204, + 0.015713557600975037, + 0.0011658892035484314, + 0.029260657727718353 + ], + [ + 0.029574604704976082, + 0.019733818247914314, + 0.008612710982561111, + 0.008139015175402164, + 0.0163979884237051, + 0.02153223194181919, + 0.004701680038124323, + 0.005716489162296057 + ], + [ + 0.045273687690496445, + -0.005178686697036028, + 0.035512156784534454, + -0.05051221698522568, + -0.03210536763072014, + 0.020081376656889915, + -0.005475402344018221, + -0.009058102034032345 + ], + [ + 0.029938537627458572, + 0.00080389145296067, + -0.0204447191208601, + -0.014743839390575886, + 0.026595430448651314, + 0.024255160242319107, + 3.722627297975123e-05, + 0.0037382349837571383 + ] + ], + [ + [ + -0.0003715180791914463, + -0.06402165442705154, + -0.00046848010970279574, + -0.03242013603448868, + 0.0021476219408214092, + -0.019544897601008415, + 0.0019248216412961483, + 0.03903350979089737 + ], + [ + -0.055718984454870224, + -0.0056474641896784306, + -0.06417400389909744, + -0.17732064425945282, + 0.32743197679519653, + -0.01331361010670662, + 0.0016965834656730294, + 0.033597346395254135 + ], + [ + -0.02555612474679947, + 0.005615927278995514, + -0.028279514983296394, + -0.08378514647483826, + 0.06636359542608261, + -0.011610358953475952, + -0.001058837864547968, + -0.02448645420372486 + ], + [ + 0.02068919874727726, + -0.031359702348709106, + -0.09356492757797241, + -0.07085816562175751, + 0.07659707218408585, + -0.018051117658615112, + -0.005967427976429462, + -0.027356795966625214 + ], + [ + 0.012303602881729603, + -0.01762014999985695, + -0.03965068235993385, + -0.08349713683128357, + 0.03593345731496811, + 0.002074137097224593, + 0.0014912867918610573, + -0.021576352417469025 + ], + [ + 0.033940695226192474, + -0.029378073289990425, + -0.0330352708697319, + 0.03391343355178833, + -0.02557547204196453, + 0.009299595840275288, + -0.005498511251062155, + -0.04035209119319916 + ], + [ + 0.021058205515146255, + -0.0228632390499115, + -0.04326479136943817, + -0.07233523577451706, + 0.0029118796810507774, + -0.008291506208479404, + 0.00045932771172374487, + -0.03698957338929176 + ], + [ + 0.03190057352185249, + -0.02294217422604561, + -0.005359566770493984, + -0.010958338156342506, + 0.042856115847826004, + 0.015247580595314503, + -0.0009058800642378628, + -0.009829061105847359 + ] + ], + [ + [ + 0.006657279096543789, + 0.031515780836343765, + -0.0015185297233983874, + 0.05281578376889229, + -0.0030828630551695824, + 0.0015480483416467905, + 0.0049115875735878944, + 0.041041161864995956 + ], + [ + 0.011154163628816605, + -0.07069145143032074, + -0.04434756189584732, + 0.06754521280527115, + 0.0658046305179596, + 0.03674199804663658, + -0.00466578733175993, + -0.015208771452307701 + ], + [ + -0.01098690927028656, + -0.023191994056105614, + -0.004196473862975836, + 0.10994754731655121, + -0.1030120998620987, + 0.03843710944056511, + -0.004391757771372795, + -0.031035806983709335 + ], + [ + 0.010775008238852024, + -0.020793715491890907, + -0.024980811402201653, + 0.004081035498529673, + -0.030696582049131393, + 0.003430834738537669, + 0.0019765598699450493, + -0.0461832620203495 + ], + [ + 0.022640760987997055, + -0.011241755448281765, + -0.021434498950839043, + 0.005859134718775749, + -0.025272034108638763, + -0.0034824225585907698, + 0.0032535467762500048, + -0.029967159032821655 + ], + [ + -0.0022522846702486277, + -0.006160680670291185, + -0.024659277871251106, + -0.021563678979873657, + 0.017344944179058075, + -0.021402226760983467, + -0.0035409049596637487, + -0.02929156832396984 + ], + [ + -0.02043052203953266, + -0.0015831815544515848, + -0.020400941371917725, + 0.03990444913506508, + -0.0004507047706283629, + 0.0007214633515104651, + 0.0024577102158218622, + -0.03489056974649429 + ], + [ + 0.0009107451187446713, + -0.04659958556294441, + -0.02360416390001774, + 0.07389141619205475, + -0.013352436013519764, + -0.0012748516164720058, + 0.00012923353642690927, + -0.016014359891414642 + ] + ], + [ + [ + -0.004031038377434015, + 0.06007026135921478, + -0.0007486783433705568, + -0.0031865069177001715, + 0.01860062964260578, + 0.006972815841436386, + -0.0011977247195318341, + 0.011188252829015255 + ], + [ + -0.009086420759558678, + 0.05060000717639923, + 0.00739708635956049, + -0.06200924515724182, + 0.06490447372198105, + 0.019750036299228668, + 1.8728267605183646e-05, + 0.02268023043870926 + ], + [ + 0.0011463057016953826, + -0.005301299039274454, + 0.04907069727778435, + -0.10821857303380966, + -0.0455496609210968, + 0.047655630856752396, + -0.001535426126793027, + 0.0029435281176120043 + ], + [ + 0.006745639722794294, + 0.026047175750136375, + 0.03557593747973442, + -0.05105827748775482, + 0.002068733097985387, + 0.009547051042318344, + -0.0002590746444184333, + 0.04305073618888855 + ], + [ + 0.010828199796378613, + 0.019045373424887657, + 0.017620233818888664, + -0.04513699561357498, + 0.003138558007776737, + -0.00010290775389876217, + 0.0005800811923108995, + -0.016268359497189522 + ], + [ + 0.002445135498419404, + 0.029925735667347908, + 0.014202162623405457, + 0.020812077447772026, + -0.01769254170358181, + 0.010732497088611126, + 0.001501087681390345, + 0.012577611953020096 + ], + [ + 0.013922314159572124, + 0.026253247633576393, + 0.05159140005707741, + -0.02560805156826973, + 0.03248957544565201, + -0.014838890172541142, + 0.003268703119829297, + 0.007691729348152876 + ], + [ + -0.035076141357421875, + 0.005074883811175823, + 0.005050128325819969, + -0.03349277377128601, + -0.012557176873087883, + 0.014744953252375126, + -0.005777205340564251, + 0.0029490594752132893 + ] + ], + [ + [ + -0.00467815063893795, + 0.019153766334056854, + 0.021536579355597496, + -0.005690266843885183, + 0.02851932868361473, + -0.011251488700509071, + 0.003254977520555258, + 0.024954479187726974 + ], + [ + -0.02577553130686283, + -0.034139234572649, + -0.000965355837251991, + -0.03377874940633774, + 0.048347458243370056, + 0.0016396761639043689, + 0.0042406776919960976, + 0.006309839431196451 + ], + [ + -0.013321392238140106, + -0.003638817463070154, + -0.007195755839347839, + -0.021761950105428696, + -0.032176852226257324, + 0.020011719316244125, + 0.0015529576921835542, + -0.015291029587388039 + ], + [ + 0.03238755092024803, + -0.019649477675557137, + -0.06351985037326813, + -0.011884860694408417, + 0.03222183883190155, + 0.0020869243890047073, + -0.004112122114747763, + -0.0379023477435112 + ], + [ + 0.001999708591029048, + 0.010784710757434368, + -0.03721160814166069, + -0.031861040741205215, + 0.017435932531952858, + -0.010129373520612717, + -0.0012238104827702045, + -0.036872781813144684 + ], + [ + -0.02841494046151638, + -0.0077344984747469425, + 0.0030832672491669655, + 0.010021772235631943, + -0.02299349382519722, + -0.0011497460072860122, + 0.0002062158746412024, + -0.0126424515619874 + ], + [ + 0.05879471078515053, + 0.0016576764173805714, + 0.0011264156782999635, + 0.019112233072519302, + -0.027856789529323578, + 0.0206501055508852, + -0.004655002150684595, + 0.00990780908614397 + ], + [ + -0.040616776794195175, + -0.019175207242369652, + 0.01963145099580288, + -0.0057840002700686455, + 0.059348661452531815, + 0.0022817119024693966, + -0.0056674969382584095, + 0.0435250885784626 + ] + ], + [ + [ + 0.026906216517090797, + 0.03495531901717186, + 0.01561003364622593, + -0.032815899699926376, + 0.012961712665855885, + 0.023452751338481903, + 0.0007745952461846173, + 0.025639737024903297 + ], + [ + 0.013180704787373543, + 0.000151719301356934, + 0.013174232095479965, + 0.02266211248934269, + 0.004290116485208273, + 0.01575540378689766, + -3.8623835280304775e-05, + 0.004167682025581598 + ], + [ + 0.00915304385125637, + 0.008511967025697231, + 0.008641550317406654, + 0.0682753473520279, + -0.06658344715833664, + 0.019793981686234474, + 0.004111799877136946, + -0.018930993974208832 + ], + [ + 0.011766777373850346, + -0.016970572993159294, + -0.051741961389780045, + 0.016859734430909157, + -0.026318103075027466, + -0.020263319835066795, + 0.0015697055496275425, + -0.09965558350086212 + ], + [ + -0.01184807438403368, + 0.03494466468691826, + -0.00859544426202774, + 0.07735160738229752, + 0.006083793006837368, + -0.027346322312951088, + -0.001636180211789906, + -0.01401776447892189 + ], + [ + -0.0298349279910326, + -0.011934991925954819, + 0.02231072448194027, + 0.01568078249692917, + -0.018259506672620773, + -0.007824699394404888, + 0.0004743097524624318, + -0.005038091912865639 + ], + [ + 0.0006439401186071336, + -0.04891534894704819, + 0.01011788472533226, + 0.004828695673495531, + -0.010650592856109142, + -0.009660420008003712, + 0.0026182360015809536, + 0.07452120631933212 + ], + [ + -0.0029861053917557, + 0.023432306945323944, + -0.006174479611217976, + 0.05881356820464134, + -0.02042515203356743, + 0.014039244502782822, + 0.0008637408609502017, + -0.013714049942791462 + ] + ], + [ + [ + 0.031763412058353424, + 0.045319460332393646, + 0.03704092651605606, + -0.04653820022940636, + 0.026226013898849487, + 0.0060088918544352055, + -0.0007206834852695465, + 0.03153114765882492 + ], + [ + 0.023994244635105133, + 0.05001296103000641, + 0.0208175927400589, + -0.03361321613192558, + 0.011179142631590366, + 0.017567122355103493, + 0.0040858471766114235, + 0.041665755212306976 + ], + [ + -0.0019176916684955359, + -0.008860721252858639, + 0.00804830715060234, + -0.06710585951805115, + -0.005584254860877991, + 0.02672041952610016, + -0.003805427113547921, + 0.03774990141391754 + ], + [ + 0.022103071212768555, + 0.051502980291843414, + -0.00920149963349104, + 0.025761647149920464, + -0.007208717055618763, + -0.042106352746486664, + -0.004099592566490173, + -0.01077309437096119 + ], + [ + -0.011391744948923588, + -0.008205968886613846, + 0.03201839327812195, + -0.0379716157913208, + -0.0004324305336922407, + 0.011689878068864346, + 0.0009052681270986795, + 0.0008108107722364366 + ], + [ + -0.012355463579297066, + 0.00889628753066063, + 0.019416918978095055, + -0.0491940937936306, + 0.0336642749607563, + 0.018318308517336845, + 0.004638113081455231, + 0.01793205924332142 + ], + [ + -0.04966837540268898, + 0.02633105404675007, + 0.023824701085686684, + -0.06964955478906631, + 0.004300068132579327, + 0.009167592972517014, + -0.0035373540595173836, + 0.03498886153101921 + ], + [ + 0.004149044398218393, + 0.018579240888357162, + 0.02129911631345749, + 0.051819540560245514, + -0.025508560240268707, + -0.0018133368575945497, + -0.00390626210719347, + -0.0019575103651732206 + ] + ], + [ + [ + 0.0019884395878762007, + 0.005480616819113493, + 0.01830737665295601, + 0.02411513216793537, + -0.03454179689288139, + 0.01661810651421547, + -0.00010770565859274939, + 0.019446440041065216 + ], + [ + -0.0035209162160754204, + -0.028522534295916557, + 0.004664111416786909, + 0.004271877929568291, + -0.02149984985589981, + -0.006206894293427467, + 0.007948211394250393, + 0.01753576472401619 + ], + [ + 0.004358015023171902, + -0.03554169833660126, + -0.000732944521587342, + -0.011015359312295914, + 0.013186343014240265, + 0.034326937049627304, + -0.0023806795943528414, + 0.000423645629780367 + ], + [ + 0.008785500191152096, + 0.011739649809896946, + 0.013015623204410076, + 0.07066868990659714, + -0.031190283596515656, + -0.03341333568096161, + 0.0018862433498725295, + -0.011331228539347649 + ], + [ + 0.016341447830200195, + -0.01127127930521965, + -0.013935831375420094, + -0.03432537615299225, + 0.013473457656800747, + -0.018385739997029305, + 0.006115016061812639, + -0.005081954877823591 + ], + [ + -0.020464077591896057, + 0.04542534425854683, + -0.017606521025300026, + 0.0037451875396072865, + -0.05910131335258484, + 0.005355995148420334, + 0.003967034164816141, + -0.0028092795982956886 + ], + [ + -0.011377179995179176, + 0.03501180559396744, + 0.02200048230588436, + -0.05324458330869675, + -0.014086994342505932, + 0.04337421804666519, + 0.0028321072459220886, + -0.06663086265325546 + ], + [ + 0.021992316469550133, + -0.01023730169981718, + 0.02641773596405983, + -0.04268207028508186, + -0.0049942475743591785, + 0.05112351477146149, + -0.005716235376894474, + 0.00319046713411808 + ] + ], + [ + [ + -0.009290002286434174, + 0.019779661670327187, + 0.028369976207613945, + -0.03391946852207184, + -0.01544881146401167, + 0.012760061770677567, + 0.004034359473735094, + 0.05201878026127815 + ], + [ + -0.013505686074495316, + -0.0036509917117655277, + 0.023913055658340454, + 0.015986384823918343, + -0.03826695680618286, + 0.027190566062927246, + 0.007120308466255665, + -0.00520288897678256 + ], + [ + 0.0029465998522937298, + 0.030355554074048996, + -0.024989113211631775, + -0.02466447465121746, + 0.012373692356050014, + 0.03337834030389786, + -0.0011984935263171792, + -0.06309749186038971 + ], + [ + 0.01442688424140215, + -0.021765485405921936, + -0.007461355067789555, + 0.04745425283908844, + -0.06429755687713623, + -0.018162401393055916, + -0.000617266574408859, + -0.0308294165879488 + ], + [ + 0.021895315498113632, + 0.042971521615982056, + 0.027369080111384392, + 0.062570720911026, + 0.00519077992066741, + 0.012374100275337696, + 0.0011496433289721608, + 0.019891558215022087 + ], + [ + 0.0016471476992592216, + -0.01427871361374855, + 0.04901239648461342, + 0.028836295008659363, + -0.008846516720950603, + 0.005139724817126989, + -0.0024649593979120255, + -0.0063686431385576725 + ], + [ + 0.024311251938343048, + 0.013757845386862755, + -0.017661159858107567, + -0.0029138168320059776, + 0.003288343083113432, + 0.027981380000710487, + -0.0037630335427820683, + 0.001969374483451247 + ], + [ + -0.010592025704681873, + -0.024800408631563187, + -0.04720895737409592, + -0.07662469148635864, + 0.002968601416796446, + 0.01562541536986828, + -0.00931378174573183, + -0.01402820274233818 + ] + ], + [ + [ + 0.009850326925516129, + 0.07045552879571915, + 0.012183796614408493, + -0.0437471903860569, + 0.005191592965275049, + 0.014072692021727562, + 0.0031691205222159624, + 0.04194596782326698 + ], + [ + -0.003993731923401356, + 0.07178027927875519, + 0.02213866636157036, + -0.07155248522758484, + -0.0027623602654784918, + 0.033144090324640274, + 0.002711333567276597, + 0.017058009281754494 + ], + [ + 0.02614920772612095, + 0.05786094442009926, + -0.00581064959987998, + -0.012962762266397476, + 0.02323671244084835, + 0.0024220505729317665, + -0.0028699347749352455, + 0.010196512565016747 + ], + [ + 0.009567998349666595, + 0.001957615138962865, + -0.005174347665160894, + -0.08125078678131104, + 0.011440008878707886, + 0.014306584373116493, + 0.004230569116771221, + 0.032766617834568024 + ], + [ + -0.007074334658682346, + 0.027076609432697296, + 0.022683370858430862, + -0.0661698430776596, + -0.018682552501559258, + -0.004980286117643118, + -0.0016763587482273579, + 0.056813523173332214 + ], + [ + 0.03533179685473442, + -0.026744289323687553, + 0.055656641721725464, + -0.00746717257425189, + 0.016712309792637825, + 0.036070168018341064, + -0.0029553640633821487, + 0.0002724079822655767 + ], + [ + 0.01967337727546692, + -0.008432695642113686, + 0.010955385863780975, + -0.006666249595582485, + 0.00875681173056364, + 0.019610131159424782, + 0.00201854994520545, + -0.022675104439258575 + ], + [ + -0.01827876642346382, + 0.02395530790090561, + -0.01825840212404728, + 0.06549610942602158, + -0.0035375149454921484, + -0.015933072194457054, + 4.9101417971542105e-05, + -0.005732385907322168 + ] + ], + [ + [ + 0.015832124277949333, + 0.04000043869018555, + 0.006212812848389149, + 0.001033375971019268, + 0.0027935844846069813, + -0.00835844874382019, + 0.005375500302761793, + 0.04137355461716652 + ], + [ + 0.0003631418803706765, + -0.004733639303594828, + 0.012651678174734116, + 0.03599067032337189, + -0.019782517105340958, + -0.008408598601818085, + 0.002540500136092305, + 0.031068304553627968 + ], + [ + 0.03980891779065132, + -0.04266461357474327, + 0.013936418108642101, + -0.002100197598338127, + -0.038910869508981705, + -0.042749762535095215, + 0.0005672714905813336, + -0.008819361217319965 + ], + [ + -0.01549141388386488, + 0.07401978224515915, + -0.011533224023878574, + -0.021592767909169197, + 0.027752919122576714, + -0.005072418134659529, + 0.0022535210009664297, + -0.004074315074831247 + ], + [ + -0.04076296091079712, + 0.007113859988749027, + 0.017873255535960197, + -0.09132011234760284, + -0.037718143314123154, + -0.0003202590742148459, + 0.005704800598323345, + -0.030453648418188095 + ], + [ + 0.014960560947656631, + -0.028186429291963577, + -0.033946406096220016, + -0.008214331232011318, + -0.01382719911634922, + 0.01604052446782589, + 0.0011201991001144052, + -0.023217925801873207 + ], + [ + 0.005014947149902582, + -0.04904123395681381, + -0.021105466410517693, + 0.009584352374076843, + -0.034113746136426926, + 0.003627522150054574, + 0.002775321714580059, + -0.022269096225500107 + ], + [ + -0.014884375967085361, + -0.03041590191423893, + 0.05198189616203308, + 0.02021039091050625, + 0.029204050078988075, + 0.03026435524225235, + -0.0024461408611387014, + 0.058198269456624985 + ] + ], + [ + [ + 0.04364507645368576, + 0.053534332662820816, + -0.005044605117291212, + 0.0442015677690506, + 0.016795506700873375, + -0.011768280528485775, + 0.0004117675998713821, + 0.01696326956152916 + ], + [ + 0.03706022724509239, + 0.000376919808331877, + -0.005362798925489187, + 0.013395418412983418, + -0.01909090019762516, + 0.017178423702716827, + 0.007699698209762573, + -0.01664186269044876 + ], + [ + 0.023897608742117882, + -0.01194939948618412, + 0.009397152811288834, + 0.018418392166495323, + 0.01945147104561329, + 0.007964464835822582, + -0.0021918269339948893, + -0.03259453549981117 + ], + [ + -0.039262715727090836, + 0.06139043718576431, + 0.014894065447151661, + -0.010972459800541401, + -0.04037734493613243, + 0.031313154846429825, + 0.0040224832482635975, + 0.003912790212780237 + ], + [ + 0.009408005513250828, + -0.0009769466705620289, + 0.009312774986028671, + -0.06353874504566193, + -0.012131115421652794, + 0.004587376955896616, + 0.0006452741799876094, + -0.02324407547712326 + ], + [ + -0.02906310372054577, + -0.009362876415252686, + -0.04660520330071449, + 0.029457686468958855, + 0.0064585269428789616, + -0.00013420649338513613, + -0.001626294106245041, + -0.03535887971520424 + ], + [ + -0.029669981449842453, + 0.01909295842051506, + 0.00809968076646328, + -0.017230065539479256, + 0.002198271220549941, + 0.01653190888464451, + -0.004508364014327526, + -0.011204857379198074 + ], + [ + 0.010630820877850056, + -0.02651895396411419, + -0.01693885028362274, + -0.03346215933561325, + -0.03532493859529495, + 0.045162953436374664, + 0.0048084380105137825, + -0.036395665258169174 + ] + ], + [ + [ + 0.03676842525601387, + 0.057188693434000015, + 0.03682580217719078, + -0.03276504948735237, + 0.05831105634570122, + 0.012854295782744884, + 0.00016338497516699135, + 0.01098472811281681 + ], + [ + 0.03882796689867973, + 0.04575461894273758, + 0.013497973792254925, + -0.04195021465420723, + 0.021734457463026047, + 0.030285293236374855, + 0.0020185529720038176, + 0.05504108592867851 + ], + [ + 0.013494933024048805, + -0.007151382509618998, + 0.012950004078447819, + -0.05080506205558777, + -0.03471425548195839, + 0.010152100585401058, + 0.0012854316737502813, + 0.01802017353475094 + ], + [ + 0.015200871974229813, + 0.018588043749332428, + 0.018564192578196526, + 0.008766925893723965, + -0.0417478010058403, + -0.01445373147726059, + -0.0020978208631277084, + 0.07200413197278976 + ], + [ + 0.027316007763147354, + 0.027896124869585037, + -0.00642414391040802, + -0.012354463338851929, + 0.03120071440935135, + 0.015034842304885387, + 0.0008906589355319738, + 0.01614912785589695 + ], + [ + -0.0024228563997894526, + 0.04122895747423172, + 0.03965893015265465, + -0.02345437929034233, + -0.012202764861285686, + 0.006111858878284693, + 0.0014076087391003966, + 0.01234383974224329 + ], + [ + -0.014779522083699703, + -0.01435845997184515, + 0.035827670246362686, + -0.00615320447832346, + 0.013578345067799091, + 0.014585570432245731, + 0.0024426656309515238, + 0.030677633360028267 + ], + [ + 0.028690936043858528, + 0.025967668741941452, + 0.0022847771178931, + -0.030274752527475357, + -0.07283033430576324, + 0.05115921422839165, + 0.003505631582811475, + -0.06965424865484238 + ] + ], + [ + [ + 0.0022526041138917208, + -0.0033321205992251635, + 0.052210696041584015, + 0.022080007940530777, + 0.04499586299061775, + -0.014366740360856056, + -0.0024918087292462587, + 0.029814230278134346 + ], + [ + -0.005764272063970566, + -0.04428812488913536, + 0.014807346276938915, + -0.03224075585603714, + 0.056032758206129074, + -0.03580719977617264, + -0.0026982619892805815, + 0.0016177220968529582 + ], + [ + 0.00624062167480588, + 0.0220798309892416, + -0.02083788439631462, + -0.07462318986654282, + -0.02508326806128025, + 0.010908132418990135, + -0.0029772543348371983, + -0.025691842660307884 + ], + [ + -0.002292643766850233, + 0.023217210546135902, + 0.0014260017778724432, + 0.06721135973930359, + -0.06459220498800278, + 0.007774314843118191, + 0.004374436568468809, + 0.011003950610756874 + ], + [ + 0.034771841019392014, + -0.0318676121532917, + -0.04294413700699806, + 0.024908022955060005, + 0.010661724023520947, + 0.01570594310760498, + -0.0033350924495607615, + -0.028290625661611557 + ], + [ + 0.06630302965641022, + -0.005670373793691397, + 0.021119248121976852, + -0.017631419003009796, + -0.00850875023752451, + 0.0006627098773606122, + -0.0004939071368426085, + -0.009127829223871231 + ], + [ + 0.01654650643467903, + 0.01253419928252697, + -0.025791052728891373, + 0.007707177195698023, + -0.00013679992116522044, + -0.014829759486019611, + -0.0023751447442919016, + -0.026496700942516327 + ], + [ + 0.04763633757829666, + 0.01124358270317316, + 0.043776508420705795, + -0.08887940645217896, + -0.0014887022553011775, + 0.04577095806598663, + -0.003335018176585436, + 0.0416775681078434 + ] + ], + [ + [ + -0.003762605832889676, + 0.030300317332148552, + 0.02825080044567585, + -0.019750751554965973, + 0.015280344523489475, + 0.008573169820010662, + -0.004992991220206022, + 0.02650953270494938 + ], + [ + 0.02791803888976574, + -0.004731468856334686, + 0.0018360503017902374, + 0.04023616015911102, + 0.036189574748277664, + 0.02284659445285797, + -0.005476361606270075, + 0.0006030406220816076 + ], + [ + 0.02068227156996727, + 0.05914341285824776, + -0.01686372421681881, + 0.031238244846463203, + -0.007535550743341446, + -0.0028557840269058943, + -0.007221037056297064, + -0.03158998861908913 + ], + [ + -0.01047028973698616, + -0.0219810139387846, + 0.04487505182623863, + -0.011563003063201904, + 0.0052381958812475204, + -0.03498772904276848, + 0.003390582511201501, + -0.03678049519658089 + ], + [ + 0.002409199019894004, + 0.004758660215884447, + -0.022777343168854713, + -0.013153568841516972, + -0.01727961376309395, + 0.005681423004716635, + -0.0014909598976373672, + -0.028424357995390892 + ], + [ + -0.004583167377859354, + -0.04666104540228844, + 0.027090568095445633, + -0.018452607095241547, + -0.0051025403663516045, + -0.0003816545067820698, + 0.0017415466718375683, + 0.07826590538024902 + ], + [ + -0.006890173070132732, + 0.007267466280609369, + 0.017637643963098526, + 0.012057092972099781, + -0.011409956030547619, + 0.0038310345262289047, + 0.0017231227830052376, + -0.00191114644985646 + ], + [ + 0.007960431277751923, + -0.056272827088832855, + -0.05826694145798683, + 0.0003836854884866625, + 0.016795653849840164, + 0.013787226751446724, + -0.013345795683562756, + -0.068734310567379 + ] + ], + [ + [ + 0.013285644352436066, + 0.08282268792390823, + 0.002411688445135951, + -0.0377628393471241, + 0.01484021358191967, + 0.0002714339643716812, + -0.004488272126764059, + 0.012675038538873196 + ], + [ + 0.03151894360780716, + 0.03386840969324112, + 0.03792781010270119, + -0.11435781419277191, + -0.005664561875164509, + 0.029355010017752647, + -0.0026940128300338984, + 0.01693064719438553 + ], + [ + -0.013885051012039185, + 0.029663600027561188, + 0.01563509739935398, + -0.04676106572151184, + -0.05618946626782417, + 0.019846541807055473, + -0.00615695072337985, + 0.03729117289185524 + ], + [ + 0.044010140001773834, + 0.03215445205569267, + 0.025053221732378006, + 0.012145090848207474, + 0.019019190222024918, + 0.018023516982793808, + 0.004989819601178169, + 0.023816511034965515 + ], + [ + 0.011076906695961952, + 0.031182264909148216, + 0.012007826007902622, + 0.049136437475681305, + 0.03346193581819534, + 0.005219169892370701, + -0.006070154253393412, + -0.008915836922824383 + ], + [ + -0.06039215624332428, + 0.02284744754433632, + 0.05258370563387871, + -0.01826055720448494, + -0.04258096218109131, + 0.0033205035142600536, + -0.0034266761504113674, + 0.047635212540626526 + ], + [ + 0.04772625118494034, + -0.026430325582623482, + 0.044825244694948196, + -0.017986349761486053, + 0.0341675728559494, + 0.05681335926055908, + -0.004752540960907936, + 0.005222673993557692 + ], + [ + -0.03496083989739418, + 0.024655327200889587, + -0.041038334369659424, + 0.08335919678211212, + -0.05070953071117401, + -0.02722257934510708, + -0.01047928724437952, + 0.05851360410451889 + ] + ], + [ + [ + 0.018539436161518097, + -0.031072795391082764, + 0.01828347146511078, + -0.02438664250075817, + -0.0006402646540664136, + -0.01471284031867981, + -0.0009108440135605633, + 0.0392853207886219 + ], + [ + 0.006299064494669437, + 0.02086871676146984, + -0.0067701032385230064, + -0.061081331223249435, + -0.08863161504268646, + -0.005910913459956646, + 0.0006745777791365981, + 0.005549960304051638 + ], + [ + -0.011893262155354023, + 0.0128922238945961, + 0.032905638217926025, + 0.002741632517427206, + -0.04567447677254677, + -0.007184919435530901, + -0.005096022970974445, + -0.002105282386764884 + ], + [ + 0.007763864938169718, + -0.016378063708543777, + -0.011467178352177143, + -0.05448271334171295, + -0.014852250926196575, + 0.004285230301320553, + 0.0028755227103829384, + -0.02572549134492874 + ], + [ + -0.03566771373152733, + 0.009579156525433064, + -0.0026596831157803535, + 0.05540770664811134, + -0.020920025184750557, + -0.003735494799911976, + -0.0040452671237289906, + -0.004444624297320843 + ], + [ + -0.01366387028247118, + 0.013099195435643196, + 0.019855087623000145, + -0.056049980223178864, + -0.025914333760738373, + 0.04371054843068123, + -0.0023437482304871082, + -0.05624226853251457 + ], + [ + -0.01597057469189167, + -0.0377344936132431, + -0.048863485455513, + -0.018689095973968506, + 0.015524293296039104, + 0.005012843292206526, + -0.003784752683714032, + -0.0321069061756134 + ], + [ + -0.05007527023553848, + -0.06255032867193222, + 0.03361412510275841, + -0.0011421767994761467, + 0.034091465175151825, + 0.03799234703183174, + -0.011453521437942982, + 0.0526658371090889 + ] + ], + [ + [ + 0.006501532159745693, + -0.025837713852524757, + 0.03443487733602524, + -0.06032947450876236, + 0.01855378784239292, + 0.040152594447135925, + 0.0030424639116972685, + 0.04724213480949402 + ], + [ + 0.037370454519987106, + 0.011082860641181469, + -0.025391835719347, + -0.048047877848148346, + -0.07175301760435104, + 0.027214309200644493, + 0.0007823148625902832, + -0.04256632179021835 + ], + [ + -0.0012641731882467866, + 0.04462695121765137, + 0.03728390485048294, + 0.006562874652445316, + -0.02776496112346649, + 0.045290134847164154, + -0.0032099736854434013, + 0.015566847287118435 + ], + [ + 0.0005535315722227097, + -0.005157529842108488, + -0.007238923106342554, + 0.05202881991863251, + 0.003447173861786723, + 0.0028972418513149023, + -0.0032197132240980864, + -0.03417576476931572 + ], + [ + -0.008513013832271099, + -0.021638568490743637, + 0.016955487430095673, + -0.009984977543354034, + 0.0011039242381229997, + 0.0009839667472988367, + 0.0024377331137657166, + 0.004809932317584753 + ], + [ + 0.009930561296641827, + 0.007018253672868013, + -0.034343745559453964, + -0.06553688645362854, + 0.02108464017510414, + 0.048108406364917755, + -2.9305918360478245e-05, + -0.01495879702270031 + ], + [ + 0.0043256101198494434, + 0.03378714621067047, + -0.011437918059527874, + 0.05309233069419861, + -0.015358803793787956, + -0.022454027086496353, + 0.0008785944664850831, + 0.00574861653149128 + ], + [ + 0.057278405874967575, + -0.007069963030517101, + 0.0010475246235728264, + -0.015448578633368015, + -0.0048256502486765385, + 0.022158216685056686, + -0.005025345832109451, + -0.11836040765047073 + ] + ], + [ + [ + -0.002473541535437107, + -0.024702277034521103, + 0.062033966183662415, + -0.07495386898517609, + 0.0393778458237648, + 0.025798164308071136, + -0.0011138950940221548, + 0.07688309252262115 + ], + [ + 0.01678415574133396, + 0.015164772048592567, + -0.011380884796380997, + -0.08263497054576874, + -0.014480240643024445, + 0.004272907506674528, + -0.004022516310214996, + -6.776456575607881e-05 + ], + [ + 0.012436483055353165, + 0.03306320309638977, + 0.031011272221803665, + -0.10942738503217697, + -0.062067609280347824, + 0.030493762344121933, + 0.002042447216808796, + 0.1072840765118599 + ], + [ + 0.011644799262285233, + 0.01453213207423687, + 0.044995423406362534, + -0.03212178871035576, + 0.025928232818841934, + 0.02492145448923111, + 0.0013439948670566082, + -0.008292721584439278 + ], + [ + -0.0046668644063174725, + 0.021558327600359917, + 0.013774105347692966, + 0.0009372163913212717, + -0.009606842882931232, + 0.01413553487509489, + 0.0035046152770519257, + 0.029658770188689232 + ], + [ + 0.021784987300634384, + -0.02128327079117298, + -0.017649564892053604, + 0.006686487700790167, + 0.053530916571617126, + -0.0019862602930516005, + 0.0003602482902351767, + -0.0158785879611969 + ], + [ + -0.01317040715366602, + -0.019648592919111252, + 0.028327900916337967, + -0.05450237914919853, + 0.012851896695792675, + 0.02285803109407425, + 0.0015705558471381664, + 0.052603282034397125 + ], + [ + 0.012530448846518993, + 0.013197917491197586, + 0.005088343750685453, + 0.08040349930524826, + -0.0013668470783159137, + 0.037693291902542114, + -0.00679565966129303, + 0.005809059366583824 + ] + ] + ], + [ + [ + [ + 0.0029459460638463497, + 0.19821473956108093, + 0.033434439450502396, + 0.015639441087841988, + -0.019701285287737846, + -0.015185387805104256, + -0.00329160550609231, + 0.002488921396434307 + ], + [ + -0.047754574567079544, + 0.10145960748195648, + -0.008088469505310059, + 0.08839905261993408, + -0.06005287170410156, + -0.012965580448508263, + 0.004438407719135284, + -0.03443372994661331 + ], + [ + 0.0019706308376044035, + 0.06400024145841599, + 0.0013861334882676601, + 0.006690501235425472, + 0.027687549591064453, + -0.006179932504892349, + -0.0006464652833528817, + 0.026976004242897034 + ], + [ + 0.0276897381991148, + 7.432322308886796e-05, + -0.05534469708800316, + -0.09251908957958221, + 0.2637457847595215, + -0.03521440178155899, + -0.005613838788121939, + -0.0010770617518574 + ], + [ + -0.05661358684301376, + -0.039372678846120834, + -0.017899006605148315, + 0.011864234693348408, + -0.012530406937003136, + -0.006108156871050596, + -0.011167557910084724, + -0.031181491911411285 + ], + [ + -0.00649361964315176, + -0.012218613177537918, + -0.0026933825574815273, + 0.020369812846183777, + 0.010411023162305355, + -0.0008850657613947988, + -0.00654537184163928, + 0.04691559821367264 + ], + [ + 0.004079267382621765, + -0.01150798611342907, + -0.037642236799001694, + -0.05730247497558594, + 0.06200745329260826, + -0.005616017617285252, + -0.005343927536159754, + 0.0015668594278395176 + ], + [ + -0.05060950666666031, + -0.01681951805949211, + 0.012346488423645496, + -0.06051893159747124, + -0.011573690921068192, + 0.018589943647384644, + 0.00010377563739893958, + 0.06980946660041809 + ] + ], + [ + [ + -0.014525091275572777, + -0.05900352820754051, + 0.003265225328505039, + 0.010223313234746456, + 0.05825086310505867, + -0.013219972141087055, + -0.0021202852949500084, + 0.010904049500823021 + ], + [ + -0.014585461467504501, + 0.009681666269898415, + -0.0027580817695707083, + 0.045012157410383224, + -0.03864145278930664, + -0.010209256783127785, + -0.0004014124860987067, + -0.0363897942006588 + ], + [ + 0.058507587760686874, + -3.76349562429823e-05, + -0.016130834817886353, + 0.06793782114982605, + 0.03794394060969353, + -0.0010760570876300335, + -0.003734456840902567, + -0.015319695696234703 + ], + [ + 0.020102856680750847, + -0.02875906229019165, + 0.02254899963736534, + 0.15876123309135437, + 0.0008996215765364468, + -0.0013806322822347283, + -0.0021083035971969366, + -0.0220170971006155 + ], + [ + -0.0008895981591194868, + -0.027540849521756172, + 0.008349603042006493, + -0.008637739345431328, + 0.026235617697238922, + 0.009318525902926922, + -0.003419572487473488, + -0.0604780949652195 + ], + [ + 0.020707597956061363, + -0.07162978500127792, + 0.020566442981362343, + 0.00659090094268322, + -0.010225615464150906, + 0.012773234397172928, + -0.007437233347445726, + -0.0059332773089408875 + ], + [ + 0.006159077398478985, + -0.04251372441649437, + 0.0196298286318779, + 0.004783525597304106, + 0.04221025109291077, + 0.006401584018021822, + 0.0021240098867565393, + -0.0004872358695138246 + ], + [ + -0.054406750947237015, + 0.014036622829735279, + -0.02159043587744236, + -0.05033034831285477, + -0.02598651871085167, + 0.03808223828673363, + 0.005328703206032515, + -0.035146743059158325 + ] + ], + [ + [ + -0.012724393978714943, + -0.04569956287741661, + -0.0043225279077887535, + -0.015056507661938667, + 0.0639200359582901, + -0.005764475557953119, + -0.0008325689123012125, + 0.012471395544707775 + ], + [ + -0.006524702999740839, + 0.021368838846683502, + -0.03152286633849144, + 0.021848784759640694, + 0.024441156536340714, + 0.004061597865074873, + 0.004684915766119957, + -0.03595312684774399 + ], + [ + 0.045864127576351166, + 0.057343628257513046, + -0.01368139497935772, + 0.048210274428129196, + 0.053036801517009735, + -0.012537220492959023, + -0.0011267787776887417, + -0.01821090839803219 + ], + [ + 0.03492826595902443, + -0.030562138184905052, + 0.025313355028629303, + -0.08399251103401184, + 0.020710457116365433, + 0.0024003770668059587, + -0.0012503244215622544, + 0.0219674501568079 + ], + [ + -0.010560683906078339, + -0.03477929159998894, + -0.012503759935498238, + -0.01766609214246273, + -0.0037686373107135296, + 0.013774788938462734, + 0.004306974355131388, + 0.05591834336519241 + ], + [ + -0.009144579991698265, + -0.06826949864625931, + 0.032284416258335114, + -0.04957763850688934, + 0.04021494835615158, + 0.016764720901846886, + -0.005839741323143244, + 0.045722220093011856 + ], + [ + 0.026390906423330307, + -0.028742235153913498, + 0.034536004066467285, + -0.027354568243026733, + 0.01282323058694601, + 0.02250020019710064, + -0.007374163717031479, + 0.018964439630508423 + ], + [ + -0.009460007771849632, + 0.02855629473924637, + -0.008052561432123184, + 0.010923580266535282, + 0.003286743303760886, + 0.020783154293894768, + 0.0023955325596034527, + -0.008051692508161068 + ] + ], + [ + [ + -0.013342831283807755, + -0.06441285461187363, + 0.011423706077039242, + -0.021152367815375328, + 0.02137858048081398, + -0.006002894602715969, + 0.0013278172118589282, + -0.008229869417846203 + ], + [ + -0.03148617967963219, + -0.08679797500371933, + -0.005196365527808666, + 0.00801572110503912, + -0.02517620660364628, + 0.018753821030259132, + -0.0028327724430710077, + -0.022287892177700996 + ], + [ + 0.0013144876575097442, + -0.061006367206573486, + -0.02108077146112919, + 0.02278880402445793, + -0.04609819874167442, + -0.06039561331272125, + -0.0006167401443235576, + -0.06367570161819458 + ], + [ + 0.04438195750117302, + -0.005901908501982689, + -0.010757151059806347, + 0.007661420851945877, + 0.007903875783085823, + -0.01455448567867279, + -0.007049033418297768, + -0.020468324422836304 + ], + [ + -0.04187410697340965, + 0.030995408073067665, + -0.0030141437891870737, + -0.052424076944589615, + -0.16738133132457733, + 0.021417832002043724, + 0.010201969183981419, + 0.0038725195918232203 + ], + [ + -0.047995805740356445, + 0.035540178418159485, + -0.029941583052277565, + 0.05295752361416817, + 0.014444439671933651, + -0.01486233901232481, + -0.006574917118996382, + -0.03860742971301079 + ], + [ + 0.0261065736413002, + 0.015397671610116959, + -0.009133684448897839, + -0.012363946996629238, + 0.03370637074112892, + -0.021011926233768463, + -0.002044249791651964, + -0.0064743743278086185 + ], + [ + 0.029762251302599907, + 0.045706622302532196, + 0.02371714636683464, + 0.03953253850340843, + 0.07480553537607193, + 0.021622249856591225, + 0.0003765060391742736, + 0.03710540384054184 + ] + ], + [ + [ + 0.0051649692468345165, + -0.045126333832740784, + 0.018193593248724937, + 0.003313350258395076, + -8.550241545890458e-06, + -0.007161338813602924, + 0.001392774167470634, + -0.027248498052358627 + ], + [ + 0.0024361649993807077, + -0.05157935619354248, + 0.024673808366060257, + -0.0366002582013607, + -0.06297978013753891, + 0.015504693612456322, + -0.001548083615489304, + -0.007699938025325537 + ], + [ + -0.009529772214591503, + -0.05598974972963333, + 0.014410321600735188, + 0.08224589377641678, + -0.04851073771715164, + -0.04908473789691925, + 0.005685083568096161, + 0.0009345050784759223 + ], + [ + 0.04664924368262291, + 0.012643108144402504, + 0.010102152824401855, + 0.05068451911211014, + 0.038186848163604736, + -0.009808218106627464, + 0.00011305150837870315, + -0.022820988669991493 + ], + [ + -0.057595375925302505, + 0.03039691038429737, + 0.0008753836154937744, + -0.06432617455720901, + -0.14222659170627594, + 0.01699751801788807, + 0.01729421503841877, + -0.1007576510310173 + ], + [ + -0.07446979731321335, + 0.02195252664387226, + -0.0012309179874137044, + -0.004975017625838518, + -0.023749886080622673, + 0.05568702891469002, + -0.0002426196151645854, + -0.06120328977704048 + ], + [ + 0.010466614738106728, + 0.03101326711475849, + -0.004487760365009308, + 0.05773919075727463, + -0.0012565600918605924, + -0.011213166639208794, + -0.006450273562222719, + 0.01911379024386406 + ], + [ + 0.0009501230088062584, + -0.04195929691195488, + -0.0282748993486166, + -0.006600293330848217, + 0.0260772705078125, + 0.0024809767492115498, + -0.0046281153336167336, + -0.008379289880394936 + ] + ], + [ + [ + 0.023841287940740585, + -0.005377040710300207, + -0.0039022087585181, + -0.010647711344063282, + 0.020673856139183044, + -0.0065656122751533985, + -0.001689722528681159, + -0.04143419861793518 + ], + [ + 0.008448231033980846, + 0.0028190200682729483, + 0.029826952144503593, + -0.04196197912096977, + 0.005503637250512838, + 0.042276304215192795, + -0.005976627115160227, + 0.0075156050734221935 + ], + [ + 0.0014776414027437568, + -0.04586983472108841, + 0.008499638177454472, + 0.045901522040367126, + 0.026444993913173676, + -0.010359256528317928, + -0.001541005913168192, + 0.04919324815273285 + ], + [ + 0.035183850675821304, + 0.016820358112454414, + 0.03766351565718651, + -0.02132631465792656, + 0.061947017908096313, + -0.013508988544344902, + -0.0004866977396886796, + 0.05422791838645935 + ], + [ + 0.014216767624020576, + 0.06838178634643555, + -0.02754048816859722, + -0.043535761535167694, + 0.03874225914478302, + 0.04766564071178436, + 0.0034964054357260466, + 0.07884154468774796 + ], + [ + -0.02206256426870823, + -0.022103967145085335, + 0.0021510974038392305, + 0.03042840026319027, + -0.017940359190106392, + 0.034484513103961945, + -0.001323093893006444, + 0.040235280990600586 + ], + [ + -0.04556814581155777, + -0.03257528319954872, + 0.03529248759150505, + -0.008242151699960232, + -0.00102433399297297, + 0.0018892816733568907, + -0.005720595829188824, + 0.030780866742134094 + ], + [ + 0.01674829237163067, + -0.0033095187973231077, + -0.014602459967136383, + -0.010836221277713776, + -0.026840446516871452, + 0.005379301495850086, + -0.0032946921419352293, + 0.0009942216565832496 + ] + ], + [ + [ + -0.004544720519334078, + -0.0640036091208458, + -0.009615345858037472, + -0.008862191811203957, + -0.007659082766622305, + -0.0020052946638315916, + -0.002985588274896145, + -0.030718570575118065 + ], + [ + -0.001606544479727745, + -0.059962041676044464, + -0.007423589006066322, + -0.011024588719010353, + -0.04344472661614418, + 0.006930001080036163, + 0.0018014574889093637, + -0.03651970997452736 + ], + [ + 0.019638588652014732, + -0.10278598964214325, + 0.011250595562160015, + -0.03447341546416283, + -0.010817060247063637, + -0.012423223815858364, + -0.002488098805770278, + -0.007387715857475996 + ], + [ + 0.029609017074108124, + -0.01602204330265522, + -0.01217708084732294, + -0.002957794815301895, + 0.04769261181354523, + -0.017079392448067665, + -0.0022347469348460436, + 0.018047112971544266 + ], + [ + 0.014074970968067646, + -0.018841443583369255, + -0.07168933749198914, + -0.046064723283052444, + 0.1371833235025406, + -0.0022462273482233286, + -0.0054467422887682915, + 0.010330568999052048 + ], + [ + -0.009437832981348038, + 0.016872145235538483, + -0.03396496921777725, + 0.1198301687836647, + -0.05854787304997444, + 0.0213441364467144, + 0.005698705092072487, + -0.009772364981472492 + ], + [ + -0.006661652121692896, + -0.031017180532217026, + -0.006832487415522337, + -0.03783205896615982, + -0.023959437385201454, + -0.018545497208833694, + 0.004132752772420645, + -0.047137584537267685 + ], + [ + 0.0303060133010149, + 0.003366144374012947, + 0.019011344760656357, + 0.04132392629981041, + 0.01964564435184002, + -0.018731767311692238, + -0.001689974102191627, + 0.030256304889917374 + ] + ], + [ + [ + -0.010258374735713005, + -0.031084442511200905, + 0.003016372211277485, + -0.07553334534168243, + -0.024494502693414688, + 0.004715280141681433, + -0.0028998046182096004, + 0.005096904933452606 + ], + [ + -0.0035471278242766857, + -0.030268263071775436, + 0.022779423743486404, + -0.024003474041819572, + -0.045682214200496674, + 0.02943156473338604, + -0.0008202232420444489, + 0.0047785453498363495 + ], + [ + 0.03233017027378082, + -0.06889879703521729, + 0.03711891919374466, + -0.01214350014925003, + -0.04789215698838234, + 0.007853667251765728, + -0.005656060297042131, + -0.048330336809158325 + ], + [ + 0.023575128987431526, + 0.04820775240659714, + -0.006148757878690958, + 0.03783087804913521, + 0.03999221697449684, + -0.04260101169347763, + -0.005793237593024969, + -0.07145354896783829 + ], + [ + -0.00676076440140605, + -0.010046700946986675, + -0.00946863554418087, + 0.07858116924762726, + -0.083837129175663, + 0.015883387997746468, + 0.0023993952199816704, + -0.030962813645601273 + ], + [ + -0.02570742927491665, + 0.030458778142929077, + -0.0004157621006015688, + 0.04913854971528053, + 0.007138073910027742, + 0.010680140927433968, + 0.007227183785289526, + -0.043843794614076614 + ], + [ + 0.025240706279873848, + 0.0252192635089159, + 0.00825332012027502, + 0.013403719291090965, + -0.004058956168591976, + 0.00427164975553751, + 0.003033195622265339, + -0.004950947128236294 + ], + [ + -0.04411984235048294, + -0.00465633999556303, + -0.0002134806854883209, + 0.03263658285140991, + -0.04031909629702568, + -0.0061959028244018555, + -0.0028085424564778805, + -0.0038983672857284546 + ] + ], + [ + [ + -0.028988247737288475, + 0.03348380699753761, + -0.01663985848426819, + -0.01613609306514263, + -0.0395648330450058, + 0.018824540078639984, + -0.0030388981103897095, + -0.010097864083945751 + ], + [ + -0.024228861555457115, + 0.02025548368692398, + 0.02141226828098297, + -0.09286082535982132, + 0.002973195631057024, + 0.011145733296871185, + -0.005385329946875572, + 0.02013411372900009 + ], + [ + -0.0011228841030970216, + -0.03330155834555626, + 0.031740009784698486, + -0.11463329941034317, + 0.045947689563035965, + -0.004323343280702829, + -0.0031990590505301952, + 0.034296710044145584 + ], + [ + 0.0044985562562942505, + 0.06765210628509521, + 0.018444793298840523, + 0.022038081660866737, + 0.003138833912089467, + -0.007955877110362053, + 0.0071654291823506355, + 0.05158708617091179 + ], + [ + 0.02556217648088932, + -0.009231963194906712, + 0.0417652428150177, + 0.03566081076860428, + 0.00608791783452034, + 0.012274542823433876, + -0.0013604459818452597, + 0.08171442896127701 + ], + [ + 0.048068176954984665, + 0.0687163844704628, + 0.03271600604057312, + -0.018946906551718712, + 0.07844490557909012, + 0.047286391258239746, + 0.002220063703134656, + 0.05203210562467575 + ], + [ + -0.03644825518131256, + -0.01863442175090313, + 0.03178019821643829, + -0.06942281872034073, + -0.005687233991920948, + 0.020186008885502815, + -0.0007521794177591801, + 0.04474818333983421 + ], + [ + -0.04792311042547226, + -0.06843431293964386, + 0.010346954688429832, + -0.02670208550989628, + -0.008648280054330826, + 0.029584664851427078, + -0.0008742180652916431, + -0.03236931562423706 + ] + ], + [ + [ + -0.025605561211705208, + 0.01791275665163994, + -0.0033973243553191423, + 0.03411271050572395, + -0.05672892555594444, + -0.017946984618902206, + 0.0035144765861332417, + -0.03059442713856697 + ], + [ + -0.021764133125543594, + 0.0016115981852635741, + 0.01509369257837534, + -0.006958045065402985, + -0.013327976688742638, + -0.004415202420204878, + -0.00419425405561924, + -0.017800139263272285 + ], + [ + -0.02466604858636856, + -0.034436456859111786, + -0.009487292729318142, + -0.014286309480667114, + 0.07467532157897949, + -0.028208404779434204, + 0.0009866165928542614, + 0.012778172269463539 + ], + [ + 0.002418971387669444, + -0.060568667948246, + 0.02660949155688286, + 0.041015464812517166, + -0.0427030473947525, + -0.05437001958489418, + 0.0014626641059294343, + 0.017428932711482048 + ], + [ + 0.042871568351984024, + -0.03837227821350098, + -0.04178672656416893, + 0.011916520074009895, + 0.05904223397374153, + 0.000479067035485059, + -0.0009092687978409231, + 0.006472223903983831 + ], + [ + 0.012443802319467068, + 0.0071801068261265755, + -0.00383430696092546, + -0.027881614863872528, + 0.07796680927276611, + -0.010186241939663887, + 0.0006420338177122176, + -0.009771183133125305 + ], + [ + -0.025558970868587494, + 0.021338190883398056, + -0.02688872255384922, + -0.019520452246069908, + -0.06647126376628876, + -0.008087686263024807, + 0.0012401012936607003, + -0.04021579027175903 + ], + [ + -0.020278971642255783, + -0.02137376368045807, + -0.005583115387707949, + -0.03911762312054634, + 0.0335928238928318, + 0.012587126344442368, + 0.0004366787616163492, + -0.005492607597261667 + ] + ], + [ + [ + -0.015410124324262142, + -0.0007537836208939552, + -0.02400200627744198, + 0.036276817321777344, + -0.027083221822977066, + 0.0014528954634442925, + 0.0037894712295383215, + -0.008180602453649044 + ], + [ + -0.008799602277576923, + -0.00883232057094574, + 0.002940121805295348, + 0.05649504438042641, + -0.062448859214782715, + 0.014112676493823528, + -0.005638085305690765, + -0.06079447641968727 + ], + [ + 0.009509548544883728, + 0.10176727175712585, + 0.0005535470554605126, + 0.021723151206970215, + 0.0002965517633128911, + -0.026324709877371788, + -0.0014324167277663946, + -0.05443667247891426 + ], + [ + 0.017682306468486786, + -0.06970755010843277, + 0.006666190456598997, + 0.09444691985845566, + -0.06428951770067215, + -0.018832577392458916, + -0.0036018104292452335, + -0.01613272726535797 + ], + [ + 0.014106031507253647, + -0.011214378289878368, + -0.03077026456594467, + -0.019061380997300148, + -0.007965883240103722, + -0.008700680918991566, + 0.0007204700959846377, + -0.06952569633722305 + ], + [ + 0.002107115462422371, + -0.023391742259263992, + 0.008195720613002777, + 0.06709365546703339, + -0.03051491267979145, + 0.007419849280267954, + 0.0006025469629094005, + 0.0017793582519516349 + ], + [ + 0.01513664610683918, + 0.03150303289294243, + -0.016833236441016197, + 0.029711037874221802, + 0.0345449261367321, + 0.022209687158465385, + 0.005350228864699602, + -0.010145388543605804 + ], + [ + -0.003613572334870696, + 0.04562723636627197, + -0.045480795204639435, + 0.011007098481059074, + -0.043432168662548065, + -0.0048513347283005714, + 0.007528586778789759, + 0.010687176138162613 + ] + ], + [ + [ + -0.01752227172255516, + 0.0055031441152095795, + -0.01929750293493271, + -0.002642636885866523, + 0.02025410160422325, + -0.006183572579175234, + 0.0065411049872636795, + -0.007311992347240448 + ], + [ + -0.012799428775906563, + -0.009698567911982536, + 0.014207491651177406, + -0.022732336074113846, + -0.0020734851714223623, + 0.03209099546074867, + 0.0001136542996391654, + -0.02574974112212658 + ], + [ + 0.019118202850222588, + 0.05129054933786392, + 0.04159802198410034, + -7.07246654201299e-05, + 0.004199211485683918, + 0.014943798072636127, + -0.004880158230662346, + 0.006766884122043848 + ], + [ + 0.007101965602487326, + -0.06610161811113358, + 0.017025351524353027, + 0.0005800403305329382, + 0.03132067248225212, + -0.007867669686675072, + -0.004975783638656139, + 0.05782478675246239 + ], + [ + 0.019634904339909554, + 0.03958024084568024, + 0.025913141667842865, + -0.028788046911358833, + -0.011096166446805, + -0.0499618798494339, + -8.135050302371383e-05, + 0.05861790105700493 + ], + [ + 0.0363573357462883, + 0.0032399145420640707, + 0.02603045292198658, + -0.006103347521275282, + 0.06574416160583496, + 0.011972443200647831, + -0.008154521696269512, + 0.034582167863845825 + ], + [ + 0.04421309009194374, + 0.05251472815871239, + 0.010799070820212364, + 0.0438251867890358, + 0.10730314999818802, + 0.018286895006895065, + 1.3895833035348915e-05, + 0.06047044321894646 + ], + [ + 0.014447317458689213, + 0.004433473106473684, + 0.0021602618508040905, + -0.019579920917749405, + 0.003916312009096146, + 0.01042039506137371, + -0.001155766425654292, + 0.0232681967318058 + ] + ], + [ + [ + -0.02264997363090515, + -0.025229183956980705, + -0.02728128805756569, + -0.015144758857786655, + 0.01984669454395771, + -0.012981554493308067, + 0.006506231613457203, + -0.021281324326992035 + ], + [ + -0.02964099310338497, + -0.07157338410615921, + 0.029967378824949265, + 0.005038450006395578, + 0.03123730793595314, + -0.037716470658779144, + -0.002791777951642871, + -0.0620729960501194 + ], + [ + -0.02627156302332878, + -0.08576350659132004, + 0.023565104231238365, + 0.007107535842806101, + -0.010391839779913425, + -0.028402330353856087, + -0.008677246980369091, + -0.07209983468055725 + ], + [ + -0.008453728631138802, + -0.02890831045806408, + -0.015113129280507565, + -0.011552431620657444, + 0.03613197058439255, + -0.015170031227171421, + -0.004016631282866001, + 0.0011148606427013874 + ], + [ + 0.014803271740674973, + -0.017819762229919434, + 0.016025133430957794, + 0.10588965564966202, + -0.05165846645832062, + -0.039768729358911514, + -0.008099879138171673, + 0.03774939849972725 + ], + [ + 0.006740280892699957, + 0.016399888321757317, + -0.01537318155169487, + -0.03257088363170624, + 0.02401808649301529, + -0.027596116065979004, + -0.0022420065943151712, + 0.008799267932772636 + ], + [ + 0.013543138280510902, + -0.024200016632676125, + -0.011718861758708954, + 0.023548072203993797, + -0.0016348502831533551, + 0.010887732729315758, + -0.001136107719503343, + -0.004118426702916622 + ], + [ + 0.06458292156457901, + 0.03718070685863495, + 0.04229528829455376, + -0.030984969809651375, + 0.04609718918800354, + 0.05492953956127167, + 0.002894546603783965, + 0.055772051215171814 + ] + ], + [ + [ + -0.0024965780321508646, + -0.028993384912610054, + -0.002293058205395937, + -0.018619777634739876, + 0.015136456117033958, + -0.014967170543968678, + 0.006708675529807806, + -0.0024478589184582233 + ], + [ + 0.006153902970254421, + -0.07249446958303452, + 0.022479338571429253, + 0.014407443813979626, + -0.008792096748948097, + 0.0016866883961483836, + 0.0009343069978058338, + -0.09505521506071091 + ], + [ + 0.00860295444726944, + -0.05303570255637169, + -0.001302302465774119, + 0.017235970124602318, + -0.024013740941882133, + 0.0017693141708150506, + -0.0008967725443653762, + -0.10192693024873734 + ], + [ + 0.023035550490021706, + 0.024678796529769897, + 0.003699838649481535, + 0.09079743921756744, + 0.013203811831772327, + -0.013409586623311043, + -0.009336248971521854, + -0.02474495768547058 + ], + [ + 0.004616198129951954, + -0.06407904624938965, + 0.02177463099360466, + 0.0037055208813399076, + -0.02281508594751358, + -0.02285895124077797, + -0.002175993984565139, + -0.013603267259895802 + ], + [ + 0.01835746504366398, + 0.030949082225561142, + 0.0025745888706296682, + 0.06862067431211472, + -0.04572506248950958, + -0.02545926161110401, + -0.0022892006672918797, + 0.029464609920978546 + ], + [ + 0.004768331069499254, + 0.0001425641676178202, + -0.008137569762766361, + 0.052731696516275406, + 0.011472132988274097, + -0.04788065701723099, + -0.003795544384047389, + 0.015203183516860008 + ], + [ + 0.029804758727550507, + -0.008922971785068512, + -0.01886935345828533, + -0.048410460352897644, + 0.08035224676132202, + 0.005607229191809893, + -0.006964625790715218, + -0.004135118331760168 + ] + ], + [ + [ + 0.004805890843272209, + 0.010944538749754429, + -0.00724272895604372, + 0.015765029937028885, + 0.04381842166185379, + 0.009017481468617916, + 0.005251036025583744, + 0.013121486641466618 + ], + [ + -0.05255390331149101, + -0.0268009752035141, + 0.04542408511042595, + -0.060656365007162094, + 0.046029023826122284, + 0.0019712098874151707, + -0.007002915255725384, + -0.09596214443445206 + ], + [ + -0.01122364867478609, + 0.022292567417025566, + 0.013457178138196468, + -0.029449189081788063, + 0.008300167508423328, + 0.02813062258064747, + -0.0021941896993666887, + -0.022496409714221954 + ], + [ + -0.02146918512880802, + 0.01044583972543478, + 0.013188520446419716, + -0.011863569729030132, + 0.05469261482357979, + -0.004684187471866608, + -0.006663182284682989, + 0.005669219419360161 + ], + [ + -0.0007039833581075072, + -0.04612287878990173, + 0.00849486980587244, + -0.032163191586732864, + 0.06629575043916702, + -0.026979824528098106, + -0.005303226411342621, + 0.014901554211974144 + ], + [ + -0.019946005195379257, + -0.0442097932100296, + 0.04386602342128754, + 0.030713412910699844, + 0.01888064667582512, + -0.008758108131587505, + 0.001700493274256587, + 0.02586732804775238 + ], + [ + 0.02955193631350994, + 0.00939175020903349, + 0.01950749196112156, + 0.0667138397693634, + -0.011217803694307804, + -0.03697732090950012, + -0.004471417050808668, + 0.028131546452641487 + ], + [ + -0.016811570152640343, + 0.004467272665351629, + -0.015281083062291145, + 0.08018471300601959, + 0.008631901815533638, + -0.03745187819004059, + 0.002922328654676676, + -0.006530077662318945 + ] + ], + [ + [ + 0.008110510185360909, + -0.047397028654813766, + -0.01617005094885826, + -0.04685518890619278, + 0.018422827124595642, + -0.009515278972685337, + 0.0029787630774080753, + -0.02750646509230137 + ], + [ + 0.04674697667360306, + -0.07381705939769745, + 0.013685404323041439, + -0.026752766221761703, + -0.05843343585729599, + 0.013103995472192764, + -0.0034552321303635836, + -0.23540885746479034 + ], + [ + -0.041405849158763885, + -0.03723100945353508, + 0.004541249014437199, + -0.02237485907971859, + -0.062061458826065063, + -0.023265816271305084, + 0.00476656062528491, + -0.16426821053028107 + ], + [ + -0.031552962958812714, + -0.020710011944174767, + -0.003346902085468173, + 0.026225551962852478, + 0.022068778052926064, + -0.03805605322122574, + -0.0012153817806392908, + -0.0731026753783226 + ], + [ + -0.06127309054136276, + 0.038618508726358414, + -0.025099294260144234, + 0.041937779635190964, + 0.04059578850865364, + -0.02609509415924549, + 0.0010950641008093953, + -0.04223669692873955 + ], + [ + -0.020402684807777405, + -0.021423153579235077, + -0.02444944903254509, + 0.031128989532589912, + -0.011760195717215538, + -0.021109003573656082, + -0.0043780617415905, + -0.05348959565162659 + ], + [ + -0.04391954839229584, + -0.012439770624041557, + -0.024499433115124702, + 0.04883916676044464, + 0.00977744348347187, + -0.03603116422891617, + 0.002233593026176095, + -0.023763462901115417 + ], + [ + -0.006493732333183289, + 0.021408652886748314, + 0.01833018660545349, + 0.052291955798864365, + 0.028451653197407722, + -0.010765274986624718, + -0.0003462806635070592, + 0.016459455713629723 + ] + ], + [ + [ + 0.049809280782938004, + -0.03797976300120354, + -0.01014165859669447, + 0.003188735106959939, + 0.03926285356283188, + 0.01380287203937769, + 0.003860191674903035, + -0.03842084854841232 + ], + [ + 0.07935348898172379, + -0.003993764985352755, + 0.2071002721786499, + -0.047383952885866165, + -0.006026396993547678, + 0.11986826360225677, + -0.0012403352884575725, + 0.34990254044532776 + ], + [ + -0.01613704301416874, + -0.01064466405659914, + 0.027188528329133987, + 0.04680733010172844, + -0.007622920908033848, + 0.059739530086517334, + 0.003236864460632205, + 0.0013106479309499264 + ], + [ + -0.0040297540836036205, + -0.011073094792664051, + -0.023188931867480278, + 0.006294954568147659, + 0.013738567009568214, + -0.006530961021780968, + -0.00043589159031398594, + -0.08342380076646805 + ], + [ + -0.050960756838321686, + 0.014658963307738304, + -0.01702510192990303, + 0.017089279368519783, + 0.012795161455869675, + -0.005471903830766678, + 0.003481808118522167, + -0.0607883557677269 + ], + [ + 0.0037079888861626387, + 0.024536799639463425, + -0.0179922953248024, + 0.006979416124522686, + -0.0019990308210253716, + -0.004930601920932531, + -0.0025458866730332375, + -0.003419463988393545 + ], + [ + -0.040982648730278015, + -0.048234350979328156, + -0.0032995049841701984, + -0.005022265948355198, + 0.006855813320726156, + -0.004351833835244179, + 0.00439827423542738, + -0.043673232197761536 + ], + [ + 0.031409863382577896, + -0.027514103800058365, + -0.014367512427270412, + 0.1000172346830368, + 0.0192025788128376, + -0.011330770328640938, + -0.001505272462964058, + -0.048060011118650436 + ] + ], + [ + [ + 0.0382511280477047, + -0.011353477835655212, + -0.03738883510231972, + -0.025354500859975815, + 0.0427420400083065, + 0.00694043654948473, + -0.0002247666852781549, + -0.08891378343105316 + ], + [ + 0.02746877819299698, + -0.05883057415485382, + 0.1849578320980072, + -0.0941484272480011, + -0.14537321031093597, + -0.032777465879917145, + -0.004956639837473631, + 0.5106852054595947 + ], + [ + -0.04024389758706093, + -0.10272660106420517, + 0.016708476468920708, + -0.06047362461686134, + 0.004738969262689352, + -0.0024033840745687485, + -0.0014720266917720437, + 0.148383229970932 + ], + [ + 0.01038563996553421, + -0.018513238057494164, + -0.022013062611222267, + -0.025939643383026123, + 0.033418208360672, + 0.012203381396830082, + 0.003287730272859335, + 0.028212742879986763 + ], + [ + -0.02351834438741207, + 0.013557212427258492, + -0.02570902369916439, + -0.02418609894812107, + 0.05630914866924286, + 0.013821172527968884, + 0.0003592366410885006, + 0.018022190779447556 + ], + [ + -0.01768822968006134, + 0.007511049043387175, + 0.01916118897497654, + -0.047345422208309174, + -0.013661934062838554, + -0.0215950645506382, + 0.0025847232900559902, + 0.03282380849123001 + ], + [ + -0.033009275794029236, + 0.004004138056188822, + -0.011354798451066017, + 0.05054326355457306, + 0.047386135905981064, + -0.018745848909020424, + 0.003905064659193158, + -0.027320237830281258 + ], + [ + -0.013568619266152382, + -0.05913625285029411, + 0.008794344961643219, + 0.027046553790569305, + 0.028153937309980392, + -0.02700972743332386, + 0.0017994990339502692, + 0.036760251969099045 + ] + ], + [ + [ + 0.010042463429272175, + -0.03347279131412506, + -0.011372735723853111, + 0.0848800465464592, + -0.07440216839313507, + -0.057635724544525146, + 0.004980836063623428, + -0.038668327033519745 + ], + [ + -0.09631942212581635, + 0.022789349779486656, + 0.17627565562725067, + 0.04126839339733124, + -0.3494640290737152, + -0.08453928679227829, + 0.02475195750594139, + 0.1251366287469864 + ], + [ + -0.047862641513347626, + -0.030317898839712143, + 0.04935881868004799, + 0.14316228032112122, + -0.19229567050933838, + -0.0494537316262722, + 0.007961944676935673, + 0.021446386352181435 + ], + [ + -0.025282390415668488, + 0.024950513616204262, + -0.004890453536063433, + 0.030915258452296257, + -0.1452735811471939, + -0.015387503430247307, + 0.018135743215680122, + -0.0006903753383085132 + ], + [ + 0.006287628784775734, + 0.003897701855748892, + -0.022962644696235657, + 0.07070085406303406, + -0.004767225123941898, + -0.03693699464201927, + 0.00015137242735363543, + -0.007593410089612007 + ], + [ + -0.04253784939646721, + 0.02354324981570244, + -0.009950869716703892, + 0.015519632026553154, + -0.028106437996029854, + -0.020054742693901062, + 0.003356019966304302, + -0.04355114698410034 + ], + [ + 0.007335340138524771, + 0.029187221080064774, + -0.03391365334391594, + 0.04077793285250664, + -0.015619168989360332, + -0.034530676901340485, + 0.0084566380828619, + -0.014549597166478634 + ], + [ + -0.06316090375185013, + 0.013043168000876904, + 0.00794999673962593, + 0.006477026734501123, + 0.03570840135216713, + -0.035206619650125504, + -0.0013662250712513924, + 0.034254040569067 + ] + ], + [ + [ + 0.0029861358925700188, + -0.06337124854326248, + -0.04465877637267113, + 0.08964803814888, + -0.10362432897090912, + -0.049266234040260315, + 0.003805021056905389, + -0.019603990018367767 + ], + [ + -0.0895780622959137, + 0.1420552283525467, + -0.07191944122314453, + -0.08381476998329163, + -0.1184522733092308, + -0.07157671451568604, + 0.021260913461446762, + -0.31878921389579773 + ], + [ + -0.028895730152726173, + 0.0967598706483841, + 0.009153900668025017, + 0.10206630080938339, + -0.06717583537101746, + -0.05447755008935928, + 0.014717978425323963, + -0.22178183495998383 + ], + [ + -0.03026399202644825, + 0.029784854501485825, + 0.01319393701851368, + -0.056310418993234634, + -0.10051631927490234, + -0.007297959178686142, + 0.014501537196338177, + -0.10549744218587875 + ], + [ + -0.01716439239680767, + 0.026125479489564896, + 0.002378133125603199, + 0.009093890897929668, + 0.003008602187037468, + 0.005909972358494997, + 0.00573126832023263, + -0.045439381152391434 + ], + [ + -0.004498658236116171, + 0.044405899941921234, + -0.017175326123833656, + -0.007335287053138018, + 0.00782711897045374, + 0.0003536262665875256, + 0.004282181616872549, + -0.027184953913092613 + ], + [ + -0.0025032293051481247, + 0.010566153563559055, + 0.02270791120827198, + 0.07482653111219406, + -0.044766828417778015, + 0.01312959287315607, + 2.71976605290547e-05, + -0.004481526091694832 + ], + [ + -0.0013795378617942333, + 0.051116880029439926, + 0.0023425582330673933, + -0.04287543147802353, + -0.014746762812137604, + 0.043536197394132614, + -0.0005599229480139911, + -0.06660403311252594 + ] + ], + [ + [ + -0.055190298706293106, + -0.06478871405124664, + -0.02527395635843277, + 0.0779508650302887, + -0.029801104217767715, + -0.04952520877122879, + 0.0017694956623017788, + -0.007536830846220255 + ], + [ + -0.009454277344048023, + 0.19175013899803162, + -0.16160447895526886, + -0.1276593655347824, + 0.3295934796333313, + 0.1034243255853653, + 0.01213415153324604, + -0.06295820325613022 + ], + [ + 0.011540289968252182, + 0.1986331194639206, + -0.01581163890659809, + 0.01706472784280777, + 0.25461336970329285, + 0.06011219695210457, + 0.006961025297641754, + 0.060259606689214706 + ], + [ + 0.017814891412854195, + 0.08729032427072525, + -0.05055476725101471, + -0.029461154714226723, + 0.06482868641614914, + 0.014522788114845753, + 0.0076373848132789135, + 0.07067399471998215 + ], + [ + 0.037643153220415115, + 0.07791988551616669, + 0.003806464606896043, + 0.049021314829587936, + 0.0810166746377945, + 0.0473996140062809, + -0.0022908630780875683, + 0.06339994817972183 + ], + [ + 0.04084857553243637, + 0.047217756509780884, + -0.00023636828700546175, + -0.02359131909906864, + 0.09724044799804688, + 0.03253481537103653, + 0.0038101363461464643, + 0.034265607595443726 + ], + [ + 0.027942057698965073, + 0.027559053152799606, + 0.028193078935146332, + 0.002984194550663233, + 0.028973611071705818, + 0.04998542368412018, + -0.00026466301642358303, + 0.027311153709888458 + ], + [ + 0.02568562887609005, + 0.04760699346661568, + -0.028349297121167183, + -0.018974993377923965, + 0.08185894042253494, + 0.04059978201985359, + 0.003035828471183777, + 0.02145996131002903 + ] + ], + [ + [ + -0.039669230580329895, + -0.12502692639827728, + -0.03789393603801727, + 0.004486568737775087, + 0.005476782098412514, + -0.021967388689517975, + -0.001989874057471752, + -0.005589190870523453 + ], + [ + -0.0479721799492836, + -0.040070828050374985, + -0.18099381029605865, + -0.2060871422290802, + 0.5224166512489319, + -0.0035781306214630604, + -0.004411658737808466, + -0.06838925182819366 + ], + [ + -0.012038872577250004, + 0.014827894978225231, + -0.05151265859603882, + -0.04748110473155975, + 0.1096944659948349, + -0.008573917672038078, + -0.0073724593967199326, + -0.05697926506400108 + ], + [ + -0.010624151676893234, + -0.034855399280786514, + -0.07746382802724838, + -0.015093495137989521, + 0.14298908412456512, + 0.0049198223277926445, + -0.0036716971080750227, + -0.004644649103283882 + ], + [ + 0.016653018072247505, + 0.0058059124276041985, + -0.013862736523151398, + -0.007002639584243298, + 0.03965599462389946, + -0.0019435841822996736, + -0.00389310996979475, + -0.008003056049346924 + ], + [ + 0.011504396796226501, + -0.01822885312139988, + -0.011517642997205257, + -0.03536440432071686, + 0.02498389407992363, + 0.013199680484831333, + -0.00560290040448308, + -0.003469420364126563 + ], + [ + 0.03354765474796295, + 0.008283189497888088, + -0.026093412190675735, + -0.011505971662700176, + 0.04740059748291969, + 0.017312372103333473, + -0.005604044534265995, + -0.014813346788287163 + ], + [ + 0.014380654320120811, + -0.008712527342140675, + -0.004290543030947447, + 0.042244553565979004, + 0.060890570282936096, + -0.00788438506424427, + -0.0035226314794272184, + 0.010614783503115177 + ] + ], + [ + [ + -0.011946160346269608, + -0.06615898013114929, + 0.0015465209726244211, + -0.0077101923525333405, + 0.031457509845495224, + -0.017653299495577812, + 0.00034074459108524024, + -0.0012869882630184293 + ], + [ + -0.028743483126163483, + -0.052672114223241806, + -0.04101460799574852, + 0.027028676122426987, + -0.022546257823705673, + 0.03925749287009239, + -0.004240443930029869, + -0.08097334951162338 + ], + [ + -0.018557023257017136, + -0.022817077115178108, + 0.007954724133014679, + 0.04416419938206673, + -0.1330333799123764, + 0.035301219671964645, + -0.0007770677329972386, + -0.07989924401044846 + ], + [ + 0.002323554828763008, + 0.006760604679584503, + -0.01326187327504158, + 0.060078490525484085, + -0.07909104973077774, + 0.008555412292480469, + 0.0034009278751909733, + -0.042382948100566864 + ], + [ + -6.372859206749126e-05, + -0.030238797888159752, + 0.004851785022765398, + 0.0885280966758728, + -0.05576542392373085, + -0.026645472273230553, + -0.0007859714678488672, + -0.008771553635597229 + ], + [ + 0.0054193479008972645, + 0.0031669430900365114, + -0.015121735632419586, + -0.0006865183240734041, + -0.030052602291107178, + -0.026890398934483528, + -0.003600575728341937, + -0.005498580634593964 + ], + [ + -0.03174818679690361, + 0.00984191708266735, + 0.00035448261769488454, + 0.00312923826277256, + -0.05184434726834297, + -0.008834064938127995, + -0.005303752608597279, + 0.014638715423643589 + ], + [ + -0.004280957393348217, + -0.034882064908742905, + -0.00907046813517809, + 0.024464892223477364, + -0.05341317132115364, + -0.04057907685637474, + 0.005327590275555849, + -0.02177816443145275 + ] + ], + [ + [ + -0.008726265281438828, + -0.031241273507475853, + -0.005046743433922529, + 0.0313691608607769, + 0.041637714952230453, + -0.016572095453739166, + -0.0024368364829570055, + -0.018481217324733734 + ], + [ + -0.03410755842924118, + -0.0007248703041113913, + 0.005555734038352966, + -0.06606759130954742, + 0.04930194094777107, + 0.026333019137382507, + -0.006260475609451532, + -0.03616112843155861 + ], + [ + -0.012448474764823914, + -0.04975966736674309, + 0.014038750901818275, + -0.052720945328474045, + -0.03157097101211548, + 0.030704578384757042, + -0.0071716951206326485, + 0.002016379963606596 + ], + [ + 0.00878814421594143, + 0.012748278677463531, + 0.01721867173910141, + -0.052126169204711914, + 0.03265252709388733, + -0.012649687007069588, + -0.003628488164395094, + 0.06718175858259201 + ], + [ + 0.0038895769976079464, + -0.00958811491727829, + 0.0505429282784462, + -0.057388272136449814, + 0.018593106418848038, + -0.013259569182991982, + -0.0001309115905314684, + 0.026147661730647087 + ], + [ + 0.008224903605878353, + 0.015519709326326847, + 0.029173756018280983, + -0.013036210089921951, + -0.002477032598108053, + -0.0055048842914402485, + -0.003304095705971122, + 0.03785420581698418 + ], + [ + -0.020365625619888306, + 0.032439202070236206, + 0.03892289102077484, + 0.01603790558874607, + 0.00042403448605909944, + -0.03591305762529373, + -0.00010547714919084683, + 0.01118870172649622 + ], + [ + -0.042560841888189316, + 0.02668760158121586, + 0.011557512916624546, + 0.025218145921826363, + 0.0018363994313403964, + -0.013324090279638767, + 0.003422010922804475, + -0.05590112507343292 + ] + ], + [ + [ + -0.04106716066598892, + -0.0611301064491272, + -0.0025253044441342354, + 0.011446069926023483, + 0.0191210750490427, + -0.0072862207889556885, + 0.00101220584474504, + -0.03807291015982628 + ], + [ + -0.04105091094970703, + -0.09107450395822525, + -0.016959626227617264, + 0.03590273857116699, + 0.001985972048714757, + 0.003094849642366171, + -0.0004922844236716628, + -0.03706688433885574 + ], + [ + -0.004193099681288004, + -0.04388287290930748, + -0.015818022191524506, + 0.029272623360157013, + -0.03075980767607689, + 0.01542618963867426, + -0.007420070935040712, + -0.02944236248731613 + ], + [ + 0.0297514870762825, + -0.04301784560084343, + -0.03176269680261612, + -0.001212906208820641, + 0.03513515740633011, + 0.023223303258419037, + 0.0002669086679816246, + -0.015965506434440613 + ], + [ + -0.0031174030154943466, + 0.035854581743478775, + -0.03489880636334419, + 0.057853296399116516, + -0.004910539370030165, + -0.041842684149742126, + -0.001523196930065751, + -0.004314896184951067 + ], + [ + -0.01610114984214306, + -0.01983668841421604, + -0.01968805491924286, + -0.029657404869794846, + -0.04171658679842949, + -0.013687641359865665, + -0.0038205741439014673, + -0.00715381745249033 + ], + [ + 0.02991011179983616, + -0.008369083516299725, + 0.00411655567586422, + 0.01701188087463379, + -0.03158114477992058, + 0.014872487634420395, + -0.0031847625505179167, + -0.02137630619108677 + ], + [ + -0.053925562649965286, + -0.02886205166578293, + 0.009870018810033798, + -0.001029869425110519, + 0.017655594274401665, + -0.0055736456997692585, + 0.0035484249237924814, + -0.008724489249289036 + ] + ], + [ + [ + 0.00701927812770009, + -0.030416078865528107, + 0.010544314049184322, + 0.005305638536810875, + 0.02784765139222145, + 0.009854919277131557, + 0.0025099250487983227, + 0.00937142875045538 + ], + [ + 0.0024643500801175833, + -0.0493365079164505, + 0.02077294886112213, + 0.04624602943658829, + -0.016996851190924644, + 0.04152010381221771, + -0.0025625107809901237, + -0.022946447134017944 + ], + [ + 0.013112039305269718, + -0.010026464238762856, + 0.007626501843333244, + 0.007653215434402227, + -0.06451918184757233, + -0.007683750707656145, + 0.0036751222796738148, + -0.05214124545454979 + ], + [ + 0.0205803494900465, + 0.002032881835475564, + -0.0477423332631588, + 0.017152637243270874, + -0.011901430785655975, + 0.006441917270421982, + 0.006363966036587954, + -0.09391287714242935 + ], + [ + -0.01323979813605547, + 0.04040723666548729, + 0.008982043713331223, + 0.040391068905591965, + -0.01921755261719227, + -0.03926905244588852, + -0.0015439593698829412, + 0.021148109808564186 + ], + [ + -0.05351502075791359, + -0.04267168045043945, + -0.001205921289511025, + 0.028030607849359512, + 0.010540618561208248, + -0.00932981912046671, + 0.0036640074104070663, + -0.029213279485702515 + ], + [ + -0.022418836131691933, + -0.06378955394029617, + 0.005421363282948732, + -0.007480344735085964, + -0.0279279462993145, + -0.037814706563949585, + 0.0004879066545981914, + 0.06885462999343872 + ], + [ + 0.0016948521370068192, + 0.021873928606510162, + -0.04035155102610588, + 0.027428947389125824, + -0.019156822934746742, + 6.73546310281381e-05, + 0.002639091107994318, + -0.022957291454076767 + ] + ], + [ + [ + 0.01626441814005375, + -0.013014509342610836, + 0.018598061054944992, + -0.038419224321842194, + 0.00585121801123023, + 0.006884265225380659, + -0.0018306910060346127, + 0.018799804151058197 + ], + [ + 0.01558003667742014, + 0.022959383204579353, + 0.02883838675916195, + -0.033419638872146606, + -0.008810115978121758, + 0.038092706352472305, + 0.0025613734032958746, + 0.027601247653365135 + ], + [ + -0.021826719865202904, + -0.011503247544169426, + 0.01151467114686966, + -0.01989891193807125, + 0.035772111266851425, + 0.009938915260136127, + -0.004782568197697401, + 0.06205099821090698 + ], + [ + 0.010762667283415794, + 0.041394948959350586, + 0.01808459311723709, + 0.022557608783245087, + -0.0005955078522674739, + -0.050445206463336945, + 0.0030689057894051075, + 0.04568040370941162 + ], + [ + -0.01708412542939186, + -0.02796012908220291, + 0.03601212799549103, + 0.02712576650083065, + -0.02705566957592964, + 0.01220109686255455, + -0.0057345605455338955, + 0.027598144486546516 + ], + [ + -0.019382404163479805, + -0.004863439593464136, + 0.017847612500190735, + 0.04341530054807663, + 0.009790788404643536, + 0.0013697730610147119, + 0.004692838992923498, + -0.009604232385754585 + ], + [ + -0.07380198687314987, + 0.025993069633841515, + 0.01052984967827797, + -0.025869300588965416, + -0.04182388633489609, + 0.004889809060841799, + 0.00442463206127286, + 0.04190893471240997 + ], + [ + 0.010083130560815334, + 0.05228685960173607, + 0.00226407777518034, + 0.08930902928113937, + -0.008250389248132706, + -0.02574840374290943, + 0.004347664304077625, + 0.01994653418660164 + ] + ], + [ + [ + -0.019755074754357338, + -0.038699522614479065, + 0.014967100694775581, + 0.014311975799500942, + -0.05024920776486397, + -0.018762970343232155, + 0.002981468802317977, + -0.026661595329642296 + ], + [ + -0.00909067876636982, + -0.07662533968687057, + 0.0007451629498973489, + -0.025082485750317574, + -0.05266153812408447, + -0.012332229875028133, + -0.0041094208136200905, + -0.02671271190047264 + ], + [ + 0.01795917935669422, + -0.04833555966615677, + -0.0037371693179011345, + -0.03859011456370354, + 0.04069734737277031, + -0.007279652636498213, + -0.0018305334961041808, + 0.006571303121745586 + ], + [ + 0.0030788008589297533, + -0.008620834909379482, + 0.001951260375790298, + 0.11914372444152832, + -0.0215720534324646, + -0.025680119171738625, + -0.004246147815138102, + 0.028036853298544884 + ], + [ + -0.020191097632050514, + -0.0262752678245306, + -0.011717732064425945, + 0.04017695039510727, + -0.002757645444944501, + -0.03838174417614937, + -0.0028054448775947094, + -0.06628808379173279 + ], + [ + -0.005845621693879366, + 0.039850447326898575, + -0.04551276937127113, + 0.08191432803869247, + -0.06664979457855225, + 0.0137006351724267, + 0.004798038862645626, + -0.018952228128910065 + ], + [ + 0.010380040854215622, + 0.06083853170275688, + -0.003964833449572325, + -0.05252048000693321, + -0.04636746272444725, + 0.04250579699873924, + 0.0030648403335362673, + -0.05398525297641754 + ], + [ + 0.029023917391896248, + 0.022777078673243523, + 0.055280182510614395, + -0.0024481923319399357, + 0.033074550330638885, + 0.03350648656487465, + -0.007137925364077091, + 0.043541692197322845 + ] + ], + [ + [ + -0.028829751536250114, + -0.03034624271094799, + 0.04496399313211441, + -0.019273435696959496, + -0.04742882773280144, + 0.009441415779292583, + 0.0017245636554434896, + 0.02455727942287922 + ], + [ + -0.00879514031112194, + -0.05777117609977722, + 0.020123204216361046, + 0.022928908467292786, + -0.019354505464434624, + -0.0029944695997983217, + 0.0026009120047092438, + -0.0401536263525486 + ], + [ + 0.031501516699790955, + 0.033751364797353745, + -0.0200959499925375, + 0.03730952739715576, + -0.024060707539319992, + 0.031239468604326248, + -7.785034540574998e-05, + -0.07652726769447327 + ], + [ + 0.006040277890861034, + -0.04698873311281204, + 0.0025378463324159384, + 0.050605956465005875, + -0.07357335835695267, + 0.010692228563129902, + -0.0028914869762957096, + -0.024467747658491135 + ], + [ + -0.004252430982887745, + 0.02299656718969345, + 0.017749406397342682, + 0.0636751726269722, + 0.0008797513437457383, + -0.007663285825401545, + 0.004760751500725746, + -0.0006524237105622888 + ], + [ + -0.011744131334125996, + 0.012570681981742382, + 0.014638544991612434, + 0.0337052159011364, + -0.0024005016312003136, + -0.004437715746462345, + 0.001701541244983673, + -0.0024101855233311653 + ], + [ + 0.031999360769987106, + 0.03412087261676788, + -0.033345602452754974, + -0.03192172944545746, + 0.056684043258428574, + 0.03232666850090027, + -0.0003971508704125881, + 0.0036050286144018173 + ], + [ + -0.005417881533503532, + -0.023873602971434593, + -0.03400710970163345, + -0.03865869343280792, + 0.033151205629110336, + -0.003965739160776138, + 0.0015742665855214, + -0.03523140773177147 + ] + ], + [ + [ + -0.0123188691213727, + 0.031350016593933105, + 0.021476274356245995, + -0.05784156918525696, + -0.020912934094667435, + 0.03334157541394234, + 0.0013856259174644947, + 0.0447818897664547 + ], + [ + -0.015245540998876095, + 0.021314509212970734, + 0.023675963282585144, + -0.04369289055466652, + 0.018270794302225113, + 0.00968005321919918, + -0.002344967797398567, + 0.01612391509115696 + ], + [ + 0.014225889928638935, + 0.05525410175323486, + -0.02255246788263321, + -0.0463932566344738, + -0.032848067581653595, + -0.02123810350894928, + -0.0036429117899388075, + 0.028537319973111153 + ], + [ + 0.0021053897216916084, + -0.04441384598612785, + 0.008856750093400478, + -0.04490886628627777, + 0.02803010866045952, + -0.0035634059458971024, + -0.000545025453902781, + 0.05315730348229408 + ], + [ + -0.03356050327420235, + -0.0005898651434108615, + 0.006151081062853336, + 0.014562812633812428, + -0.008162456564605236, + -0.025309188291430473, + 0.004712902475148439, + 0.04000828415155411 + ], + [ + 0.04665226489305496, + 0.03039620630443096, + 0.03625529631972313, + -0.01233241893351078, + 0.02331874519586563, + 0.05002495273947716, + -0.0003114506835117936, + 0.030736133456230164 + ], + [ + 0.03856006637215614, + -0.0041898153722286224, + 0.009196599014103413, + 0.011919006705284119, + 0.09666914492845535, + -0.009606574662029743, + -0.00400934461504221, + 0.023065656423568726 + ], + [ + -0.029906494542956352, + 0.03111097402870655, + -0.024254415184259415, + 0.09017159789800644, + -0.029491320252418518, + -0.054123640060424805, + 0.0008764455560594797, + -0.05557896941900253 + ] + ], + [ + [ + -0.004175630863755941, + 0.004648002330213785, + 0.010894304141402245, + 0.0037078182213008404, + -0.0060785380192101, + -0.0005052780616097152, + 0.004390566609799862, + -0.007961456663906574 + ], + [ + 0.008059455081820488, + -0.03234574943780899, + 0.014213431626558304, + 0.007364657241851091, + -0.018933236598968506, + -0.01918230950832367, + 0.005689682438969612, + -0.005204046610742807 + ], + [ + 0.03859300538897514, + -0.07210450619459152, + 0.019609447568655014, + 0.09131435304880142, + -0.030566731467843056, + -0.04144244268536568, + 0.0009580111945979297, + 0.014187193475663662 + ], + [ + -0.04714105650782585, + 0.022457696497440338, + -0.01868017390370369, + -0.010467210784554482, + 0.023934507742524147, + -0.0159110389649868, + -0.005820594262331724, + -0.04376610368490219 + ], + [ + -0.027163032442331314, + 0.025045521557331085, + -0.026584457606077194, + -0.02032693475484848, + -0.03692464902997017, + 0.012570619583129883, + 0.004228462465107441, + -0.034726034849882126 + ], + [ + 0.027844108641147614, + 0.004370217211544514, + -0.02365996316075325, + -0.041467465460300446, + 0.003464638954028487, + -0.0034519259352236986, + -0.005707699339836836, + 0.008547413162887096 + ], + [ + -0.003404962131753564, + -0.05624905601143837, + 0.002711419714614749, + 0.06388431042432785, + -0.06813722103834152, + -0.029421987012028694, + -0.002055065706372261, + -0.03722646087408066 + ], + [ + -0.017406785860657692, + -0.04205649346113205, + 0.032785460352897644, + -0.01688799448311329, + -0.01789524219930172, + -0.0017017562640830874, + 0.0026450317818671465, + 0.011644016019999981 + ] + ], + [ + [ + 0.04823766276240349, + 0.005456159356981516, + -0.012785621918737888, + 0.014757494442164898, + -0.024128079414367676, + -0.020400620996952057, + 0.005805028602480888, + -0.058275848627090454 + ], + [ + 0.019790610298514366, + -0.011825214140117168, + -0.009105682373046875, + 0.07109034061431885, + -0.05384194850921631, + -0.011878722347319126, + 0.001651423517614603, + -0.05439893156290054 + ], + [ + 0.024190299212932587, + -0.05699789896607399, + 0.02133551798760891, + 0.09975089132785797, + -0.029153117910027504, + 0.0010964241810142994, + -0.002602700376883149, + -0.05460566282272339 + ], + [ + -0.054872702807188034, + 0.041563015431165695, + -0.00014746433589607477, + 0.002321280539035797, + -0.004039964638650417, + 0.01150511484593153, + 0.0005553708178922534, + -0.07012436538934708 + ], + [ + 0.009235251694917679, + 0.03964685648679733, + -0.015680547803640366, + 0.057399023324251175, + 0.006111305672675371, + 0.031026143580675125, + 0.0026811787392944098, + -0.008364795707166195 + ], + [ + -0.03311741724610329, + -0.011552426032721996, + -0.017869478091597557, + 0.027183115482330322, + -0.001883207936771214, + -0.033547837287187576, + -0.0017144967569038272, + 0.002095262985676527 + ], + [ + -0.04213636368513107, + 0.020250661298632622, + -0.017812032252550125, + 0.025925645604729652, + 0.00031834995024837554, + -0.037121158093214035, + 0.0029511714819818735, + -0.058897439390420914 + ], + [ + -0.011867895722389221, + -0.02909235656261444, + -0.03667827695608139, + -0.05375750735402107, + -0.06315930932760239, + 0.029468856751918793, + 0.002552744932472706, + -0.038429223001003265 + ] + ], + [ + [ + 0.016499113291502, + 0.014578362926840782, + 0.00904612522572279, + -0.013027665205299854, + 0.06451711803674698, + -0.02498728409409523, + 0.0010279084090143442, + -0.04528164491057396 + ], + [ + 0.032130662351846695, + 0.009637962095439434, + 0.029296400025486946, + -0.04765421524643898, + 0.05285235866904259, + 0.002438152674585581, + 0.0021227106917649508, + 0.035466328263282776 + ], + [ + 0.0015398277901113033, + -0.04961344972252846, + 0.03683849796652794, + -0.05135251209139824, + -0.0306890606880188, + 0.022526578977704048, + -0.00831650197505951, + 0.03787895292043686 + ], + [ + -0.024067936465144157, + 0.014857801608741283, + -0.00515251699835062, + -0.039601195603609085, + -0.008490189909934998, + -0.015465562231838703, + -0.00484308460727334, + 0.031109850853681564 + ], + [ + 0.026531415060162544, + 0.044300857931375504, + 0.00031954963924363256, + -0.02350146882236004, + 0.06283396482467651, + 0.02484520897269249, + -0.0049376762472093105, + 0.050070248544216156 + ], + [ + 0.003337228437885642, + 0.028247881680727005, + 0.03467438742518425, + 0.08629487454891205, + -0.01033877208828926, + -0.012838393449783325, + -0.004461981821805239, + 0.011900965124368668 + ], + [ + -0.04413149878382683, + -0.028393877670168877, + 0.0020796912722289562, + 0.02375110611319542, + 0.049496982246637344, + -0.016107110306620598, + -0.003821754828095436, + 0.004246436059474945 + ], + [ + 0.029047824442386627, + 0.0746879130601883, + -0.03787877783179283, + -0.006244698539376259, + -0.05021771043539047, + 0.05908486619591713, + 2.3445374608854763e-05, + -0.0369272455573082 + ] + ], + [ + [ + -0.023578515276312828, + -0.0732320174574852, + 0.028182851150631905, + -0.08169757574796677, + 0.09978170692920685, + -0.021220479160547256, + -0.0012960485182702541, + 0.0024907011538743973 + ], + [ + 0.016103319823741913, + -0.08897273242473602, + 0.006655106320977211, + -0.03408687561750412, + 0.057505156844854355, + -0.027198633179068565, + -0.0025965357199311256, + -0.03352592512965202 + ], + [ + -0.013530786149203777, + -0.024357367306947708, + -0.01440405286848545, + -0.018335707485675812, + -0.02289493940770626, + -0.008820013143122196, + -0.005710473284125328, + -0.00770311476662755 + ], + [ + -0.002925356850028038, + 0.017399447038769722, + -0.022776400670409203, + 0.12661682069301605, + -0.011674205772578716, + 0.021263714879751205, + 0.0035299318842589855, + -0.011561174876987934 + ], + [ + 0.02748972177505493, + -0.02875068038702011, + -0.0034187252167612314, + -0.0005650381208397448, + -0.02463742159307003, + 0.012273234315216541, + -0.0049965111538767815, + -0.017290696501731873 + ], + [ + 0.03993367403745651, + -0.010132942348718643, + 0.00846692081540823, + -0.007502176333218813, + -0.026540115475654602, + 0.0023193585220724344, + 0.00250883586704731, + -0.03875702619552612 + ], + [ + 0.00624600425362587, + 0.03381969407200813, + -0.0531858429312706, + 0.02054147981107235, + 0.002885937923565507, + 0.005957136396318674, + -0.0024407010059803724, + -0.007722098845988512 + ], + [ + 0.05076543241739273, + 0.05611557886004448, + 0.03240947425365448, + -0.03935427591204643, + 0.039463482797145844, + 0.03567212074995041, + -0.003169791307300329, + 0.06324541568756104 + ] + ], + [ + [ + -0.022020777687430382, + 0.016505800187587738, + 0.02251705527305603, + -0.042862121015787125, + 0.03832601010799408, + -0.01514213252812624, + -0.004434256814420223, + 0.016025718301534653 + ], + [ + 0.028758712112903595, + -0.009265787899494171, + 0.022459998726844788, + -0.02328445389866829, + 0.017665324732661247, + 0.0026569534093141556, + -0.0017988047329708934, + -0.022701380774378777 + ], + [ + -0.0005224022315815091, + 0.04559410735964775, + -0.012200670316815376, + 0.026762306690216064, + -0.05992667376995087, + 0.0021769776940345764, + -0.006994736380875111, + -0.037321943789720535 + ], + [ + -0.014389852993190289, + 0.017002493143081665, + -0.00040128821274265647, + 0.08879300206899643, + -0.018395420163869858, + -0.03133504092693329, + 0.00410481309518218, + -0.0645642951130867 + ], + [ + 0.0002717772440519184, + -0.009513511322438717, + 0.014815821312367916, + 0.047007083892822266, + -0.02960030548274517, + -0.021073853597044945, + 0.0002261377958348021, + -0.010798276402056217 + ], + [ + -0.01983822137117386, + -0.07184159755706787, + 0.02614123746752739, + -0.00563265522941947, + -0.017922313883900642, + -0.0405837781727314, + 0.0018845538143068552, + 0.04953915625810623 + ], + [ + 0.007283092942088842, + 0.039099231362342834, + 0.012761556543409824, + 0.10063011944293976, + 0.00027934013633057475, + 0.0029066079296171665, + 0.0003169078554492444, + 0.029813652858138084 + ], + [ + 0.010658487677574158, + -0.028285862877964973, + -0.0478723905980587, + 0.027957787737250328, + 0.04303066432476044, + -0.03352901712059975, + -0.0012250723084434867, + -0.12975990772247314 + ] + ], + [ + [ + -0.013537256047129631, + 0.05238577723503113, + 0.005718703847378492, + -0.06949151307344437, + 0.03302370756864548, + 0.006571685895323753, + 0.00011466589057818055, + 0.00626039132475853 + ], + [ + 0.008576955646276474, + 0.017574872821569443, + 0.04238191246986389, + -0.10857068002223969, + 0.01920907385647297, + 0.028706291690468788, + -0.001573970657773316, + 0.011989443562924862 + ], + [ + -0.006598475389182568, + 0.025117555633187294, + 0.010112421587109566, + -0.07486759126186371, + -0.034098584204912186, + 0.008741379715502262, + -0.01166967861354351, + 0.03647807613015175 + ], + [ + 0.039974093437194824, + 0.0724213570356369, + 0.030723698437213898, + -0.02665710262954235, + 0.09672828763723373, + 0.050913289189338684, + 0.0020184717141091824, + 0.040846724063158035 + ], + [ + -0.0044710393995046616, + 0.04319705441594124, + 0.02163914404809475, + 0.05784548446536064, + 0.018013354390859604, + -0.020730048418045044, + 0.00014576241665054113, + 0.053056128323078156 + ], + [ + -0.07732244580984116, + 0.012960267253220081, + 0.006965439300984144, + -0.02900182642042637, + -0.05672612413764, + 0.015393352136015892, + 0.000290620606392622, + 0.04550337791442871 + ], + [ + 0.03765431046485901, + 0.029776250943541527, + 0.041797541081905365, + 0.033305998891592026, + 0.02483319491147995, + 0.04873749613761902, + 0.0015955682611092925, + 0.049162108451128006 + ], + [ + -0.057691071182489395, + 0.03268313407897949, + -0.038149017840623856, + 0.07206942141056061, + -0.06966889649629593, + -0.026838187128305435, + -0.005664282478392124, + -0.009845499880611897 + ] + ], + [ + [ + 0.017008986324071884, + -0.03380714729428291, + 0.029887428507208824, + -0.014808248728513718, + -0.027534665539860725, + -0.018733453005552292, + 0.0014478347729891539, + 0.00510220555588603 + ], + [ + -0.009985621087253094, + 0.026287158951163292, + -5.691407204722054e-05, + 0.012011229991912842, + -0.10595933347940445, + -0.018612051382660866, + -3.840776116703637e-05, + -0.007089246995747089 + ], + [ + -0.046868033707141876, + -0.026856668293476105, + 0.012685840018093586, + 0.024001136422157288, + -0.048401013016700745, + -0.01886490359902382, + -0.0013681737473234534, + -0.04725852608680725 + ], + [ + 0.017298400402069092, + -0.0055013541132211685, + -0.034486766904592514, + -0.018276670947670937, + 0.07934970408678055, + -0.025759141892194748, + -0.0031857925932854414, + -0.017109768465161324 + ], + [ + -0.032607100903987885, + -0.014629293233156204, + -0.0040270136669278145, + -0.021674683317542076, + -0.022881701588630676, + -0.04137437418103218, + -0.0029383834917098284, + -0.016426250338554382 + ], + [ + -0.013112140819430351, + 0.04951461777091026, + -0.019426444545388222, + -0.1067165732383728, + -0.005790555849671364, + 0.015431643463671207, + 0.002745668403804302, + -0.060761287808418274 + ], + [ + -0.02718859538435936, + -0.014173204079270363, + -0.041049592196941376, + -0.0527324303984642, + 0.01959744095802307, + -0.03028767742216587, + -0.001563604106195271, + -0.03399864584207535 + ], + [ + -0.04595015197992325, + -0.07609930634498596, + -0.00949016772210598, + -0.03376895561814308, + 0.06327234208583832, + 0.029149960726499557, + -0.005461540073156357, + 0.029163913801312447 + ] + ], + [ + [ + 0.0034169231075793505, + -0.09629187732934952, + 0.04164726659655571, + -0.03187302127480507, + -0.027344170957803726, + 0.029287708923220634, + -0.005760457832366228, + 0.013712042942643166 + ], + [ + 0.03511974960565567, + -0.026796268299221992, + -0.0076391566544771194, + -0.006245866417884827, + -0.08964399993419647, + 0.024106943979859352, + -7.38082526368089e-05, + -0.03621454909443855 + ], + [ + 0.007988986559212208, + 0.014854440465569496, + 0.013902553357183933, + 0.06142263859510422, + -0.06621531397104263, + 0.04166422039270401, + 0.0027028722688555717, + -0.06668181717395782 + ], + [ + 0.007017246913164854, + -0.01532181166112423, + 0.008951706811785698, + 0.05182947590947151, + -0.05822329223155975, + -0.022058898583054543, + -0.00010043037036666647, + 0.005140329245477915 + ], + [ + -0.05488421022891998, + -0.02897132746875286, + 0.0069200280122458935, + 0.007578420452773571, + 0.01060867216438055, + -0.01873188093304634, + 0.0009334295173175633, + -0.043778449296951294 + ], + [ + 0.039265669882297516, + 0.041808925569057465, + -0.029103953391313553, + 0.006430219393223524, + 0.07768290489912033, + 0.024285344406962395, + -0.003971409518271685, + 0.0257878415286541 + ], + [ + -0.011825823225080967, + 0.026578161865472794, + -0.01706079952418804, + 0.0739683285355568, + -0.026103084906935692, + -0.020962458103895187, + -0.0009324122802354395, + -0.04519873112440109 + ], + [ + 0.05606530234217644, + 0.0011605949839577079, + -0.021185239776968956, + 0.015172949060797691, + -0.002464805729687214, + 0.013285425491631031, + -0.001909497193992138, + -0.0762360543012619 + ] + ], + [ + [ + -0.021435728296637535, + -0.09419088065624237, + 0.02435079775750637, + -0.09436185657978058, + 0.0038508623838424683, + -0.008003809489309788, + -0.010809044353663921, + 0.04777351766824722 + ], + [ + 0.006299225613474846, + -0.007912474684417248, + -0.014722801744937897, + -0.05951744318008423, + -0.0009749541059136391, + 0.00764832878485322, + -0.004682035185396671, + -0.020112313330173492 + ], + [ + 0.004490072373300791, + 0.00398431858047843, + 0.007428437937051058, + -0.08748703449964523, + -0.02641955018043518, + 0.021165696904063225, + 0.003948804922401905, + 0.058097511529922485 + ], + [ + 0.022024352103471756, + -0.010007213801145554, + 0.034138746559619904, + -0.026818471029400826, + 0.009726441465318203, + 0.008399690501391888, + 0.000750208564568311, + 0.023353861644864082 + ], + [ + -0.013152017258107662, + 0.00829852931201458, + -0.005865004379302263, + -0.01747799851000309, + 0.008446631953120232, + -0.0006678684148937464, + -0.0013256157981231809, + -0.016477907076478004 + ], + [ + 0.0238737091422081, + 0.012257738038897514, + 0.016137046739459038, + -0.009316585958003998, + 0.09303935617208481, + 0.008764083497226238, + -0.0070047397166490555, + 0.011080258525907993 + ], + [ + -0.02599562332034111, + -0.029852131381630898, + 0.013307028450071812, + 0.031022269278764725, + 0.02410108968615532, + 0.008427363820374012, + 0.007085585501044989, + 0.021932197734713554 + ], + [ + 0.024212850257754326, + 0.07384233176708221, + 0.003168053226545453, + 0.0362076573073864, + 0.017943328246474266, + 0.022166771814227104, + -0.008643457666039467, + 0.04790103808045387 + ] + ] + ] + ], + [ + 0.7729596495628357, + -1.2325631380081177, + -1.2648082971572876, + 0.9805302619934082, + -0.4909929931163788, + 1.2007927894592285, + 0.6860489249229431, + -1.6069121360778809 + ] + ] + }, + { + "type": "conv2d", + "activation": "sigmoid", + "shape": [ + 1, + null, + 264, + 1 + ], + "kernel_size_time": 5, + "kernel_size_feature": 5, + "dilation": 1, + "strides": 1, + "num_filters_in": 8, + "num_features_in": 264, + "num_filters_out": 1, + "padding": "same", + "weights": [ + [ + [ + [ + [ + 0.016679883003234863 + ], + [ + -0.128021702170372 + ], + [ + 0.07147208601236343 + ], + [ + 0.016242245212197304 + ], + [ + 0.013274486176669598 + ], + [ + 0.02510656788945198 + ], + [ + 0.015568763948976994 + ], + [ + 0.009108824655413628 + ] + ], + [ + [ + -0.007447455078363419 + ], + [ + 0.02391032874584198 + ], + [ + -0.0596187524497509 + ], + [ + -0.037649206817150116 + ], + [ + -0.057516686618328094 + ], + [ + 0.026170851662755013 + ], + [ + -0.014944711700081825 + ], + [ + -0.00040094804717227817 + ] + ], + [ + [ + 0.008153293281793594 + ], + [ + -0.019068989902734756 + ], + [ + 0.009864532388746738 + ], + [ + -0.0032323969062417746 + ], + [ + 0.0661197230219841 + ], + [ + -0.11185293644666672 + ], + [ + -0.10694694519042969 + ], + [ + -0.07777980715036392 + ] + ], + [ + [ + 0.012311486527323723 + ], + [ + 0.02185766026377678 + ], + [ + -0.017973218113183975 + ], + [ + 0.01723664253950119 + ], + [ + -0.01160167995840311 + ], + [ + 0.040646012872457504 + ], + [ + -0.061559055000543594 + ], + [ + 0.05348532646894455 + ] + ], + [ + [ + -0.02023702673614025 + ], + [ + -0.00024279020726680756 + ], + [ + -0.01547674834728241 + ], + [ + 0.010130397975444794 + ], + [ + 0.010930756106972694 + ], + [ + 0.028469489887356758 + ], + [ + 0.04519544541835785 + ], + [ + -0.04790545627474785 + ] + ] + ], + [ + [ + [ + 0.05102461576461792 + ], + [ + -0.20067743957042694 + ], + [ + -0.05216383561491966 + ], + [ + 0.04207300767302513 + ], + [ + 0.08491583913564682 + ], + [ + 0.022992391139268875 + ], + [ + -0.024609921500086784 + ], + [ + -0.011071776039898396 + ] + ], + [ + [ + 0.0034909199457615614 + ], + [ + 0.034663498401641846 + ], + [ + 0.019896848127245903 + ], + [ + -0.04734437167644501 + ], + [ + -0.07992866635322571 + ], + [ + -0.01585734635591507 + ], + [ + -0.04195094853639603 + ], + [ + 0.029470045119524002 + ] + ], + [ + [ + 0.0629817470908165 + ], + [ + -0.08380217105150223 + ], + [ + 0.018876517191529274 + ], + [ + -0.012224159203469753 + ], + [ + 0.020772220566868782 + ], + [ + -0.11878109723329544 + ], + [ + -0.08969029784202576 + ], + [ + 0.01112235989421606 + ] + ], + [ + [ + -0.04180309176445007 + ], + [ + -0.00613822927698493 + ], + [ + 0.05386653169989586 + ], + [ + 0.019927699118852615 + ], + [ + -0.027218064293265343 + ], + [ + 0.039381735026836395 + ], + [ + -0.06365182250738144 + ], + [ + 0.10195886343717575 + ] + ], + [ + [ + -0.027869082987308502 + ], + [ + 0.006061546504497528 + ], + [ + 0.051489219069480896 + ], + [ + 0.010969189926981926 + ], + [ + 0.02251950278878212 + ], + [ + 0.017676007002592087 + ], + [ + -0.02995838038623333 + ], + [ + -0.030674440786242485 + ] + ] + ], + [ + [ + [ + -0.04303281381726265 + ], + [ + -0.21798214316368103 + ], + [ + -0.048888400197029114 + ], + [ + -0.006192220374941826 + ], + [ + 0.028374776244163513 + ], + [ + -0.0485902801156044 + ], + [ + -0.12365487217903137 + ], + [ + 0.010748147033154964 + ] + ], + [ + [ + -0.06750281900167465 + ], + [ + -0.0447160080075264 + ], + [ + 0.03595679998397827 + ], + [ + -0.059524327516555786 + ], + [ + -0.06911353021860123 + ], + [ + -0.014820109121501446 + ], + [ + -0.10056499391794205 + ], + [ + -0.036829397082328796 + ] + ], + [ + [ + -0.01806182973086834 + ], + [ + 0.024007266387343407 + ], + [ + 0.06853818893432617 + ], + [ + -0.055349644273519516 + ], + [ + 0.042851127684116364 + ], + [ + -0.1845211535692215 + ], + [ + -0.22024454176425934 + ], + [ + -0.04071832075715065 + ] + ], + [ + [ + -0.06813391298055649 + ], + [ + 0.0211351178586483 + ], + [ + 0.007872648537158966 + ], + [ + -0.0021787588484585285 + ], + [ + -0.0008012835751287639 + ], + [ + -0.05006886273622513 + ], + [ + -0.15766306221485138 + ], + [ + 0.18076209723949432 + ] + ], + [ + [ + -0.13970458507537842 + ], + [ + -0.015163050033152103 + ], + [ + -0.0026446478441357613 + ], + [ + -0.020065167918801308 + ], + [ + 0.003961250185966492 + ], + [ + 0.0006623744848184288 + ], + [ + -0.1014774814248085 + ], + [ + 0.10802330076694489 + ] + ] + ], + [ + [ + [ + 0.05297314003109932 + ], + [ + -0.23177966475486755 + ], + [ + -0.07682254910469055 + ], + [ + 0.0564270094037056 + ], + [ + 0.03756331652402878 + ], + [ + 0.00989293772727251 + ], + [ + -0.05371502414345741 + ], + [ + 0.010306849144399166 + ] + ], + [ + [ + -0.013270813971757889 + ], + [ + -0.009653404355049133 + ], + [ + -0.015435706824064255 + ], + [ + -0.05973407253623009 + ], + [ + -0.0751510038971901 + ], + [ + 0.0026547126471996307 + ], + [ + -0.03729887306690216 + ], + [ + -0.023395230993628502 + ] + ], + [ + [ + 0.056267764419317245 + ], + [ + -0.08733123540878296 + ], + [ + -0.014744298532605171 + ], + [ + -0.012845702469348907 + ], + [ + 0.04558027535676956 + ], + [ + -0.14983712136745453 + ], + [ + -0.0776480957865715 + ], + [ + -0.07374297827482224 + ] + ], + [ + [ + -0.007414927240461111 + ], + [ + 0.038876280188560486 + ], + [ + 0.05389101803302765 + ], + [ + 0.02051253244280815 + ], + [ + -0.01523708924651146 + ], + [ + 0.06633607298135757 + ], + [ + -0.09799031168222427 + ], + [ + 0.2488647997379303 + ] + ], + [ + [ + -0.08481132239103317 + ], + [ + 0.014367892406880856 + ], + [ + 0.008216073736548424 + ], + [ + 0.024135196581482887 + ], + [ + 0.0212896466255188 + ], + [ + 0.04240458458662033 + ], + [ + -0.036885350942611694 + ], + [ + 0.09466194361448288 + ] + ] + ], + [ + [ + [ + 0.03750909864902496 + ], + [ + -0.2167665958404541 + ], + [ + -0.08861804753541946 + ], + [ + 0.041977882385253906 + ], + [ + 0.06682931631803513 + ], + [ + 0.018496649339795113 + ], + [ + -0.037882000207901 + ], + [ + 0.03776005655527115 + ] + ], + [ + [ + 0.009193125180900097 + ], + [ + 0.009350135922431946 + ], + [ + 0.04193103685975075 + ], + [ + -0.056976012885570526 + ], + [ + -0.12116889655590057 + ], + [ + -0.006236282642930746 + ], + [ + 0.01833466999232769 + ], + [ + 0.041518550366163254 + ] + ], + [ + [ + 0.058322202414274216 + ], + [ + -0.03371211886405945 + ], + [ + 0.009498756378889084 + ], + [ + -0.03665408864617348 + ], + [ + 0.03613840416073799 + ], + [ + -0.13574856519699097 + ], + [ + -0.08849846571683884 + ], + [ + -0.11856141686439514 + ] + ], + [ + [ + -0.09161246567964554 + ], + [ + 0.04453258216381073 + ], + [ + 0.03480077534914017 + ], + [ + 0.021419791504740715 + ], + [ + -0.032322585582733154 + ], + [ + 0.025727929547429085 + ], + [ + -0.06627663224935532 + ], + [ + 0.29526615142822266 + ] + ], + [ + [ + -0.01468608621507883 + ], + [ + 0.03223416954278946 + ], + [ + -0.02301211468875408 + ], + [ + 0.03390184044837952 + ], + [ + -0.008455291390419006 + ], + [ + 0.08001869916915894 + ], + [ + 0.06514467298984528 + ], + [ + 0.007349066901952028 + ] + ] + ] + ], + [ + -0.39454349875450134 + ] + ] + } + ] +} \ No newline at end of file diff --git a/JammLab/Resources/BasicPitchModel/cnn_note_model.json b/JammLab/Resources/BasicPitchModel/cnn_note_model.json new file mode 100644 index 0000000..7258811 --- /dev/null +++ b/JammLab/Resources/BasicPitchModel/cnn_note_model.json @@ -0,0 +1,3941 @@ +{ + "in_shape": [ + 1, + null, + 264, + 1 + ], + "layers": [ + { + "type": "conv2d", + "activation": "relu", + "shape": [ + 1, + null, + 88, + 32 + ], + "kernel_size_time": 7, + "kernel_size_feature": 7, + "dilation": 1, + "strides": 3, + "num_filters_in": 1, + "num_features_in": 264, + "num_filters_out": 32, + "padding": "same", + "weights": [ + [ + [ + [ + [ + -0.11708883941173553, + -0.19452594220638275, + 0.10938431322574615, + 0.007202035281807184, + -0.12206245213747025, + 0.11787047982215881, + 0.13403227925300598, + 0.15103401243686676, + 0.0387299619615078, + -0.24664495885372162, + -0.3668864667415619, + -0.14844848215579987, + -0.057101309299468994, + -0.19832617044448853, + -0.05611518397927284, + 0.11263248324394226, + -0.12089721858501434, + -0.05067583546042442, + 0.12908069789409637, + 0.19972148537635803, + 0.022706447169184685, + 0.0010653682984411716, + 0.01300298422574997, + 0.20689323544502258, + 0.05414550378918648, + -0.13188804686069489, + -0.1414002925157547, + 0.4155833423137665, + -0.08120333403348923, + -0.055191751569509506, + 0.11057349294424057, + 0.020664755254983902 + ] + ], + [ + [ + -0.11443283408880234, + -0.1856795847415924, + 0.17184773087501526, + 0.09186991304159164, + -0.25372594594955444, + 0.2642097473144531, + 0.07229030132293701, + 0.28348585963249207, + -0.011309812776744366, + -0.22908274829387665, + -0.205229252576828, + 0.019870394840836525, + 0.22793863713741302, + 0.08741559833288193, + -0.040628157556056976, + 0.23227553069591522, + -0.01957688108086586, + 0.10689259320497513, + -0.026667501777410507, + -0.12034133821725845, + 0.1001390591263771, + -0.07946783304214478, + -0.22240322828292847, + 0.2799980044364929, + 0.11113842576742172, + 0.006825054995715618, + -0.17400692403316498, + -0.20201922953128815, + 0.035007547587156296, + 0.19805683195590973, + -0.07525952905416489, + 0.14702878892421722 + ] + ], + [ + [ + 0.039194006472826004, + 0.13654977083206177, + 0.12615253031253815, + 0.11365017294883728, + 0.043647442013025284, + -0.12523652613162994, + -0.051202598959207535, + -0.0712478831410408, + -0.06145394593477249, + -0.11816855520009995, + -0.0757160484790802, + 0.08958417922258377, + 0.1980004906654358, + -0.02030346728861332, + 0.13136257231235504, + 0.11081673949956894, + 0.11723494529724121, + 0.008741282857954502, + 0.05789032578468323, + 0.13302433490753174, + -0.0019152864115312696, + -0.07813972979784012, + -0.18061906099319458, + -0.06316013634204865, + 0.16062615811824799, + -0.05010630190372467, + -0.06030900031328201, + 0.018524503335356712, + -0.13636520504951477, + 0.16547031700611115, + -0.04784770309925079, + 0.15652477741241455 + ] + ], + [ + [ + 0.12969009578227997, + -0.11555441468954086, + -0.057522002607584, + 0.032404836267232895, + 0.02346804551780224, + -0.04852784425020218, + 0.11547274142503738, + -0.07200286537408829, + 0.05822090804576874, + -0.06117553263902664, + -0.07247526943683624, + -0.04134742543101311, + -0.23205408453941345, + 0.19851985573768616, + 0.016085773706436157, + 0.15247446298599243, + -0.038989923894405365, + -0.35834309458732605, + -0.2970220446586609, + -0.17909066379070282, + -0.09911540150642395, + -0.3702613115310669, + 0.18566009402275085, + -0.1480153501033783, + -0.12686102092266083, + -0.1514321118593216, + -0.27302759885787964, + -0.04371865093708038, + 0.1927342265844345, + 0.21586793661117554, + 0.10154204815626144, + -0.15174153447151184 + ] + ], + [ + [ + -0.2312408983707428, + 0.0883309468626976, + 0.056717753410339355, + 0.05226792395114899, + 0.029863441362977028, + -0.06341011077165604, + -0.019306141883134842, + -0.1031900942325592, + -0.09836083650588989, + -0.03481394052505493, + -0.03330066800117493, + -0.01065779384225607, + -0.24406857788562775, + 0.006804195232689381, + -0.18143606185913086, + -0.06572779268026352, + -0.06353428959846497, + -0.03082781471312046, + 0.05938186123967171, + -0.14558853209018707, + -0.028040358796715736, + -0.08931368589401245, + -0.13068057596683502, + -0.10480858385562897, + 0.1327344924211502, + -0.05093097686767578, + -0.09121434390544891, + -0.014685703441500664, + -0.09498819708824158, + 0.10092326253652573, + -0.2060464471578598, + 0.028271783143281937 + ] + ], + [ + [ + -0.22223280370235443, + -0.005505282897502184, + -0.051001522690057755, + -0.10070331394672394, + -0.2306332141160965, + -0.1694338321685791, + 0.10031980276107788, + -0.04963964596390724, + 0.17200574278831482, + -0.020666932687163353, + -0.045788004994392395, + 0.07348765432834625, + 0.14110417664051056, + -0.19395866990089417, + 0.19556638598442078, + -0.041692670434713364, + -0.12697076797485352, + -0.015401387587189674, + 0.06332430988550186, + 0.010355581529438496, + -0.14017948508262634, + -0.051307015120983124, + 0.08324353396892548, + -0.19815082848072052, + -0.241670623421669, + -0.13688664138317108, + -0.029369408264756203, + -0.03634951636195183, + -0.012321673333644867, + 0.09393282234668732, + -0.17011718451976776, + 0.3362341821193695 + ] + ], + [ + [ + 0.14818699657917023, + -0.09653604030609131, + 0.18347428739070892, + -0.2667427659034729, + -0.08261837810277939, + 0.0037577988114207983, + -0.4966585636138916, + 0.020011400803923607, + 0.05141795426607132, + -0.00023311398399528116, + -0.16246232390403748, + 0.3032681941986084, + -0.12019646167755127, + -0.15213394165039062, + -0.005581629928201437, + 0.003516741329804063, + -0.3665984272956848, + 0.021285906434059143, + 0.20956094563007355, + -0.015461785718798637, + -0.2796909809112549, + 0.05709336698055267, + 0.1707082986831665, + 0.10577668994665146, + 0.07080777734518051, + -0.3669239580631256, + -0.006680692546069622, + 0.0773438811302185, + -0.4846390187740326, + -0.1197507306933403, + 0.04718130826950073, + 0.14926443994045258 + ] + ] + ], + [ + [ + [ + -0.1540714055299759, + -0.37844526767730713, + -0.10174828767776489, + 0.13378386199474335, + -0.03985161706805229, + 0.18594159185886383, + -0.0058143651112914085, + 0.1804114282131195, + -0.056306444108486176, + -0.22201642394065857, + -0.21992281079292297, + 0.15220166742801666, + -0.1884101927280426, + -0.024200158193707466, + -0.08004993945360184, + 0.13437892496585846, + -0.0024410930927842855, + 0.0825313851237297, + 0.08585494011640549, + -0.0819643959403038, + 0.08288387954235077, + 0.05522717162966728, + -0.07793254405260086, + 0.21386145055294037, + 0.08971448987722397, + -0.03138935938477516, + -0.13160845637321472, + 0.08406959474086761, + -0.10411883145570755, + -0.0029358884785324335, + -0.06355412304401398, + -0.04568192735314369 + ] + ], + [ + [ + -0.1901850700378418, + -0.13371676206588745, + 0.16966857016086578, + 0.08415781706571579, + -0.2885555326938629, + 0.2889115810394287, + -0.016150685027241707, + 0.31119096279144287, + -0.112638458609581, + -0.20955875515937805, + -0.08231185376644135, + -0.02020009234547615, + -0.17107141017913818, + -0.005707751959562302, + -0.11789777129888535, + 0.23960880935192108, + -0.11185145378112793, + 0.06899945437908173, + 0.04308818653225899, + 0.12596891820430756, + 0.037851203233003616, + -0.1275034248828888, + 0.014473604038357735, + 0.12326690554618835, + -0.022738106548786163, + -0.10767405480146408, + -0.18591102957725525, + -0.17134353518486023, + 0.002137599978595972, + 0.18846146762371063, + -0.2945176661014557, + 0.09318078309297562 + ] + ], + [ + [ + -0.01506183110177517, + 0.026518166065216064, + 0.037574365735054016, + -0.030383286997675896, + -0.08060362935066223, + -0.046711038798093796, + -0.0024775571655482054, + -0.03821863234043121, + 0.14702413976192474, + -0.08813522011041641, + 0.08244572579860687, + -0.01960703171789646, + -0.22314737737178802, + 0.1954738199710846, + -0.13443565368652344, + 0.1497841626405716, + 0.11753726750612259, + 0.05300235003232956, + 0.12033683061599731, + -0.12205014377832413, + -0.03828907757997513, + 0.07511457800865173, + -0.12816254794597626, + -0.07240338623523712, + -0.1617216318845749, + -0.06288450211286545, + -0.062023378908634186, + -0.03171315789222717, + -0.005270006600767374, + 0.0650922954082489, + 0.11334860324859619, + -0.02836896851658821 + ] + ], + [ + [ + 0.07166384905576706, + 0.01580890454351902, + -0.2629845142364502, + -0.11183708161115646, + 0.024396385997533798, + -0.00953548401594162, + 0.05440661311149597, + -0.05770133063197136, + 0.076400525867939, + -0.08332423120737076, + 0.00472627067938447, + 0.07912874966859818, + 0.05525252968072891, + -0.10825855284929276, + -0.02800426259636879, + 0.09262219816446304, + 0.12491712719202042, + -0.32595980167388916, + -0.18538838624954224, + -0.29414570331573486, + -0.04573819786310196, + -0.27577635645866394, + 0.021562425419688225, + 0.08773324638605118, + 0.04615926370024681, + -0.006254348438233137, + -0.2362421751022339, + 0.049396052956581116, + 0.09663558006286621, + 0.18126586079597473, + -0.11490882933139801, + 0.004216160625219345 + ] + ], + [ + [ + -0.013554956763982773, + -0.0164579376578331, + -0.07156388461589813, + 0.012807847931981087, + 0.1286456435918808, + -0.040382541716098785, + 0.09567037224769592, + -0.07149102538824081, + -0.012117371894419193, + -0.04215741902589798, + -0.01602158509194851, + -0.04399194195866585, + -0.08033500611782074, + 0.09432216733694077, + -0.24695920944213867, + -0.008123096078634262, + 0.053283970803022385, + -0.028612354770302773, + 0.08969239145517349, + -0.17407789826393127, + -0.06811032444238663, + 0.04035453870892525, + 0.17114390432834625, + -0.019102897495031357, + 0.03533383831381798, + 0.05006435886025429, + -0.08747655898332596, + -0.05635329708456993, + -0.13178850710391998, + 0.0658356174826622, + -0.1845405399799347, + 0.15119479596614838 + ] + ], + [ + [ + 0.1293942928314209, + -0.17774698138237, + 0.05988479033112526, + -0.1422029584646225, + -0.1386297345161438, + -0.17120032012462616, + 0.018583031371235847, + -0.026204371824860573, + 0.11385013908147812, + 0.10185075551271439, + -0.09680387377738953, + 0.2374337762594223, + 0.1960628777742386, + -0.15362395346164703, + 0.038251470774412155, + -0.0435275062918663, + -0.14085523784160614, + -0.04634806886315346, + 0.02820012904703617, + -0.13884054124355316, + -0.15679718554019928, + -0.004787642043083906, + -0.06749222427606583, + -0.20914185047149658, + -0.20731121301651, + -0.1431596428155899, + -0.029033023864030838, + -0.20217645168304443, + -0.02043933793902397, + -0.20703600347042084, + 0.09920328855514526, + 0.22570988535881042 + ] + ], + [ + [ + 0.08069615811109543, + -0.06645037233829498, + 0.048413343727588654, + -0.2463916689157486, + -0.015763763338327408, + -0.05539650470018387, + -0.3127334415912628, + 0.008066678419709206, + -0.21424423158168793, + 0.19372662901878357, + 0.033520858734846115, + 0.2543342113494873, + 0.009249771945178509, + -0.18182609975337982, + -0.017724616453051567, + -0.0020914003252983093, + -0.25670871138572693, + -0.03572705015540123, + 0.11982402950525284, + 0.11265172809362411, + -0.21371789276599884, + 0.04396288841962814, + 0.009920922107994556, + -0.07112608850002289, + -0.09128760546445847, + -0.26941388845443726, + 0.017413070425391197, + -0.0006851664511486888, + -0.23303726315498352, + -0.14033794403076172, + 0.18971848487854004, + -0.03187130391597748 + ] + ] + ], + [ + [ + [ + 0.04652724415063858, + -0.09543801099061966, + 0.04655604809522629, + 0.17380432784557343, + -0.17838479578495026, + 0.200168177485466, + 0.0023534917272627354, + 0.2023957520723343, + 0.18753398954868317, + -0.10985594987869263, + -0.2447877824306488, + -0.11990109086036682, + -0.14309504628181458, + -0.04914132133126259, + -0.022842882201075554, + 0.18733738362789154, + -0.06476813554763794, + 0.017399528995156288, + 0.059817276895046234, + 0.22503116726875305, + 0.08941689878702164, + 0.06546414643526077, + -0.04162872955203056, + 0.2719559371471405, + 0.07313785701990128, + -0.08162593096494675, + -0.1066998764872551, + 0.24402596056461334, + -0.08926104754209518, + -0.16737186908721924, + 0.09951648116111755, + -0.005696787498891354 + ] + ], + [ + [ + -0.0503203421831131, + -0.10945917665958405, + 0.08199308812618256, + 0.0251240823417902, + -0.222053661942482, + 0.28803691267967224, + -0.02965216524899006, + 0.33852288126945496, + 0.02884073369204998, + -0.15145185589790344, + -0.04565830156207085, + 0.08703245967626572, + 0.14648081362247467, + -0.07365509122610092, + 0.15118253231048584, + 0.32579705119132996, + -0.06988377124071121, + 0.09045311063528061, + 0.0557277612388134, + 0.18942932784557343, + 0.10986095666885376, + 0.0385596938431263, + -0.11498430371284485, + 0.22683142125606537, + 0.2196723073720932, + 0.026587404310703278, + -0.16168087720870972, + -0.11078260838985443, + 0.09840688854455948, + -0.1473722904920578, + -0.1135183721780777, + -0.13371777534484863 + ] + ], + [ + [ + 0.12295711785554886, + 0.0036289673298597336, + -0.14304746687412262, + -0.040661826729774475, + 0.01243723277002573, + -0.03835202381014824, + -0.02591969445347786, + 0.0012211345601826906, + 0.07047077268362045, + 0.09468485414981842, + 0.08180096745491028, + 0.009793257340788841, + 0.0958094596862793, + 0.10788628458976746, + 0.0012326518772169948, + 0.17856086790561676, + 0.04260699823498726, + 0.03542056307196617, + 0.14201968908309937, + -0.04713642969727516, + 0.03337686508893967, + 0.028252268210053444, + 0.14256802201271057, + -0.09781243652105331, + 0.09481257200241089, + 0.11915343254804611, + -0.043410081416368484, + -0.06140146777033806, + -0.17982353270053864, + 0.1980361044406891, + -0.0355975404381752, + 0.17130529880523682 + ] + ], + [ + [ + 0.14015470445156097, + -0.01862693764269352, + -0.06248863413929939, + -0.0004223081923555583, + 0.034742482006549835, + 0.058861248195171356, + 0.012083359993994236, + -0.03440845385193825, + 0.015554872341454029, + -0.05478677526116371, + 0.0434761606156826, + 0.14554017782211304, + 0.11342672258615494, + -0.22691433131694794, + -0.10501424968242645, + 0.08595350384712219, + 0.021518846973776817, + -0.2681559920310974, + -0.04575375095009804, + -0.09596486389636993, + -0.04989052563905716, + -0.19454428553581238, + 0.07798506319522858, + 0.06938187777996063, + 0.1146954745054245, + -0.0006241063238121569, + -0.23677058517932892, + -0.005818075500428677, + 0.06442005187273026, + 0.08693105727434158, + 0.12829160690307617, + -0.10973742604255676 + ] + ], + [ + [ + -0.08726689219474792, + 0.07908809185028076, + 0.03729342296719551, + 0.07577862590551376, + 0.165570467710495, + -0.008009684272110462, + -0.061377089470624924, + -0.039324868470430374, + -0.06435513496398926, + 0.08384866267442703, + 0.022113248705863953, + 0.09476249665021896, + -0.18550902605056763, + -0.007574068382382393, + -0.13076284527778625, + 0.0019966091495007277, + 0.0641251653432846, + 0.0004995253402739763, + 0.18782085180282593, + 0.07537797093391418, + 0.01885211281478405, + 0.07285331934690475, + -0.13446833193302155, + 0.01921495795249939, + -0.03945116326212883, + 0.057511892169713974, + -0.07489868998527527, + -0.009136810898780823, + 0.020572297275066376, + 0.194627046585083, + 0.1422254592180252, + -0.15815423429012299 + ] + ], + [ + [ + -0.1872774064540863, + -0.13934923708438873, + 0.16864745318889618, + -0.06767098605632782, + -0.11155892163515091, + -0.12980948388576508, + 0.0400499552488327, + -0.0044334870763123035, + -0.18410052359104156, + 0.11772496998310089, + -0.016424261033535004, + -0.14680714905261993, + -0.06411828100681305, + -0.19259890913963318, + 0.04675254970788956, + 0.011670749634504318, + 0.03485419973731041, + -0.03539559245109558, + 0.10774319618940353, + 0.04047839343547821, + -0.10706860572099686, + 0.0509989857673645, + 0.1960449069738388, + -0.14301955699920654, + -0.1503044217824936, + -0.010090311989188194, + -0.00833138171583414, + -0.027942245826125145, + -0.003862101584672928, + -0.08315813541412354, + -0.11716219782829285, + 0.1506308913230896 + ] + ], + [ + [ + -0.09295669943094254, + 0.014497664757072926, + 0.09932821989059448, + -0.22237999737262726, + -0.12834130227565765, + -0.00634056655690074, + -0.1646723449230194, + 0.010053574107587337, + 0.18569985032081604, + 0.09368041157722473, + -0.0786009430885315, + 0.03087880276143551, + 0.2673284113407135, + -0.14952270686626434, + 0.1289447396993637, + -0.002023849403485656, + -0.1967427134513855, + -0.022610994055867195, + 0.0720302015542984, + 0.1378668248653412, + -0.2234308272600174, + -0.04966180399060249, + 0.24726705253124237, + 0.03248891234397888, + 0.12677781283855438, + -0.15916591882705688, + 0.047688331454992294, + 0.18149210512638092, + -0.12586894631385803, + -0.2047610580921173, + 0.13636496663093567, + -0.17728683352470398 + ] + ] + ], + [ + [ + [ + 0.12830907106399536, + -0.14701169729232788, + -0.08297660201787949, + 0.23650720715522766, + 0.03424891084432602, + 0.21220842003822327, + -0.07757566124200821, + 0.22175903618335724, + 0.18309693038463593, + -0.18688899278640747, + -0.16144579648971558, + -0.1981787532567978, + 0.26352569460868835, + 0.09973467886447906, + 0.21607349812984467, + 0.2095813900232315, + 0.0528109148144722, + 0.07530608028173447, + 0.021862490102648735, + 0.23334330320358276, + 0.246450275182724, + 0.1277681291103363, + -0.24073471128940582, + 0.2962118089199066, + 0.22248175740242004, + 0.11178957670927048, + -0.0659247413277626, + 0.11610033363103867, + -0.051184143871068954, + 0.12253361195325851, + -0.1687205284833908, + 0.1992027461528778 + ] + ], + [ + [ + -0.05035751685500145, + -0.1592637300491333, + 0.1494957059621811, + 0.17290887236595154, + -0.03948067128658295, + 0.2839743494987488, + 0.006958326790481806, + 0.34552156925201416, + 0.24911755323410034, + -0.127232626080513, + -0.05793449655175209, + -0.015555720776319504, + -0.05879364162683487, + -0.08649285137653351, + 0.09523740410804749, + 0.3102458715438843, + 0.040082771331071854, + 0.09629127383232117, + 0.014807941392064095, + -0.025858411565423012, + 0.24810703098773956, + 0.0951182022690773, + -0.12327103316783905, + 0.2392807900905609, + 0.16160529851913452, + 0.07451526075601578, + -0.10442811995744705, + -0.2577698826789856, + 0.0010722856968641281, + 0.028518302366137505, + -0.12451852858066559, + -0.11371757835149765 + ] + ], + [ + [ + 0.24513664841651917, + 0.08601654320955276, + 0.133794367313385, + 0.17387698590755463, + 0.12257994711399078, + -0.041819289326667786, + -0.1716683804988861, + 0.021990828216075897, + 0.03784411400556564, + 0.12368529289960861, + 0.1891053169965744, + -0.17915783822536469, + -0.036873914301395416, + 0.17981697618961334, + -0.10973276197910309, + 0.1872469037771225, + 0.1170428991317749, + 0.09202050417661667, + 0.20639106631278992, + 0.010358241386711597, + 0.17383643984794617, + 0.19238176941871643, + -0.013795184902846813, + 0.02159370481967926, + -0.16026176512241364, + 0.22563016414642334, + 0.023033667355775833, + -0.06396883726119995, + -0.19005553424358368, + 0.10688503086566925, + -0.03284412622451782, + -0.14933273196220398 + ] + ], + [ + [ + 0.20750683546066284, + 0.09543666988611221, + -0.2017553448677063, + 0.12226210534572601, + 0.107066810131073, + 0.03751912713050842, + 0.004404050763696432, + -0.01692260056734085, + 0.06754974275827408, + -0.07976728677749634, + 0.03975127637386322, + -0.021674472838640213, + 0.01572556421160698, + 0.1882699429988861, + 0.04897202551364899, + -0.0008555027889087796, + 0.2053101360797882, + -0.25102829933166504, + 0.139070063829422, + -0.01903705485165119, + 0.04954713582992554, + -0.16446274518966675, + 0.1145738735795021, + -0.16692298650741577, + 0.16758683323860168, + 0.015144125558435917, + -0.22748219966888428, + -0.08467388898134232, + 0.056741807609796524, + 0.16566865146160126, + 0.05459921061992645, + 0.15508008003234863 + ] + ], + [ + [ + -0.09294764697551727, + 0.12382551282644272, + -0.16981159150600433, + 0.17921082675457, + 0.22637353837490082, + -0.030599331483244896, + 0.026564883068203926, + -0.021887538954615593, + -0.1313239485025406, + 0.15540215373039246, + 0.09475351125001907, + -0.14683784544467926, + -0.00596637325361371, + 0.15938907861709595, + 0.17972274124622345, + -0.01077537052333355, + 0.08149024099111557, + 0.02725963294506073, + 0.19592325389385223, + 0.02608909271657467, + 0.10425993800163269, + 0.00429944833740592, + 0.10487641394138336, + -0.013577882200479507, + -0.11647003889083862, + 0.14648586511611938, + -0.012055317871272564, + 0.0167158804833889, + -0.058700527995824814, + 0.20404376089572906, + -0.19732078909873962, + -0.03587520122528076 + ] + ], + [ + [ + -0.050622258335351944, + 0.1606026142835617, + 0.09910140931606293, + 0.0194650050252676, + -0.058097440749406815, + -0.1428125500679016, + 0.11947163194417953, + 0.014760967344045639, + 0.16031502187252045, + 0.2042006552219391, + 0.11591412127017975, + 0.21197810769081116, + 0.04638773575425148, + -0.05149068310856819, + 0.20466871559619904, + 0.038414761424064636, + 0.10550049692392349, + 0.03683137893676758, + 0.03924018144607544, + 0.1073211058974266, + 0.04145659878849983, + -0.02934686839580536, + 0.013718537986278534, + -0.21951991319656372, + -0.15161195397377014, + 0.10250663757324219, + 0.044723860919475555, + -0.13242937624454498, + 0.06546403467655182, + 0.03254445269703865, + 0.026633748784661293, + -0.07913946360349655 + ] + ], + [ + [ + 0.1192924901843071, + 0.05578310415148735, + 0.2605739235877991, + -0.10183604806661606, + -0.04686896875500679, + -0.0618010088801384, + 0.1410081684589386, + 0.020472466945648193, + 0.14369498193264008, + 0.13621723651885986, + 0.11880689859390259, + -0.1655154824256897, + 0.04967678338289261, + 0.21227380633354187, + 0.159938782453537, + -0.005199520383030176, + -0.15863989293575287, + 0.06337156891822815, + -0.00024917221162468195, + -0.008681398816406727, + -0.14453792572021484, + 0.02025822550058365, + -0.02729865349829197, + 0.008332625962793827, + 0.14705072343349457, + -0.07630930095911026, + 0.09698576480150223, + -0.04837418347597122, + 0.038616761565208435, + -0.15053950250148773, + -0.08126131445169449, + 0.25570401549339294 + ] + ] + ], + [ + [ + [ + -0.024384010583162308, + -0.12738673388957977, + 0.1823664903640747, + 0.11112954467535019, + -0.02158152312040329, + 0.1952752023935318, + -0.007189960218966007, + 0.21713389456272125, + 0.05243241786956787, + -0.24747823178768158, + -0.19884076714515686, + -0.05414660647511482, + 0.1812210977077484, + -0.20820137858390808, + 0.21111775934696198, + 0.18636083602905273, + -0.05113726109266281, + 0.08864453434944153, + -0.02471212111413479, + 0.19365547597408295, + 0.18251684308052063, + -0.012725383043289185, + -0.2068438082933426, + 0.1630687713623047, + 0.12028706073760986, + -0.13241246342658997, + -0.10237456113100052, + 0.07936065644025803, + 0.08803704380989075, + -0.08578353375196457, + 0.13627488911151886, + 0.07378101348876953 + ] + ], + [ + [ + 0.07118833810091019, + -0.1345667690038681, + -0.1399020403623581, + 0.11456406116485596, + 0.0007604443817399442, + 0.2596048414707184, + -0.03623165935277939, + 0.29796361923217773, + 0.1114932969212532, + -0.10944055765867233, + -0.09185787290334702, + 0.14951984584331512, + 0.09417351335287094, + 0.007205495610833168, + -0.19930927455425262, + 0.30891820788383484, + -0.052924320101737976, + 0.048336468636989594, + 0.05299406871199608, + 0.17924711108207703, + 0.10333672165870667, + -0.05716473609209061, + 0.00906759686768055, + 0.018077734857797623, + 0.044412583112716675, + 0.039592087268829346, + -0.14631810784339905, + -0.2758149802684784, + 0.0073885489255189896, + 0.1017255038022995, + -0.1364510953426361, + 0.13241799175739288 + ] + ], + [ + [ + 0.10914243757724762, + 0.12957438826560974, + -0.1560436189174652, + 0.0031689549796283245, + 0.09544037282466888, + -0.022731421515345573, + -0.06037468835711479, + -0.015214849263429642, + -0.11706586927175522, + -0.05937238782644272, + 0.10490360856056213, + -0.08531629294157028, + -0.1294582039117813, + -0.18524858355522156, + 0.04528539627790451, + 0.1254340559244156, + 0.12285690754652023, + 0.08447546511888504, + 0.2340775728225708, + -0.06263583153486252, + 0.02566927671432495, + -0.010305039584636688, + 0.02892843447625637, + -0.14274358749389648, + -0.12712794542312622, + 0.020181804895401, + -0.030347470194101334, + 0.11965312063694, + -0.07683148980140686, + 0.08854246139526367, + 0.023362580686807632, + 0.06618522852659225 + ] + ], + [ + [ + -0.10667268186807632, + 0.1076410636305809, + -0.008682052604854107, + 0.04632669314742088, + 0.002179035684093833, + 0.028555765748023987, + -0.04944392293691635, + -0.04129118099808693, + -0.10904213041067123, + 0.03822998329997063, + -0.0680253803730011, + 0.04849190637469292, + -0.11820375919342041, + -0.14438244700431824, + -0.31288614869117737, + -0.0360538586974144, + 0.06807184219360352, + -0.28391095995903015, + 0.2188928872346878, + -0.3311258554458618, + -0.044462401419878006, + -0.37263092398643494, + -0.002406165935099125, + 0.030746275559067726, + 0.08589443564414978, + 0.025289082899689674, + -0.3113064765930176, + -0.01794354058802128, + 0.023188520222902298, + 0.09192637354135513, + 0.08096962422132492, + -0.0001345526397926733 + ] + ], + [ + [ + 0.07497958838939667, + 0.05705508217215538, + 0.18277202546596527, + 0.01169783528894186, + 0.18526212871074677, + -0.030082812532782555, + 0.00738753704354167, + -0.05486052855849266, + 0.03147035464644432, + 0.03368198499083519, + 0.15097370743751526, + 0.18759363889694214, + -0.20814578235149384, + 0.032596565783023834, + -0.14116120338439941, + -0.05568866804242134, + 0.012046908028423786, + -0.004477105103433132, + 0.25026747584342957, + 0.056437134742736816, + -0.007044180762022734, + 0.10926210880279541, + -0.09569589793682098, + 0.001935082022100687, + -0.21442410349845886, + -0.04555040970444679, + -0.0685342401266098, + -0.16629734635353088, + -0.14039389789104462, + 0.21301649510860443, + -0.18060187995433807, + 0.0039513916708528996 + ] + ], + [ + [ + 0.048789724707603455, + 0.15031276643276215, + -0.05613492429256439, + -0.10571344941854477, + -0.02234419248998165, + -0.15666335821151733, + 0.0995059683918953, + -0.01341868843883276, + -0.23854133486747742, + 0.08438742160797119, + -0.06347957253456116, + 0.17512980103492737, + -0.1599515825510025, + 0.2414115071296692, + 0.027799246832728386, + 0.008045223541557789, + -0.11686760932207108, + -0.024439694359898567, + 0.047283850610256195, + 0.14095333218574524, + -0.07149720937013626, + 0.01209748350083828, + 0.05697353184223175, + -0.11298462003469467, + 0.04057333245873451, + -0.009469402022659779, + 0.0007769728545099497, + -0.07784144580364227, + -0.09067030251026154, + -0.15408380329608917, + -0.14963823556900024, + 0.11498738825321198 + ] + ], + [ + [ + -0.16366907954216003, + 0.026237089186906815, + -0.03340740501880646, + -0.17938172817230225, + -0.19941319525241852, + -0.07889758795499802, + 0.20627982914447784, + 0.0015805887524038553, + -0.14583586156368256, + 0.188979834318161, + 0.04950262978672981, + -0.25094106793403625, + 0.15997277200222015, + 0.1779785007238388, + -0.02451878786087036, + 0.011803848668932915, + -0.2767380475997925, + 0.03679030388593674, + -0.05764453485608101, + -0.10560223460197449, + -0.2696515619754791, + 0.09984710812568665, + 0.2217881679534912, + -0.22368086874485016, + 0.14941544830799103, + -0.2536793351173401, + 0.04383048042654991, + 0.06032068654894829, + 0.1850077509880066, + -0.29155871272087097, + -0.1491786390542984, + -0.03470019996166229 + ] + ] + ], + [ + [ + [ + 0.21745863556861877, + -0.25289222598075867, + 0.09070783853530884, + 0.12413846701383591, + -0.2695784270763397, + 0.2169027477502823, + 0.0247755516320467, + 0.20601673424243927, + 0.1425437331199646, + -0.3041030168533325, + -0.3301488757133484, + -0.18645912408828735, + -0.0274686086922884, + 0.06974663585424423, + 0.2415357381105423, + 0.1692989468574524, + -0.13503648340702057, + 0.10593406111001968, + -0.12745146453380585, + -0.011591298505663872, + 0.14446453750133514, + -0.06240079179406166, + -0.2655946612358093, + 0.08450184017419815, + 0.2072983980178833, + -0.1346265971660614, + -0.12785428762435913, + 0.24991276860237122, + 0.1458357870578766, + -0.19178803265094757, + 0.1754097044467926, + -0.21750140190124512 + ] + ], + [ + [ + -0.20015716552734375, + -0.04865814372897148, + 0.13060659170150757, + -0.00924763549119234, + -0.20489554107189178, + 0.19121219217777252, + 0.0064434451051056385, + 0.2403322458267212, + -0.12058021128177643, + -0.13485726714134216, + -0.10545867681503296, + -0.0014339197659865022, + -0.06775840371847153, + -0.1318472921848297, + 0.020401258021593094, + 0.22564847767353058, + 0.061975907534360886, + 0.0005758550832979381, + 0.012170195579528809, + -0.05389021337032318, + 0.03774929419159889, + -0.10675320774316788, + 0.05109405890107155, + -0.012173891998827457, + 0.08191366493701935, + -0.005660898517817259, + -0.15931518375873566, + -0.09331292659044266, + 0.0009348267922177911, + 0.24056066572666168, + -0.15753750503063202, + 0.06769140809774399 + ] + ], + [ + [ + 0.07823731750249863, + 0.07538270205259323, + -0.08664898574352264, + 0.004800515249371529, + -0.0659003034234047, + -0.12561509013175964, + -0.1546565592288971, + -0.07197513431310654, + -0.18085019290447235, + 0.06108831241726875, + 0.014482090249657631, + 0.13781873881816864, + -0.0073411730118095875, + 0.24384242296218872, + -0.0024509914219379425, + 0.09293508529663086, + 0.15726129710674286, + -0.01388379093259573, + 0.22986026108264923, + 0.12434647977352142, + 0.04862182214856148, + 0.022188913077116013, + 0.16117992997169495, + -0.037924665957689285, + 0.11466341465711594, + -0.03904208168387413, + -0.04237453266978264, + 0.08167990297079086, + -0.11548999696969986, + -0.08401918411254883, + -0.06691122055053711, + -0.12765903770923615 + ] + ], + [ + [ + -0.24121537804603577, + -0.16167998313903809, + -0.3282026946544647, + 0.060321155935525894, + -0.05071339011192322, + -0.0030673122964799404, + -0.008318855427205563, + -0.08100299537181854, + -0.2613353431224823, + 0.0045617311261594296, + -0.0536443293094635, + 0.15879657864570618, + 0.18758094310760498, + -0.1432582139968872, + -0.3697158992290497, + -0.1154361292719841, + 0.023370269685983658, + -0.41839656233787537, + 0.26156434416770935, + -0.26981303095817566, + -0.11337664723396301, + -0.41926807165145874, + 0.21529920399188995, + -0.06804896891117096, + 0.11328309029340744, + -0.14091931283473969, + -0.38097506761550903, + 0.06487961858510971, + -0.04247283563017845, + 0.12963606417179108, + -0.09671898931264877, + -0.02245408110320568 + ] + ], + [ + [ + -0.011604031547904015, + -0.03138111159205437, + -0.1873001903295517, + -0.022807549685239792, + -0.09824696183204651, + -0.06527846306562424, + -0.018673861399292946, + -0.096241295337677, + -0.20464730262756348, + 0.12108156830072403, + 0.07380659133195877, + -0.042484816163778305, + 0.09604228287935257, + 0.07979463040828705, + 0.012056500650942326, + -0.11055227369070053, + 0.09914225339889526, + 0.028333911672234535, + 0.238777756690979, + -0.13356198370456696, + 0.02245752513408661, + 0.04288949444890022, + 0.20420171320438385, + -0.1536237597465515, + -0.26924213767051697, + 0.0027841071132570505, + -0.07824156433343887, + -0.1419023871421814, + -0.1189587190747261, + -0.06073635071516037, + 0.1864168345928192, + -0.3174465596675873 + ] + ], + [ + [ + -0.11221863329410553, + -0.08817487955093384, + -0.1156553328037262, + -0.11270277202129364, + -0.0541931688785553, + -0.16843478381633759, + 0.11363399773836136, + -0.052408382296562195, + 0.061375074088573456, + 0.1671411544084549, + -0.11799149960279465, + -0.008267807774245739, + 0.1856899857521057, + 0.08937849849462509, + -0.06472596526145935, + -0.0814083069562912, + -0.02059783600270748, + -0.05271001532673836, + 0.06270943582057953, + -0.009163044393062592, + -0.12372172623872757, + 0.08657895028591156, + 0.28363320231437683, + 0.08843854069709778, + -0.21781060099601746, + -0.11137290298938751, + -0.015013586729764938, + -0.04514231160283089, + 0.12115440517663956, + 0.06706489622592926, + 0.10014963895082474, + 0.06227927654981613 + ] + ], + [ + [ + -0.2768345773220062, + 0.04760462045669556, + 0.12222547084093094, + -0.35793113708496094, + -0.2822423279285431, + -0.04730476066470146, + 0.3986715078353882, + -0.016731414943933487, + 0.09031320363283157, + 0.12125176191329956, + -0.0854896605014801, + -0.3295291066169739, + 0.0038276591803878546, + 0.1918746531009674, + -0.09704313427209854, + -0.04258658364415169, + -0.2662140130996704, + -0.034799251705408096, + -0.15872198343276978, + -0.16578994691371918, + -0.4143209457397461, + 0.051787279546260834, + 0.14860789477825165, + 0.08255747705698013, + -0.048769351094961166, + -0.3532332181930542, + 0.010476522147655487, + -0.049666628241539, + 0.3549686074256897, + -0.043234601616859436, + 0.1979769915342331, + -0.13690850138664246 + ] + ] + ], + [ + [ + [ + 0.10661447793245316, + -0.5006353259086609, + 0.1969185620546341, + 0.1537669152021408, + -0.08643846213817596, + 0.2215415984392166, + 0.0034793957602232695, + 0.20075933635234833, + 0.16806888580322266, + -0.30978965759277344, + -0.45425698161125183, + 0.030869916081428528, + 0.15123708546161652, + 0.10464100539684296, + 0.23356303572654724, + 0.1748204529285431, + 0.0008317009778693318, + -0.006674823351204395, + -0.1805858314037323, + 0.09359407424926758, + 0.0668676421046257, + 0.05068378150463104, + -0.19357158243656158, + 0.25905007123947144, + 0.22865508496761322, + -0.12861283123493195, + -0.11876138299703598, + 0.4230814278125763, + 0.16704949736595154, + 0.06635087728500366, + -0.03593164309859276, + 0.10075032711029053 + ] + ], + [ + [ + 0.10232748091220856, + -0.10561297833919525, + 0.05446280911564827, + -0.010402697138488293, + -0.24307076632976532, + 0.12262164056301117, + -0.011663874611258507, + 0.18075843155384064, + -0.29503679275512695, + -0.06152840703725815, + -0.21800562739372253, + 0.20298375189304352, + -0.15590712428092957, + 0.05381143465638161, + 0.2118406593799591, + 0.17300547659397125, + 0.014942831359803677, + 0.057386185973882675, + -0.03153591603040695, + 0.216817244887352, + 0.0692102387547493, + -0.07832401990890503, + -0.1142505332827568, + 0.15227684378623962, + -0.12446340173482895, + -0.041988205164670944, + -0.13421794772148132, + -0.0660158321261406, + 0.1420544683933258, + 0.026821503415703773, + 0.1836690604686737, + -0.2454274296760559 + ] + ], + [ + [ + 0.02971632592380047, + 0.11718139797449112, + -0.02379767782986164, + -0.02136446163058281, + 0.152756005525589, + -0.13779671490192413, + -0.1707175076007843, + -0.13532014191150665, + -0.15839414298534393, + 0.0972161516547203, + 0.10886096954345703, + -0.16677291691303253, + 0.09146580845117569, + 0.17263659834861755, + -0.12248203158378601, + 0.018122775480151176, + 0.0710005909204483, + 0.09857400506734848, + 0.1517343372106552, + -0.05800124630331993, + 0.004876832012087107, + 0.11151376366615295, + 0.10482646524906158, + -0.07935801148414612, + -0.11062201857566833, + -0.03064599819481373, + -0.027297548949718475, + -0.06860712915658951, + -0.17838864028453827, + -0.09098745882511139, + 0.2323271930217743, + -0.2949354350566864 + ] + ], + [ + [ + -0.18026719987392426, + 0.045015327632427216, + -0.35899290442466736, + -0.07854972034692764, + -0.08334451913833618, + -0.09280751645565033, + -0.14286857843399048, + -0.1240735575556755, + -0.26915058493614197, + -0.11153005808591843, + -0.07920520007610321, + 0.07468441128730774, + 0.01677154004573822, + -0.004510971251875162, + -0.12102854251861572, + -0.18935707211494446, + 0.12302982062101364, + -0.48116767406463623, + 0.27524933218955994, + -0.23195944726467133, + -0.10118509083986282, + -0.43470317125320435, + 0.10781426727771759, + -0.04356900602579117, + -0.2169220894575119, + -0.14351488649845123, + -0.43794676661491394, + 0.07402800768613815, + 0.007698738016188145, + 0.18429364264011383, + -0.042968060821294785, + 0.07711612433195114 + ] + ], + [ + [ + 0.15739120543003082, + 0.12204908579587936, + -0.14547964930534363, + -0.008586777374148369, + 0.08015745133161545, + -0.0989965945482254, + -0.007928324863314629, + -0.14778368175029755, + -0.18243075907230377, + 0.023349054157733917, + 0.04910077154636383, + -0.11892402917146683, + -0.15168790519237518, + 0.20049473643302917, + -0.13156773149967194, + -0.18611042201519012, + 0.11635004729032516, + 0.08132700622081757, + 0.1265832781791687, + 0.08037932217121124, + 0.023634325712919235, + 0.08902925997972488, + -0.0010731304064393044, + -0.1460232436656952, + 0.033553991466760635, + 0.016357824206352234, + -0.05352485924959183, + -0.12734289467334747, + -0.1593739092350006, + 0.1387009471654892, + 0.23013260960578918, + 0.013456808403134346 + ] + ], + [ + [ + -0.1549985557794571, + -0.01321776956319809, + -0.007201786153018475, + -0.062320295721292496, + 0.010205157101154327, + -0.17918308079242706, + 0.15608087182044983, + -0.0968640148639679, + -0.012084675952792168, + 0.14978022873401642, + -0.0658554658293724, + 0.17832250893115997, + 0.04007741063833237, + -0.11569791287183762, + 0.01109990756958723, + -0.12882521748542786, + -0.11347950994968414, + -0.0048828995786607265, + 0.007190017495304346, + 0.1494084596633911, + -0.09371009469032288, + -0.005529151763767004, + 0.21108423173427582, + 0.05033067986369133, + -0.13369178771972656, + -0.12906739115715027, + -0.00630826223641634, + -0.08312691003084183, + 0.06665851920843124, + 0.1263391077518463, + 0.30492737889289856, + -0.0025490710977464914 + ] + ], + [ + [ + -0.3068568706512451, + -0.1846717894077301, + -0.02109808661043644, + -0.4918447732925415, + -0.321227490901947, + -0.07657162845134735, + 0.39704349637031555, + -0.03081171214580536, + -0.11057454347610474, + 0.19340722262859344, + -0.08745270222425461, + 0.04195729270577431, + 0.1019301787018776, + 0.08512803167104721, + -0.054887399077415466, + -0.07200728356838226, + -0.48504531383514404, + -0.11254840344190598, + -0.16786061227321625, + -0.008081807754933834, + -0.3768254816532135, + 0.020580215379595757, + 0.053681161254644394, + 0.0004208620230201632, + 0.12196599692106247, + -0.45994678139686584, + 0.02109074778854847, + 0.11954407393932343, + 0.31784120202064514, + -0.09134554862976074, + 0.009095195680856705, + -0.012676450423896313 + ] + ] + ] + ], + [ + 0.30992940068244934, + 0.5528377890586853, + 0.31296661496162415, + 0.44302070140838623, + 0.5749708414077759, + -0.09435456246137619, + -0.04262005165219307, + -0.21977251768112183, + 0.2938917279243469, + 0.4683896005153656, + 0.6673905849456787, + -0.05627855286002159, + 0.15337666869163513, + 0.14326898753643036, + 0.3228438198566437, + -0.3382425010204315, + 0.5086042881011963, + 0.6113627552986145, + -0.336405485868454, + 0.3320351839065552, + 0.5395300984382629, + 0.5703149437904358, + 0.16775688529014587, + -0.08323061466217041, + -0.06603558361530304, + 0.6771699786186218, + 1.0468562841415405, + -0.24344830214977264, + 0.05202765390276909, + 0.04662943258881569, + 0.15568453073501587, + 0.17148442566394806 + ] + ] + }, + { + "type": "conv2d", + "activation": "sigmoid", + "shape": [ + 1, + null, + 88, + 1 + ], + "kernel_size_time": 7, + "kernel_size_feature": 3, + "dilation": 1, + "strides": 1, + "num_filters_in": 32, + "num_features_in": 88, + "num_filters_out": 1, + "padding": "same", + "weights": [ + [ + [ + [ + [ + 0.001481340965256095 + ], + [ + -0.0010722398292273283 + ], + [ + 0.008976168930530548 + ], + [ + -0.012706873938441277 + ], + [ + -0.007912646979093552 + ], + [ + 0.015039559453725815 + ], + [ + 0.17812688648700714 + ], + [ + 0.0005603506579063833 + ], + [ + 0.0052274297922849655 + ], + [ + 0.009872213937342167 + ], + [ + -0.001090780831873417 + ], + [ + 0.0854351744055748 + ], + [ + 0.0050952560268342495 + ], + [ + -0.003656568005681038 + ], + [ + 0.009366330690681934 + ], + [ + -0.0013940595090389252 + ], + [ + -0.018289590254426003 + ], + [ + 0.0053630066104233265 + ], + [ + 0.12504321336746216 + ], + [ + 0.010858419351279736 + ], + [ + -0.01148258987814188 + ], + [ + 0.008993578143417835 + ], + [ + 0.011284369975328445 + ], + [ + 0.013365612365305424 + ], + [ + -0.007517021149396896 + ], + [ + -0.021230870857834816 + ], + [ + 0.008196801878511906 + ], + [ + -0.020785734057426453 + ], + [ + 0.16706745326519012 + ], + [ + -0.017602505162358284 + ], + [ + 0.012477638199925423 + ], + [ + 0.006293073762208223 + ] + ], + [ + [ + -0.005024676211178303 + ], + [ + -0.012609307654201984 + ], + [ + -0.022178834304213524 + ], + [ + -0.006890051532536745 + ], + [ + -0.00909355841577053 + ], + [ + -0.06624735891819 + ], + [ + 0.07376153022050858 + ], + [ + -0.02067001909017563 + ], + [ + -0.02030550315976143 + ], + [ + -0.013574851676821709 + ], + [ + -0.014845304191112518 + ], + [ + 0.007364984601736069 + ], + [ + -0.014342628419399261 + ], + [ + -0.0030801338143646717 + ], + [ + -0.01627899333834648 + ], + [ + 0.03492803871631622 + ], + [ + -0.004268106073141098 + ], + [ + -0.030394364148378372 + ], + [ + 0.08853264153003693 + ], + [ + -0.02100525237619877 + ], + [ + -0.010227237828075886 + ], + [ + -0.03060613013803959 + ], + [ + 0.00020983642025385052 + ], + [ + -0.02775660715997219 + ], + [ + -0.02392319217324257 + ], + [ + -0.01585640199482441 + ], + [ + -0.028935683891177177 + ], + [ + 0.008372362703084946 + ], + [ + -0.030529474839568138 + ], + [ + 0.00802359078079462 + ], + [ + -0.004146063234657049 + ], + [ + -0.01749446429312229 + ] + ], + [ + [ + 0.0019645567517727613 + ], + [ + -0.020354600623250008 + ], + [ + 0.012793239206075668 + ], + [ + 0.005261154379695654 + ], + [ + -0.009219547733664513 + ], + [ + 0.038908328860998154 + ], + [ + -0.016299379989504814 + ], + [ + 0.046491414308547974 + ], + [ + 0.005742197390645742 + ], + [ + -0.013754131272435188 + ], + [ + -0.02043626829981804 + ], + [ + -0.013710016384720802 + ], + [ + -0.001318634720519185 + ], + [ + -0.005671447608619928 + ], + [ + 0.00962299294769764 + ], + [ + 0.04210091754794121 + ], + [ + -0.003293141955509782 + ], + [ + 0.01114841178059578 + ], + [ + 0.040069907903671265 + ], + [ + 0.015564178116619587 + ], + [ + 0.006929343566298485 + ], + [ + 0.008185413666069508 + ], + [ + -0.007387201767414808 + ], + [ + 0.03531130403280258 + ], + [ + 0.016944970935583115 + ], + [ + -0.0012877038680016994 + ], + [ + -0.0005793428281322122 + ], + [ + -0.03930984437465668 + ], + [ + 0.0618661567568779 + ], + [ + -0.004922386258840561 + ], + [ + 0.003835167270153761 + ], + [ + -0.0012045876355841756 + ] + ] + ], + [ + [ + [ + -0.004474983550608158 + ], + [ + -0.001626688172109425 + ], + [ + 0.0075042941607534885 + ], + [ + -0.01682303659617901 + ], + [ + -0.012147871777415276 + ], + [ + 0.0017836021725088358 + ], + [ + 0.1953427642583847 + ], + [ + -0.0038650105707347393 + ], + [ + -0.001406820141710341 + ], + [ + 0.01032265555113554 + ], + [ + -0.002415494294837117 + ], + [ + 0.08929836750030518 + ], + [ + 0.0050307996571063995 + ], + [ + 0.0034290512558072805 + ], + [ + 0.00886925496160984 + ], + [ + -0.006632228847593069 + ], + [ + -0.020378943532705307 + ], + [ + 0.004850173369050026 + ], + [ + 0.14426836371421814 + ], + [ + 0.010884813964366913 + ], + [ + -0.015406910330057144 + ], + [ + 0.008837041445076466 + ], + [ + 0.011566106230020523 + ], + [ + 0.0033722782973200083 + ], + [ + -0.009199456311762333 + ], + [ + -0.02663523703813553 + ], + [ + 0.006666651926934719 + ], + [ + -0.023821109905838966 + ], + [ + 0.18442295491695404 + ], + [ + -0.015078341588377953 + ], + [ + 0.014852063730359077 + ], + [ + 0.004930990748107433 + ] + ], + [ + [ + -0.00974707119166851 + ], + [ + -0.014525307342410088 + ], + [ + -0.02515215240418911 + ], + [ + -0.007640560623258352 + ], + [ + -0.012004896067082882 + ], + [ + -0.06258871406316757 + ], + [ + 0.07927205413579941 + ], + [ + -0.01603245735168457 + ], + [ + -0.029933592304587364 + ], + [ + -0.01243545487523079 + ], + [ + -0.017130011692643166 + ], + [ + 0.009007430635392666 + ], + [ + -0.01250187773257494 + ], + [ + 0.0001531178568257019 + ], + [ + -0.019241727888584137 + ], + [ + 0.04794779419898987 + ], + [ + -0.005071415100246668 + ], + [ + -0.03300448879599571 + ], + [ + 0.1026202067732811 + ], + [ + -0.020881103351712227 + ], + [ + -0.010534199886023998 + ], + [ + -0.033267635852098465 + ], + [ + 0.000559788488317281 + ], + [ + -0.027924787253141403 + ], + [ + -0.026962243020534515 + ], + [ + -0.018763866275548935 + ], + [ + -0.03323042765259743 + ], + [ + 0.012566769495606422 + ], + [ + -0.040676653385162354 + ], + [ + 0.009691138751804829 + ], + [ + -0.00027338246582075953 + ], + [ + -0.01665526069700718 + ] + ], + [ + [ + 0.00130364834330976 + ], + [ + -0.023994574323296547 + ], + [ + 0.011424039490520954 + ], + [ + 0.00439398642629385 + ], + [ + -0.011634768918156624 + ], + [ + 0.04029976576566696 + ], + [ + -0.007044651545584202 + ], + [ + 0.04795359820127487 + ], + [ + 0.0010256766108796 + ], + [ + -0.016587994992733 + ], + [ + -0.0249444842338562 + ], + [ + -0.009419383481144905 + ], + [ + 0.0012559214374050498 + ], + [ + -0.0008864991250447929 + ], + [ + 0.010551090352237225 + ], + [ + 0.04384007677435875 + ], + [ + -0.002482656156644225 + ], + [ + 0.010527222417294979 + ], + [ + 0.06659236550331116 + ], + [ + 0.01628417707979679 + ], + [ + 0.006765374448150396 + ], + [ + 0.00739154452458024 + ], + [ + -0.010724284686148167 + ], + [ + 0.032626181840896606 + ], + [ + 0.017613057047128677 + ], + [ + -0.0032586471643298864 + ], + [ + -0.0024003975559026003 + ], + [ + -0.047057319432497025 + ], + [ + 0.08178674429655075 + ], + [ + 0.00012109500676160678 + ], + [ + 0.008527103811502457 + ], + [ + -0.001718105748295784 + ] + ] + ], + [ + [ + [ + -0.014835532754659653 + ], + [ + -0.005276950541883707 + ], + [ + 0.004903269466012716 + ], + [ + -0.02207232639193535 + ], + [ + -0.022663645446300507 + ], + [ + -0.006068066228181124 + ], + [ + 0.20472770929336548 + ], + [ + -0.003157337661832571 + ], + [ + -0.006822197698056698 + ], + [ + 0.008909969590604305 + ], + [ + -0.006392151582986116 + ], + [ + 0.08706966042518616 + ], + [ + 0.00654451223090291 + ], + [ + 0.00794136244803667 + ], + [ + 0.00538872042670846 + ], + [ + -0.0033815973438322544 + ], + [ + -0.024197092279791832 + ], + [ + 0.0018462619045749307 + ], + [ + 0.15102984011173248 + ], + [ + 0.004651728086173534 + ], + [ + -0.021891679614782333 + ], + [ + 0.005475315731018782 + ], + [ + 0.01350683905184269 + ], + [ + -0.0061402576975524426 + ], + [ + -0.005345907062292099 + ], + [ + -0.03473057970404625 + ], + [ + 0.002262330148369074 + ], + [ + -0.025889558717608452 + ], + [ + 0.18956358730793 + ], + [ + -0.017033955082297325 + ], + [ + 0.012308410368859768 + ], + [ + -0.0012087845243513584 + ] + ], + [ + [ + -0.018272511661052704 + ], + [ + -0.019214846193790436 + ], + [ + -0.029581354930996895 + ], + [ + -0.009930386207997799 + ], + [ + -0.020089786499738693 + ], + [ + -0.054264795035123825 + ], + [ + 0.06803062558174133 + ], + [ + -0.005556810647249222 + ], + [ + -0.03743671253323555 + ], + [ + -0.014045169577002525 + ], + [ + -0.022128351032733917 + ], + [ + 0.005921203643083572 + ], + [ + -0.010136776603758335 + ], + [ + 2.361638325965032e-05 + ], + [ + -0.02620960772037506 + ], + [ + 0.06479863077402115 + ], + [ + -0.007734538987278938 + ], + [ + -0.03823523223400116 + ], + [ + 0.11304055154323578 + ], + [ + -0.028142603114247322 + ], + [ + -0.013790377415716648 + ], + [ + -0.03897940367460251 + ], + [ + 0.0018914839019998908 + ], + [ + -0.02710585668683052 + ], + [ + -0.024257348850369453 + ], + [ + -0.024690086022019386 + ], + [ + -0.04094599932432175 + ], + [ + 0.016463572159409523 + ], + [ + -0.05745692923665047 + ], + [ + 0.009631992317736149 + ], + [ + -0.0015518896980211139 + ], + [ + -0.020388508215546608 + ] + ], + [ + [ + -0.004103606566786766 + ], + [ + -0.030495624989271164 + ], + [ + 0.007655817084014416 + ], + [ + 0.002567746676504612 + ], + [ + -0.0203687846660614 + ], + [ + 0.04418456181883812 + ], + [ + -0.005204596556723118 + ], + [ + 0.05168861150741577 + ], + [ + -0.0017903404077515006 + ], + [ + -0.021741706877946854 + ], + [ + -0.03187606483697891 + ], + [ + -0.017309173941612244 + ], + [ + 0.005365918390452862 + ], + [ + 0.0008120872662402689 + ], + [ + 0.00782791618257761 + ], + [ + 0.04770228639245033 + ], + [ + -0.004107963293790817 + ], + [ + 0.007446151692420244 + ], + [ + 0.08263694494962692 + ], + [ + 0.012174791656434536 + ], + [ + 0.004603852983564138 + ], + [ + 0.0038914002943784 + ], + [ + -0.01142507791519165 + ], + [ + 0.03269509971141815 + ], + [ + 0.02131597138941288 + ], + [ + -0.008701611310243607 + ], + [ + -0.0077586411498487 + ], + [ + -0.05209863930940628 + ], + [ + 0.08579306304454803 + ], + [ + 0.0013376917922869325 + ], + [ + 0.007617253344506025 + ], + [ + -0.005921213421970606 + ] + ] + ], + [ + [ + [ + -0.03501325473189354 + ], + [ + -0.020933622494339943 + ], + [ + -0.0024137517903000116 + ], + [ + -0.03865482285618782 + ], + [ + -0.044246405363082886 + ], + [ + -0.007402354385703802 + ], + [ + 0.20016349852085114 + ], + [ + -0.0011804160894826055 + ], + [ + -0.01900044083595276 + ], + [ + -0.003320021089166403 + ], + [ + -0.023120282217860222 + ], + [ + 0.09012289345264435 + ], + [ + -0.0037227484863251448 + ], + [ + -0.006400755140930414 + ], + [ + -0.010527858510613441 + ], + [ + 0.003911816049367189 + ], + [ + -0.04406788572669029 + ], + [ + -0.011997777037322521 + ], + [ + 0.14041976630687714 + ], + [ + -0.009396317414939404 + ], + [ + -0.041113026440143585 + ], + [ + -0.009300990030169487 + ], + [ + 0.00471755163744092 + ], + [ + -0.013269457966089249 + ], + [ + 0.0009010108187794685 + ], + [ + -0.05745866522192955 + ], + [ + -0.014434294775128365 + ], + [ + -0.027455221861600876 + ], + [ + 0.1648261845111847 + ], + [ + -0.027443530037999153 + ], + [ + -0.0030136527493596077 + ], + [ + -0.00445133913308382 + ] + ], + [ + [ + -0.03473816439509392 + ], + [ + -0.03439198061823845 + ], + [ + -0.041404057294130325 + ], + [ + -0.021965717896819115 + ], + [ + -0.037259649485349655 + ], + [ + -0.04388388618826866 + ], + [ + 0.004487510304898024 + ], + [ + 0.004482209216803312 + ], + [ + -0.05257248133420944 + ], + [ + -0.029682951048016548 + ], + [ + -0.03916902095079422 + ], + [ + 0.006395578384399414 + ], + [ + -0.02267325296998024 + ], + [ + -0.018421774730086327 + ], + [ + -0.04758007824420929 + ], + [ + 0.07482849806547165 + ], + [ + -0.022240525111556053 + ], + [ + -0.05542898550629616 + ], + [ + 0.11671867221593857 + ], + [ + -0.04513709992170334 + ], + [ + -0.028985867276787758 + ], + [ + -0.05771414935588837 + ], + [ + -0.007751682307571173 + ], + [ + -0.026046669110655785 + ], + [ + -0.017521347850561142 + ], + [ + -0.043810177594423294 + ], + [ + -0.06274589896202087 + ], + [ + 0.018222752958536148 + ], + [ + -0.09512107819318771 + ], + [ + 0.004430439788848162 + ], + [ + -0.018242239952087402 + ], + [ + -0.021550729870796204 + ] + ], + [ + [ + -0.018665974959731102 + ], + [ + -0.05003925785422325 + ], + [ + -0.0013252984499558806 + ], + [ + -0.00713772838935256 + ], + [ + -0.04013339430093765 + ], + [ + 0.04962824657559395 + ], + [ + -0.041154202073812485 + ], + [ + 0.0557391382753849 + ], + [ + -0.009991247206926346 + ], + [ + -0.041609928011894226 + ], + [ + -0.05272086709737778 + ], + [ + -0.00820484571158886 + ], + [ + -0.005377582740038633 + ], + [ + -0.015846559777855873 + ], + [ + -0.006319240666925907 + ], + [ + 0.05141899734735489 + ], + [ + -0.019986864179372787 + ], + [ + -0.0056953406892716885 + ], + [ + 0.08152961730957031 + ], + [ + 0.00127418152987957 + ], + [ + -0.007304568774998188 + ], + [ + -0.01054863166064024 + ], + [ + -0.026576625183224678 + ], + [ + 0.037175703793764114 + ], + [ + 0.02654322050511837 + ], + [ + -0.028002075850963593 + ], + [ + -0.02702493965625763 + ], + [ + -0.05348871275782585 + ], + [ + 0.0379607193171978 + ], + [ + -0.005906934384256601 + ], + [ + -0.009338729083538055 + ], + [ + -0.007558315992355347 + ] + ] + ], + [ + [ + [ + -0.018629277125000954 + ], + [ + -0.0033636176958680153 + ], + [ + 0.010408216156065464 + ], + [ + -0.020443493500351906 + ], + [ + -0.021334726363420486 + ], + [ + -0.004886861890554428 + ], + [ + 0.18457648158073425 + ], + [ + 0.0016945685492828488 + ], + [ + 0.004800880793482065 + ], + [ + 0.005957797169685364 + ], + [ + -0.0032674672547727823 + ], + [ + 0.07197432965040207 + ], + [ + 0.003551367437466979 + ], + [ + 0.0004893814329989254 + ], + [ + 0.004539854358881712 + ], + [ + 0.009558476507663727 + ], + [ + -0.025790823623538017 + ], + [ + 0.002952098846435547 + ], + [ + 0.11515873670578003 + ], + [ + 0.0013715749373659492 + ], + [ + -0.02288205921649933 + ], + [ + 0.003976837266236544 + ], + [ + 0.006828612182289362 + ], + [ + -0.014098802581429482 + ], + [ + 0.005375291220843792 + ], + [ + -0.03085837885737419 + ], + [ + 0.003012107452377677 + ], + [ + -0.027947379276156425 + ], + [ + 0.14012792706489563 + ], + [ + -0.01370043121278286 + ], + [ + -0.005436690524220467 + ], + [ + 0.01417312677949667 + ] + ], + [ + [ + -0.018684959039092064 + ], + [ + -0.01772211119532585 + ], + [ + -0.02441970258951187 + ], + [ + -0.007250973954796791 + ], + [ + -0.017923226580023766 + ], + [ + -0.03692144155502319 + ], + [ + 0.031826574355363846 + ], + [ + 0.009427135810256004 + ], + [ + -0.02906171791255474 + ], + [ + -0.01845296286046505 + ], + [ + -0.020457914099097252 + ], + [ + 0.0049233222380280495 + ], + [ + -0.013088242150843143 + ], + [ + -0.011407344602048397 + ], + [ + -0.03145676478743553 + ], + [ + 0.07249484956264496 + ], + [ + -0.00955582782626152 + ], + [ + -0.036505550146102905 + ], + [ + 0.10972929745912552 + ], + [ + -0.031945664435625076 + ], + [ + -0.012853377498686314 + ], + [ + -0.03929871320724487 + ], + [ + -0.00573907932266593 + ], + [ + -0.02314998023211956 + ], + [ + -0.00987969245761633 + ], + [ + -0.02089545503258705 + ], + [ + -0.042570810765028 + ], + [ + 0.01740778610110283 + ], + [ + -0.08505723625421524 + ], + [ + 0.008917082101106644 + ], + [ + -0.021167917177081108 + ], + [ + -0.0001983542606467381 + ] + ], + [ + [ + -0.002719433046877384 + ], + [ + -0.029252314940094948 + ], + [ + 0.011258485727012157 + ], + [ + 0.006137605756521225 + ], + [ + -0.016606956720352173 + ], + [ + 0.050869476050138474 + ], + [ + -0.002365328138694167 + ], + [ + 0.05658167600631714 + ], + [ + 0.009826010093092918 + ], + [ + -0.027933023869991302 + ], + [ + -0.02965865284204483 + ], + [ + -0.0003010671935044229 + ], + [ + 0.0014546985039487481 + ], + [ + -0.005421615671366453 + ], + [ + 0.005626651458442211 + ], + [ + 0.05281081795692444 + ], + [ + -0.00427806144580245 + ], + [ + 0.00772947957739234 + ], + [ + 0.06715437769889832 + ], + [ + 0.008770826272666454 + ], + [ + 0.005558024160563946 + ], + [ + 0.003553982125595212 + ], + [ + -0.022784585133194923 + ], + [ + 0.040220655500888824 + ], + [ + 0.028096791356801987 + ], + [ + -0.004202091135084629 + ], + [ + -0.007201294414699078 + ], + [ + -0.049773912876844406 + ], + [ + 0.03221551701426506 + ], + [ + 0.004128735046833754 + ], + [ + -0.013871069066226482 + ], + [ + 0.011374128982424736 + ] + ] + ], + [ + [ + [ + -0.01721307635307312 + ], + [ + 0.001756036770530045 + ], + [ + 0.01313034724444151 + ], + [ + -0.018150778487324715 + ], + [ + -0.015903757885098457 + ], + [ + -0.002982205944135785 + ], + [ + 0.1527395248413086 + ], + [ + 0.003218426601961255 + ], + [ + 0.011552220210433006 + ], + [ + 0.00840207003057003 + ], + [ + 0.0013706374447792768 + ], + [ + 0.043857965618371964 + ], + [ + 0.006849384866654873 + ], + [ + -0.0017437494825571775 + ], + [ + 0.009266471490263939 + ], + [ + 0.00986719410866499 + ], + [ + -0.023562639951705933 + ], + [ + 0.005489524453878403 + ], + [ + 0.07677199691534042 + ], + [ + 0.00702084694057703 + ], + [ + -0.019664006307721138 + ], + [ + 0.0069479565136134624 + ], + [ + 0.005224296823143959 + ], + [ + -0.011296220123767853 + ], + [ + 0.009536420926451683 + ], + [ + -0.02232687547802925 + ], + [ + 0.007808384019881487 + ], + [ + -0.02638314664363861 + ], + [ + 0.10514841228723526 + ], + [ + -0.013483485206961632 + ], + [ + -0.004195716697722673 + ], + [ + 0.014758649282157421 + ] + ], + [ + [ + -0.015996083617210388 + ], + [ + -0.012535616755485535 + ], + [ + -0.023775804787874222 + ], + [ + -0.004738034680485725 + ], + [ + -0.012711659073829651 + ], + [ + -0.03782045468688011 + ], + [ + 0.027812151238322258 + ], + [ + 0.006218118127435446 + ], + [ + -0.025004297494888306 + ], + [ + -0.016767647117376328 + ], + [ + -0.015889335423707962 + ], + [ + 0.006119988393038511 + ], + [ + -0.007976677268743515 + ], + [ + -0.013614759780466557 + ], + [ + -0.027995796874165535 + ], + [ + 0.06356241554021835 + ], + [ + -0.007303033489733934 + ], + [ + -0.03333907201886177 + ], + [ + 0.0985192209482193 + ], + [ + -0.026875320822000504 + ], + [ + -0.009638355113565922 + ], + [ + -0.03596724569797516 + ], + [ + -0.006934445817023516 + ], + [ + -0.023830922320485115 + ], + [ + -0.0008801163057796657 + ], + [ + -0.01397104561328888 + ], + [ + -0.038186270743608475 + ], + [ + 0.015409024432301521 + ], + [ + -0.0601053349673748 + ], + [ + 0.006904572248458862 + ], + [ + -0.022598451003432274 + ], + [ + 0.0020094625651836395 + ] + ], + [ + [ + 0.0011495149228721857 + ], + [ + -0.023387592285871506 + ], + [ + 0.01525920256972313 + ], + [ + 0.009242480620741844 + ], + [ + -0.010358717292547226 + ], + [ + 0.05196266621351242 + ], + [ + 0.026408467441797256 + ], + [ + 0.05743761733174324 + ], + [ + 0.015503019094467163 + ], + [ + -0.025801103562116623 + ], + [ + -0.02438756823539734 + ], + [ + 0.0037542441859841347 + ], + [ + 0.0030667143873870373 + ], + [ + -0.004641159903258085 + ], + [ + 0.010545255616307259 + ], + [ + 0.05428018048405647 + ], + [ + -0.0014570956118404865 + ], + [ + 0.009939831681549549 + ], + [ + 0.0392838679254055 + ], + [ + 0.012002283707261086 + ], + [ + 0.008184538222849369 + ], + [ + 0.006213190499693155 + ], + [ + -0.026971137151122093 + ], + [ + 0.04359257221221924 + ], + [ + 0.03168822079896927 + ], + [ + 0.0031622296664863825 + ], + [ + -0.0018866914324462414 + ], + [ + -0.04017825424671173 + ], + [ + 0.03976175934076309 + ], + [ + 0.0028490873519331217 + ], + [ + -0.014933954924345016 + ], + [ + 0.012876136228442192 + ] + ] + ], + [ + [ + [ + -0.019920002669095993 + ], + [ + 0.0003644130192697048 + ], + [ + 0.009922351688146591 + ], + [ + -0.023280641064047813 + ], + [ + -0.01810023933649063 + ], + [ + -0.0006317022489383817 + ], + [ + 0.12539426982402802 + ], + [ + 0.004687235224992037 + ], + [ + 0.011444947682321072 + ], + [ + 0.009984162636101246 + ], + [ + 0.002715576207265258 + ], + [ + 0.007958375848829746 + ], + [ + 0.006574873346835375 + ], + [ + -0.0015312759205698967 + ], + [ + 0.006938503589481115 + ], + [ + 0.0057076276279985905 + ], + [ + -0.025747189298272133 + ], + [ + 0.004567367024719715 + ], + [ + 0.03214260935783386 + ], + [ + 0.005130273289978504 + ], + [ + -0.02280561625957489 + ], + [ + 0.008379426784813404 + ], + [ + 0.004218920599669218 + ], + [ + -0.005562096368521452 + ], + [ + 0.012865287251770496 + ], + [ + -0.02121102809906006 + ], + [ + 0.009063998237252235 + ], + [ + -0.02348656952381134 + ], + [ + 0.0799282118678093 + ], + [ + -0.02138582058250904 + ], + [ + -0.0017535503720864654 + ], + [ + 0.007872640155255795 + ] + ], + [ + [ + -0.017481956630945206 + ], + [ + -0.013595838099718094 + ], + [ + -0.03372375667095184 + ], + [ + -0.006716336589306593 + ], + [ + -0.012735042721033096 + ], + [ + -0.044751785695552826 + ], + [ + 0.00039268925320357084 + ], + [ + -0.0035133440978825092 + ], + [ + -0.02923496998846531 + ], + [ + -0.01690652035176754 + ], + [ + -0.014407970011234283 + ], + [ + 0.0060001858510077 + ], + [ + -0.00750757846981287 + ], + [ + -0.015564258210361004 + ], + [ + -0.03406710550189018 + ], + [ + 0.04949060082435608 + ], + [ + -0.0064655509777367115 + ], + [ + -0.0365564227104187 + ], + [ + 0.09347373247146606 + ], + [ + -0.031799931079149246 + ], + [ + -0.011015056632459164 + ], + [ + -0.03772525489330292 + ], + [ + -0.007134381216019392 + ], + [ + -0.027612602338194847 + ], + [ + 0.00036793662002310157 + ], + [ + -0.012810178101062775 + ], + [ + -0.039592765271663666 + ], + [ + 0.011923912912607193 + ], + [ + -0.02947213500738144 + ], + [ + 0.002995139919221401 + ], + [ + -0.022194581106305122 + ], + [ + -0.00433340622112155 + ] + ], + [ + [ + 0.003190513700246811 + ], + [ + -0.02708600088953972 + ], + [ + 0.014368954114615917 + ], + [ + 0.008493374101817608 + ], + [ + -0.010880623944103718 + ], + [ + 0.05337965115904808 + ], + [ + 0.04406927898526192 + ], + [ + 0.05841870233416557 + ], + [ + 0.016514183953404427 + ], + [ + -0.027597934007644653 + ], + [ + -0.024422094225883484 + ], + [ + -0.001955220475792885 + ], + [ + 0.0033952356316149235 + ], + [ + -0.005405749659985304 + ], + [ + 0.011933187022805214 + ], + [ + 0.055325914174318314 + ], + [ + -0.001007402315735817 + ], + [ + 0.009149466641247272 + ], + [ + 0.0024425345472991467 + ], + [ + 0.01047919224947691 + ], + [ + 0.007910770364105701 + ], + [ + 0.006267447955906391 + ], + [ + -0.033736031502485275 + ], + [ + 0.04664919525384903 + ], + [ + 0.0360703244805336 + ], + [ + 0.004686158150434494 + ], + [ + -0.0009687012061476707 + ], + [ + -0.026742324233055115 + ], + [ + 0.0604107528924942 + ], + [ + -0.003017239971086383 + ], + [ + -0.01178413163870573 + ], + [ + 0.007678373716771603 + ] + ] + ] + ], + [ + -0.6187598705291748 + ] + ] + } + ] +} \ No newline at end of file diff --git a/JammLab/Resources/BasicPitchModel/cnn_onset_1_model.json b/JammLab/Resources/BasicPitchModel/cnn_onset_1_model.json new file mode 100644 index 0000000..c643b1e --- /dev/null +++ b/JammLab/Resources/BasicPitchModel/cnn_onset_1_model.json @@ -0,0 +1,6926 @@ +{ + "in_shape": [ + 1, + null, + 264, + 8 + ], + "layers": [ + { + "type": "conv2d", + "activation": "relu", + "shape": [ + 1, + null, + 88, + 32 + ], + "kernel_size_time": 5, + "kernel_size_feature": 5, + "dilation": 1, + "strides": 3, + "num_filters_in": 8, + "num_features_in": 264, + "num_filters_out": 32, + "padding": "same", + "weights": [ + [ + [ + [ + [ + -0.21944934129714966, + 0.05897047370672226, + 0.16477330029010773, + -0.14918804168701172, + 0.2043820470571518, + 0.058847736567258835, + 0.3775934875011444, + -0.14750123023986816, + -0.019823770970106125, + -0.14805752038955688, + 0.0033334081526845694, + 0.06783727556467056, + 0.3646200895309448, + -0.3073735535144806, + -0.005107240751385689, + 0.06415027379989624, + -0.03208678215742111, + 0.0896400734782219, + 0.4646148979663849, + -0.4104118347167969, + 0.19407062232494354, + -0.12443545460700989, + 0.002648968482390046, + 0.06744951009750366, + 0.30176565051078796, + -0.2304145097732544, + 0.2695867121219635, + -0.19262073934078217, + 0.03706088289618492, + 0.3174671530723572, + -0.12330760061740875, + -0.10214212536811829 + ], + [ + -0.022502567619085312, + -0.3799973130226135, + 0.014478757977485657, + 0.18529044091701508, + -0.13154014945030212, + -0.12731364369392395, + 0.24624235928058624, + 1.092437505722046, + 0.4284019470214844, + -0.3693486452102661, + 0.025407670065760612, + -0.5756756067276001, + 0.07203837484121323, + -0.23858784139156342, + -0.3029121458530426, + -0.6749658584594727, + -0.3017691671848297, + -0.9123948216438293, + 0.007465270813554525, + 0.148410826921463, + -0.503353476524353, + -0.061574410647153854, + -1.2817975282669067, + -0.2872045338153839, + -1.0745604038238525, + -0.2641303241252899, + 0.40181732177734375, + 0.7165117859840393, + 0.09756284952163696, + -1.429378867149353, + 0.003533007111400366, + 0.08549229800701141 + ], + [ + -0.013682556338608265, + 0.37246173620224, + 0.06258662045001984, + 0.04116068407893181, + -0.0021210163831710815, + -0.04376533627510071, + -0.33057868480682373, + 0.5434480905532837, + 0.08022872358560562, + 0.16475491225719452, + -0.022593054920434952, + 0.1109907329082489, + 0.20510883629322052, + -0.008754418231546879, + -0.15994739532470703, + -0.5659238696098328, + -0.28494197130203247, + -0.571863055229187, + 0.27379360795021057, + -0.1822698712348938, + -0.50795578956604, + -0.07529393583536148, + -0.4820334315299988, + 0.017122715711593628, + -0.5626227259635925, + -0.2607761323451996, + 0.048133257776498795, + -0.5128642916679382, + 0.16955365240573883, + -0.575302004814148, + -0.07835711538791656, + 0.5951685309410095 + ], + [ + -0.08226504176855087, + 0.47344258427619934, + 0.02328505367040634, + -0.030543681234121323, + -0.02265353314578533, + -0.14772078394889832, + -0.17515519261360168, + -0.15349510312080383, + 0.08344254642724991, + -0.12745152413845062, + -0.04807217791676521, + 0.18605948984622955, + 0.1512538343667984, + -0.04151114448904991, + 0.09538104385137558, + -0.5043067932128906, + -0.02643544413149357, + -0.46834373474121094, + 0.3468303382396698, + 0.004004035610705614, + -0.4220770299434662, + 0.038778454065322876, + 0.016156937927007675, + -0.018880316987633705, + -0.3553681969642639, + -0.0803103968501091, + -0.22795231640338898, + -0.5076409578323364, + -0.07908182591199875, + -0.33922097086906433, + -0.26490119099617004, + 0.05650978535413742 + ], + [ + 0.09802880138158798, + 0.27810442447662354, + 0.02957029454410076, + 0.01145877968519926, + -0.01693027839064598, + -0.170567125082016, + -0.06840421259403229, + -0.0945669412612915, + 0.031600117683410645, + 0.07828302681446075, + -0.08180706948041916, + 0.36660656332969666, + 0.14680393040180206, + -0.027936385944485664, + 0.10192196071147919, + -0.2530248165130615, + -0.04828129708766937, + -0.37582042813301086, + 0.2552221119403839, + 0.16565904021263123, + -0.22276850044727325, + -0.12198073416948318, + -0.07946022599935532, + -0.2545432448387146, + -0.14065489172935486, + 0.05424186959862709, + -0.1933126002550125, + -0.49437007308006287, + 0.1054951623082161, + -0.1716962456703186, + -0.06872667372226715, + 0.251488596200943 + ], + [ + 0.042716387659311295, + 0.31972000002861023, + -0.010500585660338402, + -0.2671748697757721, + 0.03439102694392204, + -0.1448071002960205, + 0.07574623823165894, + -0.0386587418615818, + 0.27850911021232605, + 0.005499227438122034, + -0.06075119227170944, + 0.3770084083080292, + 0.19361630082130432, + -0.117194764316082, + 0.06701774895191193, + -0.19666139781475067, + -0.042083386331796646, + -0.35198548436164856, + 0.21252110600471497, + -0.052135124802589417, + -0.24764281511306763, + -0.1359873265028, + 0.08763523399829865, + 0.028500249609351158, + -0.19216541945934296, + -0.043621379882097244, + -0.32090267539024353, + -1.0384470224380493, + 0.08564361929893494, + -0.1050434559583664, + -0.13982775807380676, + -0.27040591835975647 + ], + [ + -0.1547738015651703, + 0.010156060568988323, + 0.025730807334184647, + -0.18915437161922455, + 0.04497160017490387, + -0.1833949238061905, + 0.3464733064174652, + 0.18731598556041718, + 0.20525187253952026, + -0.3639664053916931, + -0.08459082990884781, + 0.2601427435874939, + -0.1316128522157669, + -0.06030351668596268, + 0.03120589256286621, + 0.036628466099500656, + 0.06424691528081894, + 0.00354331498965621, + 0.16427737474441528, + 0.06946113705635071, + -0.01557729672640562, + -0.08808280527591705, + 0.00928956363350153, + -0.04818645492196083, + 0.1540774554014206, + -0.0539434589445591, + -0.15051674842834473, + -0.46083953976631165, + 0.14556056261062622, + 0.08693238347768784, + 0.06635166704654694, + 0.288321316242218 + ], + [ + 0.21069493889808655, + 0.3775405287742615, + 0.02781510539352894, + -0.15061214566230774, + 0.036228153854608536, + -0.06393110007047653, + 0.2870612144470215, + -0.24592220783233643, + 0.1634010225534439, + -0.19797903299331665, + -0.024444397538900375, + 0.12285908311605453, + -0.08909658342599869, + 0.10783249139785767, + -0.0034670308232307434, + -0.2731111943721771, + 0.0075285290367901325, + -0.13786768913269043, + 0.31370052695274353, + -0.35591286420822144, + -0.23767901957035065, + -0.057755593210458755, + 0.0024891456123441458, + -0.16962304711341858, + -0.01837261952459812, + -0.06682877987623215, + 0.11332356929779053, + -0.4132934808731079, + 0.11556407809257507, + -0.08507954329252243, + -0.32733064889907837, + 0.010065789334475994 + ] + ], + [ + [ + -0.18605123460292816, + 0.11739983409643173, + 0.05586269125342369, + -0.1525053232908249, + 0.03911933675408363, + -0.10893291234970093, + 0.3402596712112427, + 0.2954506278038025, + -0.377069354057312, + -0.19278830289840698, + -0.13508599996566772, + 0.1949634850025177, + 0.34523847699165344, + -0.24765416979789734, + 0.0005459623644128442, + 0.38576817512512207, + -0.006529714446514845, + 0.10977904498577118, + 0.3342397212982178, + -0.05794365704059601, + 0.4818582832813263, + -0.033771295100450516, + 0.49911755323410034, + -0.10129129886627197, + 0.12037386745214462, + 0.15710341930389404, + 0.5359261631965637, + -0.8134608268737793, + -0.2020881474018097, + 0.5905288457870483, + 0.02588370442390442, + -0.06120625510811806 + ], + [ + -0.14155341684818268, + -0.19374480843544006, + -0.223773792386055, + -0.3910347819328308, + -0.1515883058309555, + -0.19531217217445374, + 0.17938441038131714, + 0.9836187958717346, + 0.11785119026899338, + -0.3991227149963379, + -0.0061414530500769615, + -0.37866732478141785, + -0.0741126760840416, + -0.17509669065475464, + -0.6497463583946228, + -0.2112569659948349, + -0.1671578288078308, + -0.07656087726354599, + -0.33108946681022644, + -0.12559936940670013, + 0.4011346995830536, + 0.07961590588092804, + -1.0314326286315918, + -0.20486971735954285, + -1.165649652481079, + -0.10849560052156448, + 0.4967435896396637, + 0.05184348672628403, + 0.13053011894226074, + -0.7026184797286987, + -0.049826208502054214, + 0.4964008033275604 + ], + [ + -0.08895966410636902, + 0.11976306885480881, + -0.15883876383304596, + -0.3941223919391632, + -0.013609763234853745, + -0.1925201267004013, + -0.06455516070127487, + -0.05195235088467598, + 0.36853426694869995, + 0.2750532627105713, + 0.034973032772541046, + 0.17595553398132324, + -0.37064337730407715, + -0.2315579205751419, + -0.40490368008613586, + -0.45892101526260376, + -0.3543330729007721, + -0.13017813861370087, + -0.26918524503707886, + -0.050356876105070114, + 0.012799620628356934, + -0.04474528506398201, + -0.4468500018119812, + -0.059326380491256714, + -0.4762979745864868, + 0.0076547469943761826, + -0.09993913769721985, + -0.05269715189933777, + 0.3258320391178131, + -0.044682826846838, + -0.025637304410338402, + 0.12454556673765182 + ], + [ + -0.2910231649875641, + -0.00820113904774189, + -0.15722934901714325, + -0.23343400657176971, + -0.21504907310009003, + -0.07639383524656296, + 0.2466769963502884, + 0.2817111015319824, + 0.026309674605727196, + 0.10946693271398544, + 0.07965335249900818, + 0.04697227478027344, + -0.09442166984081268, + -0.346798300743103, + -0.26046454906463623, + -0.2677125632762909, + -0.2047855257987976, + -0.28626278042793274, + -0.23367901146411896, + -0.004334359895437956, + 0.050044916570186615, + 0.1356775164604187, + -0.23354335129261017, + 0.14692945778369904, + -0.38647177815437317, + 0.0908605232834816, + -0.17546023428440094, + -0.062431249767541885, + 0.005997927393764257, + 0.08385997265577316, + 0.0723731517791748, + 0.076249860227108 + ], + [ + -0.15532058477401733, + 0.07783746719360352, + -0.026132775470614433, + -0.35442042350769043, + -0.1767459660768509, + 0.03794235736131668, + 0.5910180807113647, + 0.09572941809892654, + 0.024622702971100807, + 0.12307054549455643, + 0.05102112889289856, + 0.007838956080377102, + 0.04435709863901138, + -0.39599502086639404, + -0.11485210061073303, + 0.009748689830303192, + -0.11458301544189453, + -0.11168165504932404, + -0.13311606645584106, + -0.1860145479440689, + 0.18216295540332794, + -0.011088608764111996, + -0.11642128229141235, + 0.07626084983348846, + -0.25643283128738403, + -0.10956339538097382, + -0.028293220326304436, + 0.045495081692934036, + 0.09061814844608307, + 0.142351433634758, + -0.03699753060936928, + 0.15781742334365845 + ], + [ + -0.19630606472492218, + -0.029060717672109604, + 0.01905205100774765, + -0.3468301296234131, + -0.015559244900941849, + -0.003851408837363124, + 0.33676034212112427, + -0.20477192103862762, + 0.12707500159740448, + 0.03135872259736061, + 0.04245160520076752, + -0.006606426555663347, + -0.11417613923549652, + -0.31113770604133606, + -0.11124864965677261, + -0.11994823813438416, + 0.08377886563539505, + -0.11686141788959503, + -0.1563534289598465, + -0.021299660205841064, + -0.041770853102207184, + 0.09161850810050964, + -0.11260680109262466, + -0.14646802842617035, + -0.33934304118156433, + -0.041638389229774475, + 0.09977477043867111, + 0.27113306522369385, + 0.1221589520573616, + -0.07131507247686386, + -0.04921165853738785, + -0.11478307098150253 + ], + [ + -0.08496753126382828, + 0.2197299748659134, + -0.0058780452236533165, + -0.10259278118610382, + 0.14255167543888092, + 0.023506231606006622, + 0.4519461393356323, + -0.32096409797668457, + -0.05761801451444626, + -0.22227703034877777, + -0.08117204904556274, + 0.24260008335113525, + 0.07173830270767212, + -0.14069518446922302, + -0.030554894357919693, + -0.11892729997634888, + -0.016068831086158752, + -0.18782036006450653, + -0.11972972750663757, + -0.3551541864871979, + 0.0010849792743101716, + -0.038821760565042496, + 0.016583306714892387, + 0.024776922538876534, + -0.26719075441360474, + 0.0029158717952668667, + -0.34605634212493896, + 0.19318978488445282, + 0.15093708038330078, + 0.10118932276964188, + -0.05608859285712242, + -0.06538078933954239 + ], + [ + -0.03474864736199379, + 0.24370679259300232, + -0.06378818303346634, + -0.0404290147125721, + -0.2842838764190674, + -0.009178698994219303, + 0.25901538133621216, + 0.08513029664754868, + 0.33120977878570557, + -0.16132278740406036, + -0.060041606426239014, + 0.07716406136751175, + 0.08822618424892426, + -0.16203051805496216, + 0.15926043689250946, + -0.2859940528869629, + -0.09214240312576294, + -0.0695091038942337, + 0.01800079643726349, + 0.19664987921714783, + -0.17581625282764435, + -0.11338654160499573, + -0.19712378084659576, + 0.0028066427912563086, + -0.2037237286567688, + 0.19516976177692413, + -0.40012964606285095, + -0.9559646844863892, + 0.08546072244644165, + -0.17629027366638184, + -0.03889702260494232, + 0.2418515682220459 + ] + ], + [ + [ + 0.12032230198383331, + 0.013065250590443611, + 0.12752984464168549, + -0.07687355577945709, + 0.050580453127622604, + -0.06263372302055359, + 0.2974441945552826, + -0.1913822591304779, + -0.3005852997303009, + -0.25267091393470764, + -0.03695594146847725, + -0.21138346195220947, + 0.2850322723388672, + -0.24092626571655273, + 0.015197086147964, + 0.2751503586769104, + 0.1513373851776123, + 0.08605948090553284, + 0.23217687010765076, + -0.2525770664215088, + 0.334405779838562, + -0.0411946140229702, + 0.016762059181928635, + 0.10989265143871307, + 0.08107607066631317, + 0.05664850026369095, + 0.12859439849853516, + -0.21693825721740723, + 0.11827380955219269, + 0.40185147523880005, + 0.000737464870326221, + -0.2750431299209595 + ], + [ + -0.06130131706595421, + -0.05091743543744087, + -0.1531989723443985, + 0.2821974456310272, + -0.24127693474292755, + -0.037970658391714096, + 0.4496169686317444, + 1.1373172998428345, + 0.5992786884307861, + -0.4296382963657379, + -0.05948203429579735, + -0.9739806056022644, + -0.5149722099304199, + 0.0920015275478363, + -0.3930518329143524, + -0.7643133997917175, + -0.36353442072868347, + -0.9364622235298157, + -0.7815986275672913, + -0.3364103436470032, + -0.29220283031463623, + -0.3335016667842865, + -1.6890398263931274, + 0.3614567816257477, + -0.8663331866264343, + -0.1773153692483902, + 0.19393514096736908, + 0.3984612822532654, + 0.4264069199562073, + -1.1584887504577637, + -0.2045130431652069, + 0.6417514085769653 + ], + [ + -0.1548616737127304, + 0.49504345655441284, + -0.049440667033195496, + -0.033372797071933746, + -0.2904796004295349, + 0.007262376602739096, + -0.5881791710853577, + 0.6216495037078857, + -0.0045819031074643135, + 0.24544177949428558, + -0.08410613238811493, + -0.16524344682693481, + -0.17749132215976715, + 0.408099889755249, + -0.46355506777763367, + -0.8520978093147278, + -0.09662514179944992, + -0.41523465514183044, + -0.1736365258693695, + -0.18461711704730988, + -0.415865957736969, + -0.08616755157709122, + -0.9101094603538513, + 0.4324384331703186, + -0.3805653154850006, + 0.16787102818489075, + -0.30729347467422485, + -0.24807782471179962, + 0.3254038691520691, + -0.23076952993869781, + -0.12113510072231293, + 0.5927037596702576 + ], + [ + -0.24020807445049286, + 0.2736341655254364, + -0.1011374369263649, + -0.08312955498695374, + 0.09364327043294907, + 0.02101838029921055, + -0.36471012234687805, + 0.25472497940063477, + 0.3525984585285187, + 0.0625881627202034, + -0.10157220810651779, + -0.13424862921237946, + -0.2882073223590851, + 0.4236393868923187, + -0.3569248616695404, + -0.5658575296401978, + -0.12343456596136093, + -0.36205652356147766, + -0.19078035652637482, + -0.1668127477169037, + -0.25640448927879333, + -0.04522630572319031, + -0.5605080127716064, + 0.03243792802095413, + -0.31260910630226135, + 0.0918007418513298, + -0.20608098804950714, + -0.3315582871437073, + 0.5010361075401306, + -0.13910861313343048, + -0.32718566060066223, + -0.2812751531600952 + ], + [ + -0.2960871458053589, + 0.20136402547359467, + 0.03444705158472061, + 0.0017662415048107505, + -0.027674652636051178, + 0.021399443969130516, + -0.40615570545196533, + -0.03125041350722313, + 0.09841649979352951, + -0.0763588696718216, + 0.015589933842420578, + -0.1544322520494461, + -0.30687475204467773, + 0.44404444098472595, + -0.11590741574764252, + -0.48005300760269165, + 0.23288658261299133, + -0.2843776345252991, + -0.003898805705830455, + -0.05664750561118126, + -0.13241349160671234, + -0.08027520775794983, + -0.3626725971698761, + 0.29015547037124634, + -0.14136762917041779, + 0.029761506244540215, + -0.09610302001237869, + -0.4377540349960327, + 0.16085058450698853, + -0.07196350395679474, + -0.11059610545635223, + 0.029181715101003647 + ], + [ + -0.07587147504091263, + 0.5751363039016724, + -0.05742675065994263, + 0.2693050503730774, + 0.08822890371084213, + -0.0057360525242984295, + -0.4613089859485626, + 0.026163948699831963, + -0.005501875653862953, + 0.07286220788955688, + -0.08094843477010727, + -0.028906602412462234, + -0.20255479216575623, + 0.4330625832080841, + -0.07771210372447968, + -0.3461516201496124, + -0.15813042223453522, + -0.19382354617118835, + -0.1161712035536766, + 0.053784243762493134, + -0.23769181966781616, + -0.13103018701076508, + -0.16893912851810455, + 0.09951672703027725, + -0.09229983389377594, + 0.06506495922803879, + -0.3144543766975403, + 0.08827842026948929, + 0.35228514671325684, + -0.1012420505285263, + -0.07657808065414429, + 0.23310592770576477 + ], + [ + -0.09603124111890793, + 0.4518109858036041, + -0.014988605864346027, + -0.03175123780965805, + 0.09352632611989975, + -0.13752037286758423, + -0.1908067762851715, + -0.03419505059719086, + 0.01590650901198387, + -0.044251780956983566, + -0.0837441235780716, + -0.14741112291812897, + -0.18113262951374054, + 0.2480458766222, + -0.11633697152137756, + -0.48468536138534546, + 0.11364537477493286, + -0.10570629686117172, + 0.010274759493768215, + -0.31010159850120544, + -0.20390400290489197, + -0.03764929622411728, + -0.26157817244529724, + 0.11477465182542801, + 0.005369789898395538, + 0.09862540662288666, + 0.11143352836370468, + -0.13725464046001434, + 0.08181245625019073, + -0.016917942091822624, + -0.3360675573348999, + 0.1740008294582367 + ], + [ + -0.1611892729997635, + 0.162135049700737, + -0.028105953708291054, + -0.25185316801071167, + -0.02111389860510826, + 0.017542289569973946, + 0.36085593700408936, + -0.10859667509794235, + 0.24312573671340942, + -0.15807275474071503, + -0.06079357862472534, + 0.05087890848517418, + -0.2526106834411621, + -0.04231014847755432, + -0.01040763221681118, + -0.14318402111530304, + 0.1686774641275406, + -0.2039654403924942, + 0.0907057598233223, + 0.2626534402370453, + 0.028325024992227554, + -0.013995477929711342, + -0.3018431067466736, + -0.16776089370250702, + -0.3818683922290802, + 0.20923824608325958, + -0.2687510848045349, + -0.14199304580688477, + 0.11078774183988571, + 0.02480337955057621, + -0.15040677785873413, + -0.07711506634950638 + ] + ], + [ + [ + -0.10963869094848633, + 0.01396549679338932, + 0.006351398304104805, + -0.13310623168945312, + -0.07966906577348709, + -0.06861972063779831, + 0.6662306785583496, + -0.06549125164747238, + 0.13311675190925598, + 0.17622010409832, + 0.0923064723610878, + 0.36890116333961487, + 0.2740646004676819, + -0.075152687728405, + -0.07239384949207306, + 0.04339810460805893, + 0.049556031823158264, + 0.023183548822999, + 0.6414496302604675, + -0.1474793404340744, + 0.0039022802375257015, + -0.08819551020860672, + 0.22860591113567352, + -0.036745306104421616, + 0.150071382522583, + -0.07951180636882782, + 0.12000011652708054, + -0.15472960472106934, + -0.056879304349422455, + 0.3065168261528015, + 0.10336397588253021, + 0.22763022780418396 + ], + [ + 0.06858190149068832, + -0.268001526594162, + 0.10577720403671265, + 0.5300593376159668, + -0.16277562081813812, + -0.14633235335350037, + 0.34024062752723694, + 0.672913134098053, + 0.45452865958213806, + -0.5045267939567566, + 0.0024824426509439945, + -0.2953639626502991, + -0.34422582387924194, + 0.24135494232177734, + -0.15139992535114288, + -0.16631750762462616, + -0.146169975399971, + -0.3423013687133789, + -0.8816781640052795, + 0.27303194999694824, + -0.4977717399597168, + -0.409960001707077, + -0.6506439447402954, + 0.5509560704231262, + -0.9138875007629395, + 0.0002619207079987973, + -0.0827883929014206, + 1.2183959484100342, + 0.3686019778251648, + -1.4259581565856934, + -0.3078993260860443, + 0.3975030183792114 + ], + [ + 0.24514029920101166, + 0.13086114823818207, + 0.06069979816675186, + 0.5347840189933777, + -0.23598258197307587, + -0.16329875588417053, + -0.8852187395095825, + 0.08319123834371567, + 0.0997975692152977, + 0.27715596556663513, + 0.02560489997267723, + -0.2575121521949768, + -0.37361523509025574, + 0.05857258662581444, + 0.08506428450345993, + -0.45584583282470703, + 0.07903332263231277, + -0.35220998525619507, + 0.21170459687709808, + 0.3283860683441162, + -0.45460769534111023, + -0.22871309518814087, + -0.13893088698387146, + 0.1977406144142151, + -0.7517579793930054, + -0.0741233080625534, + -0.5572832822799683, + -0.6520438194274902, + 0.3788811266422272, + -0.6866037845611572, + -0.12460516393184662, + 0.6071924567222595 + ], + [ + 0.13080726563930511, + 0.2705743610858917, + 0.12230049818754196, + 0.6753602623939514, + -0.3102819621562958, + -0.15881796181201935, + -0.6729056239128113, + 0.2818000316619873, + 0.2850337326526642, + -0.0700572282075882, + -0.11874202638864517, + -0.314498633146286, + -0.36602863669395447, + 0.3513075113296509, + 0.1796017289161682, + -0.35999056696891785, + 0.01051675621420145, + -0.19946235418319702, + 0.15670321881771088, + 0.11383389681577682, + -0.4767802357673645, + -0.037755709141492844, + 0.0021350602619349957, + 0.2564750611782074, + -0.37105587124824524, + 0.12387122958898544, + 0.027125444263219833, + -0.25869399309158325, + 0.41085880994796753, + -0.5173730254173279, + -0.05825566127896309, + -0.044659074395895004 + ], + [ + 0.13103623688220978, + 0.0514400489628315, + 0.09505796432495117, + 0.27628567814826965, + -0.13824839890003204, + -0.17226767539978027, + -0.38585567474365234, + -0.15684030950069427, + 0.08586953580379486, + -0.10090917348861694, + -0.036365918815135956, + -0.07563205063343048, + -0.1845574975013733, + 0.05797381326556206, + 0.010913686826825142, + -0.13317321240901947, + -0.029745176434516907, + -0.05814499780535698, + 0.17446759343147278, + 0.28393083810806274, + -0.3165554702281952, + 0.04344512149691582, + 0.17378166317939758, + -0.02410314232110977, + -0.004268135875463486, + -0.06901207566261292, + 0.08178813010454178, + -0.29917189478874207, + 0.5421503782272339, + -0.20252785086631775, + 0.03511355072259903, + 0.09191235899925232 + ], + [ + -0.19579248130321503, + 0.09037438780069351, + -0.05334984138607979, + 0.29415422677993774, + -0.20865392684936523, + -0.005476294085383415, + -0.3110634982585907, + 0.09254439920186996, + 0.10921569913625717, + -0.13584664463996887, + -0.10138717293739319, + -0.26525822281837463, + -0.1927466243505478, + 0.30781814455986023, + -0.13147760927677155, + -0.023379923775792122, + 0.22946393489837646, + -0.019885998219251633, + 0.04026765376329422, + 0.27874478697776794, + -0.18041375279426575, + -0.08370291441679001, + -0.02302468940615654, + 0.12272486835718155, + 0.07037805020809174, + -0.11036732792854309, + 0.25530070066452026, + -0.3853299021720886, + 0.2798207700252533, + 0.020777182653546333, + -0.1527324616909027, + -0.2216588258743286 + ], + [ + -0.1806962937116623, + 0.5052217245101929, + -0.04909288510680199, + 0.1004984900355339, + -0.07784369587898254, + -0.12430038303136826, + -0.044534437358379364, + 0.17571492493152618, + 0.13416743278503418, + -0.09532487392425537, + -0.027021531015634537, + 0.16900621354579926, + -0.20147040486335754, + 0.33566489815711975, + -0.009426111355423927, + 0.08531876653432846, + 0.09824929386377335, + -0.08551376312971115, + 0.16805003583431244, + 0.3058200478553772, + -0.31195276975631714, + 0.0482872799038887, + 0.16903111338615417, + 0.017846740782260895, + -0.09700009971857071, + 0.059826649725437164, + -0.14817887544631958, + -0.20170196890830994, + 0.2920738458633423, + -0.11366693675518036, + 0.10163288563489914, + 0.19782575964927673 + ], + [ + -0.08066987246274948, + 0.11024926602840424, + 0.0678630843758583, + 0.20057666301727295, + 0.08678722381591797, + -0.1482822448015213, + -0.2651008367538452, + -0.20166964828968048, + 0.10384856909513474, + -0.12155111879110336, + 0.07175661623477936, + -0.016095135360956192, + 0.011020783334970474, + 0.41908079385757446, + 0.09845248609781265, + -0.2800842523574829, + 0.11196138709783554, + 0.08798867464065552, + -0.01972333900630474, + -0.045045334845781326, + -0.2615768313407898, + 0.03148965165019035, + 0.15109752118587494, + 0.1248755007982254, + -0.070142962038517, + -0.05502995103597641, + -0.03330467268824577, + 0.22213412821292877, + 0.31435540318489075, + -0.20529884099960327, + -0.1363195925951004, + -0.04616208001971245 + ] + ], + [ + [ + -0.15522029995918274, + 0.14525572955608368, + -0.048701975494623184, + -0.2419920116662979, + 0.11578179895877838, + -0.02918826788663864, + 0.41177821159362793, + 0.1013314500451088, + -0.28776827454566956, + -0.16570332646369934, + 0.0344313308596611, + 0.269475519657135, + -0.11209665238857269, + -0.388430118560791, + 0.09064523875713348, + 0.4344412684440613, + 0.023057835176587105, + 0.2894280254840851, + 0.8105983734130859, + 0.10955885052680969, + 0.1437934935092926, + -0.0644819512963295, + -0.09407263249158859, + 0.01081524882465601, + -0.16649353504180908, + 0.02169632911682129, + -0.10669901967048645, + -0.46243786811828613, + -0.06400925666093826, + 0.45741602778434753, + -0.12969756126403809, + -0.31587961316108704 + ], + [ + 0.2310161590576172, + 0.1513911485671997, + -0.1525915265083313, + 0.07010916620492935, + -0.2706226110458374, + -0.056375354528427124, + 0.23115521669387817, + 0.735762894153595, + 0.10389408469200134, + -0.057095449417829514, + 0.10413786768913269, + 0.1952919065952301, + -0.5224527716636658, + -0.7331411838531494, + 0.2581283748149872, + 0.2576152980327606, + -0.30482837557792664, + 0.4209546446800232, + -0.9551002979278564, + 0.3839029371738434, + 0.0884646475315094, + -0.1911327838897705, + -0.1653972715139389, + -0.1057778149843216, + -0.3412792980670929, + -0.07738825678825378, + -0.1607174575328827, + -0.4477510154247284, + -0.026686057448387146, + -0.2688215672969818, + -0.16976667940616608, + 0.2426142394542694 + ], + [ + -0.11564157903194427, + 0.08146050572395325, + -0.044162504374980927, + 0.3418678045272827, + -0.17309454083442688, + -0.08297457545995712, + -0.4471215605735779, + -0.11962295323610306, + 0.3238963484764099, + 0.10388045758008957, + -0.030211009085178375, + 0.1704922914505005, + -0.38037875294685364, + -0.39982327818870544, + 0.28026625514030457, + 0.07205957919359207, + -0.23660171031951904, + 0.5913487672805786, + 0.0534408874809742, + -0.05378042906522751, + -0.20640210807323456, + -0.0898679569363594, + 0.3239456117153168, + -0.03441619873046875, + -0.1371658593416214, + -0.0330335795879364, + -0.16033734381198883, + -0.248163104057312, + 0.32018181681632996, + 0.0023370925337076187, + 0.024295397102832794, + 0.37708213925361633 + ], + [ + -0.09167583286762238, + -0.2286205142736435, + 0.013891136273741722, + 0.02823999524116516, + -0.2918164134025574, + 0.0036015422083437443, + 0.037132058292627335, + -0.10412953794002533, + 0.06021200120449066, + 0.13501079380512238, + -0.02347973734140396, + 0.0028234869241714478, + -0.30785053968429565, + -0.5104283690452576, + 0.17403441667556763, + 0.18982470035552979, + 0.10314636677503586, + 0.5480068325996399, + -0.22152499854564667, + 0.1505189687013626, + -0.041013386100530624, + -0.013330471701920033, + 0.19736842811107635, + -0.1860719919204712, + 0.08084568381309509, + 0.06829535216093063, + 0.2762707471847534, + -0.09565240889787674, + 0.2291594296693802, + 0.09286974370479584, + 0.037248395383358, + -0.2691025733947754 + ], + [ + 0.121305912733078, + 0.04695378243923187, + -0.02402561716735363, + 0.10849283635616302, + -0.14987102150917053, + -0.06926077604293823, + -0.05328619107604027, + -0.0022421961184591055, + 0.19420604407787323, + 0.16170334815979004, + -0.07530751824378967, + -0.23412451148033142, + -0.21630242466926575, + -0.13343945145606995, + 0.39397650957107544, + 0.385067880153656, + -0.16512146592140198, + 0.6379542946815491, + -0.09167581051588058, + -0.10673955082893372, + -0.1480279117822647, + -0.06966269016265869, + 0.2265280783176422, + 0.03420054912567139, + 0.07961857318878174, + 0.08605347573757172, + -0.2520245611667633, + 0.24459406733512878, + 0.1172320544719696, + 0.07307584583759308, + 0.24031303822994232, + 0.12776996195316315 + ], + [ + 0.2408185750246048, + 0.14767110347747803, + -0.012874491512775421, + 0.04851546511054039, + 0.03134090453386307, + 0.08992753177881241, + 0.2824068069458008, + -0.3923397362232208, + 0.08742185682058334, + -0.05591224506497383, + -0.028862349689006805, + -0.45367246866226196, + 0.04893018305301666, + -0.39136987924575806, + 0.18128176033496857, + 0.05215567350387573, + -0.10009770840406418, + 0.3572053015232086, + -0.208544060587883, + -0.09196128696203232, + 0.1685018390417099, + -0.06778997927904129, + 0.1520647406578064, + 0.06650543212890625, + 0.06193838268518448, + -0.09910833090543747, + 0.13432639837265015, + 0.4747888445854187, + 0.11700759083032608, + 0.08246634155511856, + 0.09387682378292084, + -0.15453428030014038 + ], + [ + 0.04149376228451729, + 0.08418284356594086, + 0.02521502785384655, + 0.12901747226715088, + -0.052177734673023224, + -0.03588453307747841, + 0.17664910852909088, + -0.3296016752719879, + -0.028861748054623604, + 0.13370881974697113, + 0.041424356400966644, + -0.21252360939979553, + -0.06339697539806366, + -0.2308209240436554, + 0.017751067876815796, + 0.09419068694114685, + 0.000689395354129374, + 0.42961323261260986, + -0.11830809712409973, + -0.24170850217342377, + -0.028695017099380493, + -0.052149899303913116, + 0.019938349723815918, + 0.07820472121238708, + 0.117585189640522, + -0.012605034746229649, + -0.031079962849617004, + 0.402763694524765, + 0.3229021728038788, + 0.08512917906045914, + -0.17632730305194855, + -0.17149485647678375 + ], + [ + -0.11428394168615341, + 0.28277161717414856, + 0.02848120778799057, + 0.17491692304611206, + 0.01928136684000492, + 0.06738340109586716, + -0.015375936403870583, + -0.0344187468290329, + -0.19040395319461823, + -0.3711230158805847, + -0.12858332693576813, + -0.2517153024673462, + 0.22246557474136353, + -0.04411255568265915, + -0.14632858335971832, + 0.13609157502651215, + 0.15789073705673218, + 0.08029817044734955, + -0.20524752140045166, + 0.3099493682384491, + 0.06402911990880966, + 0.04081747308373451, + 0.24348732829093933, + 0.08192925155162811, + 0.47054147720336914, + 0.005552643910050392, + -0.07621400058269501, + 0.5066249966621399, + 0.4109703004360199, + 0.06126030161976814, + -0.18827471137046814, + -0.16013994812965393 + ] + ] + ], + [ + [ + [ + 0.05618710815906525, + 0.014742618426680565, + 0.08161060512065887, + 0.24941712617874146, + -0.2026374340057373, + -0.12262936681509018, + -0.23106923699378967, + -0.08339240401983261, + -0.024148376658558846, + 0.14004549384117126, + 0.04115758091211319, + -0.39953044056892395, + 0.1621273159980774, + 0.4588371813297272, + -0.118478924036026, + 0.047532692551612854, + -0.029377752915024757, + 0.03422075882554054, + -0.3540397882461548, + 0.2625093162059784, + -0.15071487426757812, + 0.18052905797958374, + -0.1722453534603119, + -0.053645651787519455, + 0.0020375533495098352, + 0.009204947389662266, + 0.2177763432264328, + 0.17310069501399994, + 0.12912891805171967, + -0.06042107939720154, + 0.13731031119823456, + -0.27062079310417175 + ], + [ + 0.02295878157019615, + -0.44790324568748474, + -0.16937507688999176, + 0.31960466504096985, + -0.1634877622127533, + 0.02603898197412491, + 0.4822300970554352, + 0.3082602620124817, + -0.0233797337859869, + -0.2353743612766266, + 0.08727748692035675, + 0.12027788907289505, + 0.2713911235332489, + -0.2180953174829483, + 0.20745743811130524, + -0.44654691219329834, + -0.40183529257774353, + -0.5613242983818054, + 0.483064740896225, + 0.21047474443912506, + -0.3610187768936157, + 0.10901857912540436, + -0.19461500644683838, + -0.5574713349342346, + -0.3218102753162384, + -0.3876219391822815, + -0.032913874834775925, + -0.29552367329597473, + 0.22890564799308777, + -0.3549991548061371, + -0.223785400390625, + 0.22990548610687256 + ], + [ + -0.057321202009916306, + 0.13390900194644928, + -0.04663621261715889, + 0.021786658093333244, + 0.07985735684633255, + -0.040841445326805115, + 0.47903791069984436, + 0.34492820501327515, + 0.20337030291557312, + 0.12482786923646927, + -0.027179570868611336, + -0.05760405957698822, + 0.11388981342315674, + -0.515198290348053, + 0.21558338403701782, + 0.0839480608701706, + -0.2705117464065552, + 0.04700968787074089, + 0.3561597168445587, + -0.1093420684337616, + -0.30195197463035583, + -0.012714849784970284, + -0.12706606090068817, + -0.10964373499155045, + -0.058842048048973083, + -0.13339976966381073, + 0.0006926903733983636, + 0.36834049224853516, + -0.28436794877052307, + -0.10567167401313782, + 0.1385418027639389, + 0.22753559052944183 + ], + [ + -0.11593851447105408, + -0.2860642969608307, + 0.0651230737566948, + 0.028456397354602814, + 0.012279183603823185, + 0.030857563018798828, + 0.29234930872917175, + 0.11617198586463928, + -0.02304977737367153, + 0.14359457790851593, + -0.08329035341739655, + 0.12978971004486084, + 0.11805657297372818, + -0.2049829214811325, + -0.011209837161004543, + 0.11414430290460587, + -0.3274945020675659, + -0.1871969997882843, + 0.3304104208946228, + 0.25815606117248535, + -0.044937871396541595, + 0.03306027874350548, + 0.027001887559890747, + -0.25431734323501587, + 0.22827458381652832, + 0.06670690327882767, + 0.012925866059958935, + -0.4176064729690552, + 0.2068270742893219, + -0.020652128383517265, + 0.03784060478210449, + 0.2556353509426117 + ], + [ + -0.15306930243968964, + 0.09543973952531815, + 0.03490293025970459, + -0.11920275539159775, + 0.08105555176734924, + 0.0343380942940712, + 0.23957528173923492, + 0.11018899083137512, + -0.06275911629199982, + -0.03373870998620987, + 0.026398619636893272, + -0.005780048202723265, + 0.045261774212121964, + -0.18058985471725464, + 0.009626229293644428, + 0.14973828196525574, + -0.2520337402820587, + -0.074486143887043, + 0.2775489091873169, + 0.07796528935432434, + -0.3763485848903656, + 0.0908668115735054, + 0.2996059060096741, + -0.11312079429626465, + 0.2775276005268097, + 0.05677064508199692, + -0.19819442927837372, + -0.39602887630462646, + -0.005818302743136883, + 0.14206452667713165, + 0.11794886738061905, + -0.038719482719898224 + ], + [ + -0.06954924017190933, + -0.21995460987091064, + -0.0319267213344574, + 0.1454881876707077, + -0.17055393755435944, + 0.058908961713314056, + 0.3823865056037903, + 0.21508020162582397, + -0.021357186138629913, + -0.0159929022192955, + -0.011036688461899757, + 0.0377209410071373, + 0.1757315695285797, + -0.16022838652133942, + 0.062494467943906784, + -0.04606318846344948, + -0.22432896494865417, + -0.0077841682359576225, + 0.29029756784439087, + 0.1370837390422821, + -0.21806341409683228, + -0.15511241555213928, + -0.3122311532497406, + -0.27022022008895874, + 0.10008127242326736, + 0.08382752537727356, + -0.26991698145866394, + -0.721613883972168, + -0.058419499546289444, + 0.09714669734239578, + -0.015242043882608414, + 0.10857681185007095 + ], + [ + 0.08160270750522614, + 0.04224899038672447, + 0.042207684367895126, + 0.0953151136636734, + -0.11016616225242615, + 0.009339702315628529, + 0.3409062922000885, + -0.08013148605823517, + -0.12226229161024094, + 0.15922102332115173, + 0.06999826431274414, + -0.0026650000363588333, + 0.21156585216522217, + -0.004097582306712866, + 0.09360912442207336, + -0.05990602821111679, + -0.21353265643119812, + -0.0970572680234909, + 0.25824615359306335, + 0.08663678914308548, + -0.09541067481040955, + -0.08840994536876678, + 0.16691811382770538, + -0.0746266320347786, + 0.23518982529640198, + 0.005076142027974129, + 0.022857528179883957, + -0.4271358251571655, + 0.1846206784248352, + 0.16351275146007538, + 0.014971992932260036, + -0.0687781348824501 + ], + [ + -0.16466666758060455, + -0.14889462292194366, + -0.02575751021504402, + 0.1445641815662384, + 0.051800746470689774, + 0.049370795488357544, + 0.5182511210441589, + -0.03020973689854145, + 0.09208135306835175, + 0.05846567451953888, + 0.012347221374511719, + 0.12137185782194138, + 0.04212742671370506, + -0.27627959847450256, + -0.020932627841830254, + -0.02974984049797058, + -0.09215491265058517, + -0.23096926510334015, + 0.1352856606245041, + -0.4980470836162567, + -0.034078199416399, + 0.01104156393557787, + 0.07852305471897125, + -0.1504376083612442, + 0.12206463515758514, + -0.005363043863326311, + 0.18606334924697876, + 0.04606827348470688, + 0.11067815124988556, + 0.16268958151340485, + -0.16986492276191711, + -0.09959129244089127 + ] + ], + [ + [ + 0.11038229614496231, + 0.23469972610473633, + 0.0013567684218287468, + 0.21232733130455017, + -0.18186408281326294, + 0.1371629387140274, + -0.03953371196985245, + 0.1727396845817566, + -0.058657143265008926, + -0.39859136939048767, + -0.003843278856948018, + -0.20111626386642456, + 0.14332512021064758, + 0.18631646037101746, + 0.05056046321988106, + 0.009826398454606533, + 0.17126622796058655, + 0.11644414812326431, + -0.035054512321949005, + 0.1209537535905838, + 0.02943466603755951, + -0.023617777973413467, + -0.3883809745311737, + 0.068825863301754, + -0.3770301342010498, + -0.006897368934005499, + 0.1040172427892685, + 0.23688142001628876, + 0.21308569610118866, + -0.033904239535331726, + 0.18087483942508698, + 0.01494187954813242 + ], + [ + -0.3487277626991272, + -0.03466952219605446, + -0.18985438346862793, + -0.22934384644031525, + 0.017970040440559387, + -0.026277858763933182, + 0.049000900238752365, + 0.7392961978912354, + 0.7347911596298218, + -0.534899890422821, + 0.08316449820995331, + -0.40732643008232117, + 0.22212383151054382, + -0.5070199370384216, + -0.4238615036010742, + -0.42017245292663574, + -0.479999840259552, + -0.2248159646987915, + 0.1295083463191986, + 0.13110166788101196, + 0.008596968837082386, + 0.07620701938867569, + -0.7596149444580078, + -0.06902110576629639, + -0.6961783170700073, + -0.26065966486930847, + 0.225581094622612, + 0.5892044305801392, + 0.048487428575754166, + -0.7745305895805359, + -0.28635984659194946, + 0.8133048415184021 + ], + [ + -0.3076243996620178, + 0.11174389719963074, + -0.10658503323793411, + -0.15453343093395233, + -0.08196619898080826, + 0.16873303055763245, + 0.3243827521800995, + 0.2990114688873291, + 0.16968950629234314, + 0.14196008443832397, + 0.007899822667241096, + -0.43231531977653503, + -0.12941758334636688, + -0.39087262749671936, + -0.28226035833358765, + 0.2912120521068573, + -0.3955308794975281, + -0.04322029650211334, + 0.16795311868190765, + -0.15859079360961914, + -0.0127711221575737, + -0.022519700229167938, + -0.5283705592155457, + 0.21248865127563477, + -0.32199153304100037, + 0.0275728702545166, + 0.4289063811302185, + 0.08269382268190384, + 0.11162815243005753, + -0.5212677121162415, + -0.15510772168636322, + 0.305446594953537 + ], + [ + -0.03956734016537666, + 0.12565980851650238, + -0.07121805846691132, + -0.17451751232147217, + -0.1983986347913742, + 0.038582105189561844, + 0.4150651693344116, + 0.3202030062675476, + 0.20969781279563904, + -0.08547845482826233, + -0.040083982050418854, + -0.06788869202136993, + -0.2322598099708557, + -0.15134887397289276, + -0.1923501342535019, + 0.0564018078148365, + -0.003038455033674836, + -0.10204089432954788, + 0.12755241990089417, + -0.046919796615839005, + -0.1579822301864624, + 0.05917482450604439, + -0.505948543548584, + -0.0303952656686306, + -0.389944851398468, + 0.24850307404994965, + 0.08260957151651382, + -0.08696568757295609, + 0.2058102935552597, + -0.2339814007282257, + -0.16453421115875244, + 0.251152902841568 + ], + [ + -0.276606023311615, + -0.07547767460346222, + -0.04232488200068474, + -0.12131515145301819, + 0.08489348739385605, + -0.09545544534921646, + 0.37857043743133545, + 0.03857461363077164, + 0.32249411940574646, + 0.02466672472655773, + -0.012632947415113449, + -0.26537200808525085, + -0.27586671710014343, + -0.13788101077079773, + -0.24745842814445496, + 0.1599281132221222, + -0.3684237599372864, + -0.013804962858557701, + 0.08678814768791199, + -0.2311169058084488, + -0.22683532536029816, + -0.09876476973295212, + -0.11255563050508499, + -0.15861625969409943, + -0.23976865410804749, + 0.05930674821138382, + -0.07632430642843246, + -0.17713379859924316, + 0.167583629488945, + -0.262178510427475, + -0.21919168531894684, + 0.2840808928012848 + ], + [ + 0.02008093148469925, + -0.1710129827260971, + -0.10278470069169998, + 0.023775633424520493, + -0.2916693687438965, + 0.08742409944534302, + 0.1800025850534439, + 0.20395484566688538, + 0.26294776797294617, + 0.17517486214637756, + -0.03397725895047188, + -0.10495627671480179, + -0.4375390112400055, + 0.08998925238847733, + -0.25143271684646606, + -0.18675924837589264, + -0.016954315826296806, + -0.06725282222032547, + -0.022294335067272186, + -0.14795109629631042, + -0.042231835424900055, + -0.007685631979256868, + -0.10392385721206665, + 0.1405908167362213, + -0.37867271900177, + 0.1089153066277504, + -0.23034121096134186, + -0.29017174243927, + -0.016286250203847885, + -0.23944249749183655, + -0.09180551022291183, + 0.24119070172309875 + ], + [ + 0.002089473884552717, + -0.02264351397752762, + -0.06039208918809891, + -0.1421719491481781, + -0.1990894079208374, + 0.03286843001842499, + 0.21450093388557434, + -0.11461979895830154, + 0.3300413489341736, + 0.09199963510036469, + 0.004217677284032106, + -0.08019622415304184, + -0.16940632462501526, + -0.24722543358802795, + 0.0020360418129712343, + -0.05656198412179947, + 0.058692723512649536, + -0.0422261580824852, + 0.1011413186788559, + -0.16115702688694, + 0.03629511594772339, + 0.07239188998937607, + 0.06348738819360733, + -0.0688871517777443, + -0.017147013917565346, + -0.0019385628402233124, + 0.15734350681304932, + -0.4827706813812256, + 0.07977954298257828, + -0.0005073967622593045, + -0.14355304837226868, + 0.4165703356266022 + ], + [ + 0.03201448544859886, + -0.2545100450515747, + -0.07428832352161407, + -0.22834673523902893, + -0.07815517485141754, + 0.08297977596521378, + 0.15556548535823822, + 0.1586798131465912, + 0.17891645431518555, + -0.10573206841945648, + 0.055231913924217224, + -0.1269317865371704, + -0.11894815415143967, + 0.018188443034887314, + -0.11345478892326355, + -0.28281933069229126, + -0.24280695617198944, + -0.20244839787483215, + 0.21633663773536682, + 0.11456606537103653, + -0.25770631432533264, + -0.06718549877405167, + -0.06298644095659256, + -0.14829233288764954, + -0.052813366055488586, + 0.13417497277259827, + 0.10956938564777374, + -0.970233678817749, + -0.03659971430897713, + -0.047605182975530624, + 0.1203070729970932, + 0.034226879477500916 + ] + ], + [ + [ + 0.0014888126170262694, + 0.09941323101520538, + 0.05025782436132431, + 0.3089746832847595, + -0.010965579189360142, + -0.015273399651050568, + 0.21788974106311798, + -0.007592557463794947, + 0.01637805625796318, + -0.0829370766878128, + -0.1160246729850769, + -0.2870008051395416, + 0.2562498152256012, + 0.10308419913053513, + 0.06268415600061417, + -0.18416154384613037, + -0.0027219888288527727, + 0.08805465698242188, + -0.28983351588249207, + -0.13716842234134674, + -0.21528169512748718, + -0.0137243140488863, + -0.07526183128356934, + -0.1322629153728485, + -0.12759165465831757, + -0.07813521474599838, + 0.451229065656662, + 0.3382684886455536, + -0.2707102298736572, + 0.15963061153888702, + 0.2766605317592621, + 0.39709237217903137 + ], + [ + -0.03591116890311241, + 0.08800338953733444, + -0.23847296833992004, + -0.42863667011260986, + 0.2507750988006592, + -0.13577404618263245, + 0.23723174631595612, + 0.26103848218917847, + 0.3927045166492462, + -0.8256406784057617, + -0.04741542413830757, + 0.4490744173526764, + 0.09716543555259705, + 0.11444162577390671, + -0.20189030468463898, + -0.5269771814346313, + 0.09636779874563217, + -0.6760370135307312, + 0.9351149797439575, + -0.04598120227456093, + -0.387926310300827, + -0.21752090752124786, + -0.9219740629196167, + -0.21143962442874908, + -0.8334089517593384, + 0.005427941679954529, + -0.29939278960227966, + 0.9791685938835144, + 0.06225080043077469, + -0.635109007358551, + 0.038746386766433716, + 0.25958070158958435 + ], + [ + -0.15680892765522003, + -0.01816670037806034, + -0.0623992420732975, + -0.22157524526119232, + 0.1640087217092514, + -0.08959291875362396, + 0.4383052587509155, + -0.2448488026857376, + 0.3617546260356903, + -0.3160429000854492, + 0.10072017461061478, + 0.3927256762981415, + -0.3855833113193512, + 0.1373552680015564, + -0.09159179031848907, + 0.028691641986370087, + -0.05191386118531227, + -0.3965790569782257, + 0.1798325926065445, + -0.34369373321533203, + 0.10231759399175644, + 0.08637318760156631, + -0.5620458722114563, + 0.27868083119392395, + -0.36031374335289, + 0.05245880037546158, + -0.23084372282028198, + 0.36513230204582214, + -0.0020429505966603756, + -0.3831276595592499, + 0.14311839640140533, + 0.24046121537685394 + ], + [ + 0.03216347098350525, + 0.021368013694882393, + 0.012323960661888123, + -0.1631166934967041, + 0.09813076257705688, + -0.10749125480651855, + 0.3030565679073334, + 0.14321550726890564, + -0.04266679286956787, + -0.0417398065328598, + 0.0017723060445860028, + 0.21139030158519745, + -0.3532627820968628, + 0.11610377579927444, + -0.08375456184148788, + -0.004155078902840614, + -0.05883026123046875, + -0.3426551818847656, + 0.23244717717170715, + 0.033427126705646515, + -0.26837486028671265, + -0.04837961494922638, + -0.43198132514953613, + -0.11768216639757156, + -0.2919982671737671, + 0.1643252670764923, + -0.09689566493034363, + 0.043895963579416275, + 0.0406561978161335, + -0.37879031896591187, + -0.015223391354084015, + 0.34204912185668945 + ], + [ + 0.08946303278207779, + -0.021513869985938072, + -0.07711855322122574, + -0.14158034324645996, + -0.06610175967216492, + 0.044320449233055115, + -0.09589829295873642, + 0.031959522515535355, + 0.35787567496299744, + -0.07767336070537567, + -0.01946990191936493, + 0.4056803584098816, + -0.12129899114370346, + 0.30741527676582336, + -0.2788259983062744, + -0.009434198960661888, + -0.06897026300430298, + -0.18672072887420654, + 0.12695737183094025, + 0.012410114519298077, + -0.12013211101293564, + -0.0161605067551136, + -0.13954268395900726, + -0.018484776839613914, + -0.1950521469116211, + 0.08860577642917633, + -0.12306352704763412, + -0.379783034324646, + 0.1653977334499359, + -0.2119220793247223, + -0.030651021748781204, + 0.08797299116849899 + ], + [ + 0.06664231419563293, + -0.212351992726326, + -0.04872344061732292, + -0.15980315208435059, + 0.101871058344841, + -0.10658649355173111, + -0.16941741108894348, + -0.011730659753084183, + 0.004767062142491341, + -0.21128222346305847, + 0.0605681836605072, + 0.27719399333000183, + -0.09782913327217102, + 0.01237318105995655, + -0.13911905884742737, + 0.18894419074058533, + -0.10808057337999344, + -0.06590951234102249, + 0.14474669098854065, + 0.12879931926727295, + -0.23584629595279694, + -0.013558324426412582, + -0.1852128803730011, + 0.2941496968269348, + 0.006644833367317915, + -0.038042981177568436, + 0.12306424230337143, + -0.10958727449178696, + 0.2243364155292511, + 0.04377589747309685, + -0.014747611247003078, + 0.2950264811515808 + ], + [ + 0.075571209192276, + -0.021781256422400475, + 0.0714406743645668, + -0.16428078711032867, + 0.049929048866033554, + 0.12422499805688858, + -0.10810834914445877, + -0.11310413479804993, + 0.12373224645853043, + 0.08107759058475494, + 0.012324098497629166, + 0.17972980439662933, + -0.4210054278373718, + 0.11944692581892014, + -0.12779416143894196, + 0.07229633629322052, + -0.2208864837884903, + -0.12366579473018646, + 0.06097937375307083, + 0.35456207394599915, + -0.15234193205833435, + 0.057927899062633514, + -0.2436833530664444, + 0.015507221221923828, + -0.20653927326202393, + 0.09087104350328445, + -0.18091140687465668, + -0.12127195298671722, + 0.24806232750415802, + -0.1834123432636261, + 0.058253213763237, + 0.2159404158592224 + ], + [ + -0.015471096150577068, + -0.06852225959300995, + -0.16829662024974823, + 0.19682753086090088, + -0.13678570091724396, + -0.00640078354626894, + 0.18169398605823517, + 0.2520599365234375, + 0.3769625425338745, + -0.029883205890655518, + -0.06368209421634674, + 0.2952517569065094, + -0.45494019985198975, + 0.02759290114045143, + -0.06260386854410172, + 0.009218775667250156, + -0.28268468379974365, + 0.05692040175199509, + 0.09690944105386734, + 0.013953075744211674, + -0.4117162227630615, + -0.18567922711372375, + -0.13065709173679352, + -0.01634671539068222, + -0.28179681301116943, + 0.12000752985477448, + -0.39707309007644653, + -0.5099807977676392, + 0.1224963441491127, + -0.19843561947345734, + 0.11665673553943634, + 0.39624321460723877 + ] + ], + [ + [ + 0.2529001235961914, + -0.14984029531478882, + -0.008915399201214314, + 0.08978370577096939, + -0.15320773422718048, + 0.12116200476884842, + -0.034351248294115067, + -0.16427940130233765, + -0.055057644844055176, + -0.4565562307834625, + 0.04754174128174782, + -0.16606676578521729, + 0.03910689055919647, + -0.18196648359298706, + -0.009428711608052254, + -0.012939803302288055, + 0.15753427147865295, + -0.05449286848306656, + -0.18322676420211792, + 0.2933662235736847, + -0.0778035968542099, + -0.03221903741359711, + -0.2731773257255554, + -0.08333298563957214, + 0.07380363345146179, + -0.24547958374023438, + -0.19622820615768433, + 0.1790900081396103, + 0.07490827143192291, + -0.27675506472587585, + 0.029213232919573784, + -0.3904981017112732 + ], + [ + 0.11067550629377365, + -0.2438645213842392, + 0.045713696628808975, + -0.0984351634979248, + 0.252705454826355, + -0.07920299470424652, + 0.10276281088590622, + 0.26163598895072937, + 0.025986509397625923, + -0.28100743889808655, + 2.9890998121118173e-05, + -0.5323917865753174, + 0.22031673789024353, + 0.4131523072719574, + -0.030097946524620056, + -0.38608628511428833, + 0.26566368341445923, + -0.26641446352005005, + -0.5306909680366516, + -0.17850156128406525, + -0.20269092917442322, + -0.20321068167686462, + 0.42494630813598633, + 0.2906365990638733, + 0.4235316514968872, + -0.15886081755161285, + -0.1544882208108902, + -0.03324969485402107, + 0.28846052289009094, + -0.12308380752801895, + -0.298678457736969, + -0.5427786111831665 + ], + [ + -0.009767926298081875, + -0.25209569931030273, + 0.10935380309820175, + 0.0913584902882576, + 0.2855498194694519, + -0.06336914747953415, + -0.23433850705623627, + -0.2283344268798828, + 0.11025145649909973, + -0.42417219281196594, + 0.032476674765348434, + -0.3259270489215851, + -0.2468731552362442, + 0.16523081064224243, + -0.11125031113624573, + 0.18558688461780548, + 0.04354429244995117, + 0.2312915325164795, + -0.18301154673099518, + 0.36041122674942017, + 0.03505290672183037, + 0.12106224149465561, + 0.37312427163124084, + -0.07418409734964371, + 0.4702182710170746, + -0.2145678699016571, + -0.15412558615207672, + 0.6153035759925842, + -0.17973555624485016, + 0.0758664458990097, + 0.007673894986510277, + -0.13020466268062592 + ], + [ + -0.04987119138240814, + -0.24582518637180328, + 0.06452871859073639, + -0.04812224581837654, + 0.2834939956665039, + -0.021005704998970032, + -0.4918654263019562, + -0.1157083511352539, + -0.15325310826301575, + -0.1419564187526703, + 0.023868273943662643, + -0.05057079344987869, + -0.11700387299060822, + -0.13101370632648468, + -0.1450263261795044, + 0.24425972998142242, + -0.10506214201450348, + 0.057433515787124634, + -0.08352479338645935, + 0.2481752187013626, + -0.03205658122897148, + -0.10172934830188751, + 0.19399431347846985, + -0.04259907081723213, + 0.34257325530052185, + 0.0308684054762125, + -0.14111678302288055, + 0.20319871604442596, + 0.3516712188720703, + 0.08381558954715729, + 0.0676141083240509, + 0.25068551301956177 + ], + [ + 0.14774315059185028, + -0.12268801778554916, + -0.03157839551568031, + 0.079156294465065, + 0.04918449744582176, + 0.01856081187725067, + -0.3023219406604767, + 0.13525529205799103, + -0.045067768543958664, + -0.2711930572986603, + -0.12250111252069473, + -0.30906566977500916, + -0.1782984882593155, + 0.3109871447086334, + -0.15281325578689575, + 0.10075286775827408, + 0.1510602831840515, + 0.10796248912811279, + -0.07704947143793106, + 0.20950642228126526, + -0.13345161080360413, + 0.0035079692024737597, + 0.0418722964823246, + -0.06583095341920853, + 0.23563162982463837, + -0.03677667677402496, + 0.09561250358819962, + 0.1768677681684494, + 0.34054097533226013, + 0.08106201887130737, + 0.01957312598824501, + -0.02057858183979988 + ], + [ + 0.2042473703622818, + -0.04051496833562851, + 0.04751221463084221, + -0.07441355288028717, + 0.2051640748977661, + 0.015245628543198109, + -0.3984416425228119, + 0.18884624540805817, + 0.10234139859676361, + -0.1700032502412796, + -0.01575326733291149, + -0.009153525345027447, + -0.17561475932598114, + -0.06261410564184189, + -0.12658195197582245, + 0.05860790237784386, + 0.15018951892852783, + 0.18980197608470917, + -0.16309307515621185, + 0.15932561457157135, + 0.15987974405288696, + -0.029353713616728783, + 0.09539192169904709, + 0.011339697986841202, + 0.43775320053100586, + -0.15376274287700653, + -0.17022603750228882, + 0.7709530591964722, + 0.42167559266090393, + 0.060714758932590485, + 0.0715838372707367, + 0.02384505420923233 + ], + [ + -0.028310032561421394, + -0.3756102919578552, + 0.07099619507789612, + 0.062382668256759644, + 0.10432564467191696, + -0.1417359858751297, + -0.14749327301979065, + 0.0269527155905962, + 0.14353103935718536, + -0.05825190991163254, + 0.1250399649143219, + -0.18883980810642242, + -0.024539778009057045, + 0.3030798137187958, + 0.09264521300792694, + -0.12326698005199432, + -0.08788897842168808, + 0.17555329203605652, + 0.05062760412693024, + 0.09978032112121582, + -0.09199552237987518, + -0.04596409574151039, + -0.05190824717283249, + 0.024269262328743935, + 0.23029549419879913, + -0.09262162446975708, + -0.30028313398361206, + -0.14022232592105865, + 0.07982252538204193, + 0.13204000890254974, + 0.09254946559667587, + -0.02738766558468342 + ], + [ + 0.08747363835573196, + -0.24290016293525696, + 0.010025122202932835, + -0.038012467324733734, + 0.02805471420288086, + 0.09989643841981888, + -0.490162193775177, + -0.07885989546775818, + 0.16421689093112946, + -0.00710345758125186, + 0.025093208998441696, + -0.1771431267261505, + -0.031029148027300835, + 0.3236205577850342, + -0.23345211148262024, + -0.0035724295303225517, + -0.07251066714525223, + -0.023613883182406425, + 0.10980350524187088, + 0.07653970271348953, + -0.02330264076590538, + 0.03797293081879616, + -0.03822101652622223, + -0.025611894205212593, + 0.24029769003391266, + 0.05430206283926964, + 0.17291682958602905, + 0.4336904287338257, + 0.12955299019813538, + 0.13602297008037567, + -0.2614920139312744, + -0.12213940918445587 + ] + ], + [ + [ + 0.10758640617132187, + -0.1066097542643547, + -0.034547168761491776, + -0.07152900844812393, + -0.04713268578052521, + 0.09796339273452759, + -0.0407547689974308, + -0.11045531928539276, + 0.07695962488651276, + -0.028484491631388664, + -0.031915515661239624, + 0.2368079125881195, + 0.3572951555252075, + 0.41496458649635315, + 0.04922135919332504, + -0.14444568753242493, + -0.04209912568330765, + -0.20732524991035461, + -0.3224070966243744, + 0.3762803375720978, + -0.14413970708847046, + -0.023058254271745682, + 0.24399787187576294, + -0.24306581914424896, + 0.24853576719760895, + -0.11509696394205093, + 0.32137057185173035, + 0.5868581533432007, + 0.027875710278749466, + -0.0797942727804184, + 0.016625836491584778, + -0.09026090055704117 + ], + [ + -0.1264650672674179, + -0.2475736290216446, + -0.00451040081679821, + 0.44890937209129333, + -0.11235392093658447, + 0.021102141588926315, + 0.1518680453300476, + 0.21644151210784912, + -0.05397303029894829, + -0.25146734714508057, + 0.10938208550214767, + -0.36342328786849976, + 0.10774196684360504, + 0.21492783725261688, + -0.2738198935985565, + -0.2538232207298279, + -0.18781515955924988, + 0.18739613890647888, + -1.0177700519561768, + 0.12054305523633957, + -0.17507623136043549, + -0.027806375175714493, + 0.48409804701805115, + -0.03745982423424721, + 0.3969500660896301, + 0.10903672128915787, + 0.5370165705680847, + -0.12549559772014618, + 0.18765009939670563, + -0.14770792424678802, + -0.038979098200798035, + -0.4329484701156616 + ], + [ + 0.16781046986579895, + -0.17428506910800934, + 0.07534120976924896, + 0.04066381976008415, + 0.05172299966216087, + 0.03292765095829964, + -0.18131759762763977, + -0.03645344823598862, + -0.1315544694662094, + -0.06047938019037247, + -0.018408620730042458, + -0.2396673858165741, + 0.08979777246713638, + -0.022176504135131836, + -0.08563694357872009, + 0.1376412808895111, + -0.15659388899803162, + 0.29729029536247253, + -0.5016410946846008, + 0.13460448384284973, + 0.13829882442951202, + 0.11928513646125793, + 0.19491378962993622, + 0.04545734450221062, + 0.39069193601608276, + -0.05772941932082176, + 0.5487991571426392, + -0.3311261236667633, + -0.04821820184588432, + 0.17610545456409454, + 0.08445975929498672, + -0.26857125759124756 + ], + [ + -0.03648415952920914, + 0.03490525856614113, + 0.0025109238922595978, + 0.12471301853656769, + 0.22969068586826324, + -0.06982764601707458, + -0.29017725586891174, + -0.1199064627289772, + 0.08046868443489075, + 0.13838694989681244, + -0.014539075084030628, + -0.5154176354408264, + 0.019284222275018692, + -0.19954857230186462, + -0.11677432060241699, + 0.11342614889144897, + -0.22265073657035828, + 0.3207307457923889, + -0.38328129053115845, + -0.20174150168895721, + 0.11130379885435104, + 0.060675278306007385, + -0.018973251804709435, + -0.03245120495557785, + 0.3697308599948883, + -0.16486100852489471, + 0.36919111013412476, + 0.32777678966522217, + -0.06963923573493958, + 0.10788220912218094, + -0.024942707270383835, + -0.33215296268463135 + ], + [ + -0.23708805441856384, + -0.26384079456329346, + -0.011150405742228031, + 0.22418496012687683, + 0.1213463842868805, + 0.09467966109514236, + -0.2606104910373688, + -0.021988559514284134, + -0.21970561146736145, + 0.2538839876651764, + 0.061800118535757065, + -0.29742032289505005, + -0.16571423411369324, + -0.3661664128303528, + -0.1784290224313736, + 0.15041561424732208, + -0.020328883081674576, + 0.23529131710529327, + -0.27967166900634766, + -0.1919585019350052, + -0.03162036091089249, + 0.0987367108464241, + 0.015046295709908009, + -0.010358558036386967, + 0.455435574054718, + -0.13345517218112946, + 0.36925625801086426, + 0.3025376796722412, + -0.03958076611161232, + 0.25013235211372375, + -0.14700987935066223, + 0.3222046196460724 + ], + [ + 0.09509896486997604, + -0.2331826239824295, + -0.026236040517687798, + 0.4572395384311676, + -0.01944737695157528, + 0.09129352867603302, + -0.12107618898153305, + 0.06983094662427902, + -0.16156870126724243, + 0.250825434923172, + -0.04110603407025337, + -0.15009939670562744, + -0.10173831135034561, + -0.20600636303424835, + 0.13239365816116333, + 0.26721009612083435, + -0.13329114019870758, + -0.09893223643302917, + -0.10369456559419632, + -0.30164462327957153, + -0.17928358912467957, + 0.11710726469755173, + 0.1068180575966835, + -0.0445486381649971, + 0.14524146914482117, + -0.12924690544605255, + 0.4207090735435486, + 0.654988706111908, + 0.15838706493377686, + 0.12912674248218536, + -0.26582857966423035, + -0.049303557723760605 + ], + [ + 0.10997051000595093, + -0.24400639533996582, + -0.027082031592726707, + 0.21518683433532715, + -0.039645154029130936, + 0.08487781882286072, + -0.2142634391784668, + 0.0038130481261759996, + -0.04209204763174057, + 0.014901112765073776, + 0.045483045279979706, + -0.26693451404571533, + 0.025493590161204338, + -0.02487180195748806, + -0.026078613474965096, + 0.02983996458351612, + 0.007210391573607922, + -0.23262786865234375, + 0.02378525771200657, + -0.2254951149225235, + 0.09810619801282883, + -0.04030188173055649, + 0.18720386922359467, + -0.12485617399215698, + 0.2201305627822876, + -0.08005623519420624, + 0.22803528606891632, + 0.6161028146743774, + 0.051451049745082855, + 0.11932464689016342, + 0.0614798441529274, + 0.24684718251228333 + ], + [ + -0.17768467962741852, + -0.07364902645349503, + 0.04242340102791786, + 0.11184095591306686, + 0.077653668820858, + -0.14228802919387817, + -0.4172130823135376, + 0.06325268000364304, + -0.1330447643995285, + -0.04066029191017151, + -0.016797572374343872, + -0.42623427510261536, + -0.2621777355670929, + 0.22190336883068085, + -0.125748410820961, + -0.054081082344055176, + 0.06215369701385498, + 0.2560312747955322, + -0.21188268065452576, + 0.06295470148324966, + 0.014680630527436733, + 0.12847328186035156, + 0.02728288620710373, + -0.06984888762235641, + 0.30441948771476746, + -0.043865446001291275, + -0.19140693545341492, + 0.4496334195137024, + 0.3801708221435547, + 0.1382894665002823, + -0.11455588787794113, + 0.2567425072193146 + ] + ] + ], + [ + [ + [ + 0.13990843296051025, + -0.16603446006774902, + -0.029458340257406235, + 0.32391685247421265, + 0.22284366190433502, + 0.06877076625823975, + -0.28510957956314087, + -0.3687794804573059, + -0.20975518226623535, + 0.646129846572876, + 0.027947327122092247, + 0.4165104329586029, + 0.0986189991235733, + -0.06664925813674927, + 0.3107096254825592, + -0.09194434434175491, + 0.033104415982961655, + 0.041335005313158035, + -0.12599816918373108, + 0.029418498277664185, + -0.10179930925369263, + 0.2829092741012573, + -0.06344598531723022, + -0.16561567783355713, + -0.042938925325870514, + -0.09682425111532211, + 0.18277981877326965, + 0.6001458764076233, + -0.151955246925354, + -0.11969953775405884, + 0.11034200340509415, + 0.16196346282958984 + ], + [ + 0.17296811938285828, + 0.20956562459468842, + -0.37303653359413147, + 0.2120080590248108, + -0.24603399634361267, + 0.05638207495212555, + 0.20939257740974426, + 0.03214745968580246, + -0.33833637833595276, + 0.21143189072608948, + 0.018509328365325928, + 1.1182438135147095, + 0.40298891067504883, + -0.1789366602897644, + 0.4369707405567169, + -0.4769471287727356, + -0.21392187476158142, + 0.9221126437187195, + 0.5811058878898621, + -0.020044321194291115, + -0.3004109263420105, + -0.06372947990894318, + 0.22287791967391968, + -0.6086147427558899, + 0.17830149829387665, + 0.012513111345469952, + -0.1874048262834549, + -0.37595152854919434, + -0.2705613672733307, + 0.3404756188392639, + -0.35254061222076416, + -0.03150482103228569 + ], + [ + 0.24937357008457184, + -0.09110026061534882, + -0.0640563815832138, + 0.6097769141197205, + -0.16737568378448486, + 0.06816169619560242, + 0.22244541347026825, + -0.15189430117607117, + -0.013888640329241753, + 0.39591315388679504, + -0.09298226237297058, + 0.38431525230407715, + 0.5371072888374329, + 0.05686555802822113, + 0.44025352597236633, + 0.14519819617271423, + -0.05227727070450783, + 0.44747665524482727, + 0.3639891743659973, + 0.013464267365634441, + 0.06521619111299515, + 0.16149713099002838, + -0.010249205864965916, + -0.04487397521734238, + 0.050052709877491, + -0.1196225956082344, + -0.18663042783737183, + -0.30549344420433044, + -0.0799974650144577, + 0.24396976828575134, + 0.08012601733207703, + -0.8288331627845764 + ], + [ + -0.14549852907657623, + -0.37692657113075256, + -0.06006961315870285, + 0.3933120667934418, + -0.06623055785894394, + -0.09688296169042587, + 0.18265065550804138, + 0.009808721952140331, + -0.3845120966434479, + 0.27350670099258423, + 0.03534191474318504, + 0.2915570139884949, + 0.4012463390827179, + 0.065943144261837, + 0.12954875826835632, + 0.07467318326234818, + -0.06427927315235138, + 0.36325812339782715, + 0.16167762875556946, + -0.39990073442459106, + 0.0037284104619175196, + 0.21989518404006958, + -0.010846743360161781, + -0.4283963739871979, + 0.04615297541022301, + 0.10433976352214813, + 0.014746463857591152, + 0.29783281683921814, + -0.21050803363323212, + 0.3264945447444916, + 0.156197652220726, + -0.34520119428634644 + ], + [ + -0.035901136696338654, + -0.3811475336551666, + -0.07868453860282898, + 0.24959693849086761, + 0.06604736298322678, + -0.08736318349838257, + -0.05035490170121193, + -0.06485919654369354, + -0.2262091189622879, + 0.47954410314559937, + -0.023618323728442192, + 0.06625701487064362, + 0.2093934416770935, + -0.15241344273090363, + 0.1370580792427063, + -0.21775957942008972, + -0.07668839395046234, + 0.23210756480693817, + 0.11633448302745819, + 0.09890445321798325, + 0.14153894782066345, + -0.039744965732097626, + -0.20406682789325714, + -0.050474755465984344, + 0.051302116364240646, + -0.09583768248558044, + -0.2813621461391449, + 0.3283902406692505, + -0.03748178482055664, + 0.0710688978433609, + 0.2620144486427307, + -0.32586702704429626 + ], + [ + -0.07318082451820374, + 0.12223214656114578, + -0.04270673543214798, + 0.16611842811107635, + -0.12155959755182266, + 0.10095252841711044, + 0.2798100709915161, + -0.2485608458518982, + -0.09805099666118622, + 0.16900663077831268, + -0.08228272944688797, + 0.21120738983154297, + 0.2491137683391571, + -0.07225260138511658, + 0.16523006558418274, + -0.06644268333911896, + -0.18191012740135193, + 0.014562824741005898, + 0.15396101772785187, + -0.017260072752833366, + 0.00797137338668108, + -0.024585548788309097, + 0.016532907262444496, + -0.05696326121687889, + -0.04652181640267372, + -0.03240172192454338, + 0.4572070837020874, + 0.3329165279865265, + -0.05301506072282791, + 0.020762156695127487, + 0.0648508295416832, + -0.21480692923069 + ], + [ + 0.13815730810165405, + -0.43789929151535034, + -0.029938731342554092, + 0.05124734342098236, + 0.2541476786136627, + 0.06871429830789566, + 0.11815036833286285, + -0.2470780611038208, + -0.2929939925670624, + 0.03379863128066063, + 0.06680756062269211, + 0.23642443120479584, + 0.1729763001203537, + 0.022766247391700745, + 0.04434053972363472, + -0.011595615185797215, + 0.12361777573823929, + 0.0829310193657875, + -0.006236638408154249, + 0.012295197695493698, + 0.10879316180944443, + -0.03422463312745094, + 0.26946380734443665, + -0.11234935373067856, + 0.136173814535141, + 0.025468453764915466, + 0.06462110579013824, + 0.48533785343170166, + -0.14830011129379272, + 0.08138947933912277, + 0.18523016571998596, + -0.3956752121448517 + ], + [ + -0.10225557535886765, + -0.4099736213684082, + -0.0013623841805383563, + 0.048389747738838196, + 0.1409413367509842, + -0.1398897022008896, + 0.3489733636379242, + -0.3209477961063385, + -0.36610299348831177, + 0.059160515666007996, + 0.07161826640367508, + 0.2934921681880951, + 0.15205833315849304, + 0.24018631875514984, + 0.08203626424074173, + 0.09095987677574158, + -0.06756536662578583, + 0.35441574454307556, + 0.17752157151699066, + -0.20368614792823792, + 0.23299671709537506, + -0.027608266100287437, + 0.08642521500587463, + 0.10365531593561172, + 0.15836885571479797, + -0.13708649575710297, + -0.17649854719638824, + 0.40891364216804504, + 0.0993676483631134, + 0.09736160933971405, + 0.11317165195941925, + -0.22252312302589417 + ] + ], + [ + [ + 0.0033278660848736763, + 0.12011580914258957, + -0.08763009309768677, + -0.04978034272789955, + 0.055204976350069046, + -0.0025958744809031487, + -0.6965973973274231, + -0.3578717112541199, + 0.21549168229103088, + 0.4206133484840393, + -0.11019521951675415, + -0.00447456631809473, + 0.109644815325737, + 0.08189058303833008, + -0.04715937376022339, + -0.1758602410554886, + -0.11929281800985336, + -0.16828440129756927, + -0.20021358132362366, + -0.02227962017059326, + -0.19681395590305328, + -0.0676986426115036, + 0.1475769281387329, + -0.09603490680456161, + 0.03156639635562897, + 0.04375902935862541, + -0.292345255613327, + 0.1059068962931633, + -0.09080349653959274, + -0.21963192522525787, + -0.10553409159183502, + 0.018912464380264282 + ], + [ + 0.15270620584487915, + -0.24866490066051483, + -0.23374010622501373, + -0.014474626630544662, + -0.4158261716365814, + 0.1671232283115387, + -0.1061972826719284, + -0.18110071122646332, + 0.10310093313455582, + -0.3233785629272461, + 0.14617472887039185, + 0.05871963873505592, + 0.22174160182476044, + -0.11431774497032166, + 0.46707433462142944, + -0.27161601185798645, + -0.3265071213245392, + -0.4093521237373352, + 0.2093256562948227, + 0.3229571282863617, + -0.5388345122337341, + -0.1138942614197731, + -0.35616374015808105, + -0.20960545539855957, + -0.6728543043136597, + -0.05953926220536232, + -0.2878872752189636, + -0.21418067812919617, + -0.04485223442316055, + -0.9078348875045776, + -0.11830741167068481, + 0.4932243525981903 + ], + [ + -0.137464702129364, + -0.2612091898918152, + 0.06842838227748871, + -0.1420900672674179, + -0.26640555262565613, + 0.15458573400974274, + 0.06071013957262039, + 0.1557978391647339, + 0.34173640608787537, + 0.16412372887134552, + -0.005678538233041763, + -0.006598673295229673, + -0.1873921900987625, + 0.07848600298166275, + -0.012283426709473133, + -0.01596023701131344, + -0.05613531172275543, + -0.038903236389160156, + 0.1339721977710724, + 0.007664666511118412, + -0.1759381890296936, + 0.026997053995728493, + 0.05460529774427414, + 0.2687670886516571, + -0.5961458683013916, + -0.05479663982987404, + -0.15761929750442505, + -0.4037388265132904, + 0.09502650797367096, + -0.4616786241531372, + -0.18678323924541473, + 0.13679060339927673 + ], + [ + 0.04472925886511803, + 0.09540660679340363, + 0.05016350373625755, + -0.023638617247343063, + -0.401552677154541, + 0.06822983175516129, + 0.417092502117157, + -0.052857838571071625, + 0.3100595474243164, + 0.059128716588020325, + -0.003902732627466321, + -0.27066993713378906, + -0.017671028152108192, + -0.0892743468284607, + 0.09070975333452225, + -0.09079980105161667, + -0.35727792978286743, + -0.12701484560966492, + 0.4688652753829956, + -0.0193377323448658, + -0.26240530610084534, + 0.02857981063425541, + -0.03892165422439575, + -0.12440421432256699, + -0.4059055745601654, + 0.32413774728775024, + 0.2525023818016052, + -0.7266688346862793, + -0.13476097583770752, + -0.3808610737323761, + -0.2426530420780182, + 0.05643507093191147 + ], + [ + 0.008031873032450676, + -0.11921753734350204, + -0.04352014139294624, + -0.05185336247086525, + -0.40550073981285095, + 0.06949248164892197, + 0.36024874448776245, + -0.19374306499958038, + 0.1770574003458023, + 0.03997659310698509, + -0.017595531418919563, + -0.0411904938519001, + -0.07047993689775467, + 0.135053813457489, + -0.05948558449745178, + 0.05218632519245148, + -0.002515143482014537, + -0.1996205896139145, + 0.27307388186454773, + 0.03774888813495636, + -0.24301950633525848, + 0.0849563479423523, + 0.037715230137109756, + -0.16559472680091858, + -0.29601651430130005, + 0.018903443589806557, + 0.40785759687423706, + -0.24194161593914032, + -0.1372877061367035, + -0.05105876550078392, + -0.2484508901834488, + -0.07243049144744873 + ], + [ + 0.2041180282831192, + -0.14588724076747894, + -0.04140792787075043, + -0.05339909344911575, + 0.05060906335711479, + -0.005172134377062321, + 0.29112374782562256, + -0.06283735483884811, + 0.32517412304878235, + 0.0041630868799984455, + -0.05061502754688263, + -0.3321976661682129, + -0.21447913348674774, + -0.25624880194664, + 0.14208070933818817, + 0.10019708424806595, + -0.14735224843025208, + -0.026885759085416794, + 0.015199767425656319, + -0.20411445200443268, + -0.20251500606536865, + 0.0599774494767189, + -0.009313817135989666, + -0.22325751185417175, + -0.37945520877838135, + -0.09926851093769073, + -0.02788401022553444, + -0.4247887134552002, + -0.06653627753257751, + -0.2692055404186249, + -0.0663735643029213, + 0.20785830914974213 + ], + [ + -0.14251334965229034, + -0.01656835898756981, + 0.0020490027964115143, + -0.1065363734960556, + -0.1958310753107071, + -0.08119802922010422, + 0.3566097915172577, + 0.3162807822227478, + -0.09526165574789047, + 0.30695679783821106, + -0.03639897704124451, + -0.202446848154068, + -0.23924344778060913, + -0.19491919875144958, + -0.06868144869804382, + 0.09063016623258591, + -0.2441837042570114, + 0.07978865504264832, + 0.22479148209095, + -0.30851754546165466, + -0.11121612787246704, + 0.07842817157506943, + -0.23927995562553406, + -0.13152599334716797, + -0.26993972063064575, + -0.04005880653858185, + 0.03890283778309822, + 0.2340167611837387, + 0.06811206042766571, + -0.01386750303208828, + 0.09722571074962616, + 0.09690161794424057 + ], + [ + 0.11182501167058945, + -0.09293200820684433, + 0.005038785748183727, + 0.11418667435646057, + -0.24766959249973297, + 0.023312203586101532, + 0.28493231534957886, + -0.22338835895061493, + 0.13068421185016632, + 0.17511816322803497, + -0.06958970427513123, + 0.13333088159561157, + -0.08367723226547241, + -0.5370684266090393, + 0.14897212386131287, + -0.302157998085022, + -0.046852122992277145, + -0.11983384191989899, + 0.024704966694116592, + -0.07728137820959091, + -0.1031244769692421, + 0.017119083553552628, + 0.027816250920295715, + -0.0933525338768959, + -0.21504423022270203, + -0.06013945862650871, + 0.17268003523349762, + -0.6791911125183105, + 0.06003040820360184, + -0.07468819618225098, + 0.007816024124622345, + -0.21824093163013458 + ] + ], + [ + [ + 0.029195239767432213, + -0.2350163459777832, + -0.018235577270388603, + 0.056731659919023514, + 0.16609254479408264, + 0.10048788040876389, + -0.48700588941574097, + -0.3716243803501129, + 0.06817092001438141, + 0.25718629360198975, + -0.12235025316476822, + -0.05302664265036583, + -0.0033899375703185797, + 0.5994347333908081, + 0.005696080159395933, + 0.0030949977226555347, + 0.008905326016247272, + -0.11482711136341095, + -0.20246174931526184, + 0.04506148397922516, + 0.1470552235841751, + 0.1664588302373886, + 0.16492748260498047, + -0.07337204366922379, + 0.08716592937707901, + 0.07030224800109863, + -0.28305697441101074, + 0.05781641975045204, + 0.09362398833036423, + -0.4013492166996002, + -0.18658214807510376, + 0.22542467713356018 + ], + [ + 0.2428566962480545, + 0.0319037102162838, + -0.3337654173374176, + -0.2297404557466507, + -0.1421785205602646, + 0.10945544391870499, + -0.27871865034103394, + 0.1925830841064453, + -0.2207852005958557, + -0.10612450540065765, + -0.04259522259235382, + 1.8018375635147095, + 0.05108318477869034, + -0.350822389125824, + 0.3749508559703827, + -0.10733351111412048, + 0.27525779604911804, + 0.3589179813861847, + 0.9271144270896912, + 0.2270146906375885, + -0.34699055552482605, + -0.25929003953933716, + 0.2549799978733063, + -0.09452192485332489, + -0.34046974778175354, + -0.11386911571025848, + -0.8318452835083008, + -0.6819998621940613, + -0.2919938862323761, + -0.16486798226833344, + 0.10653267055749893, + -0.12350604683160782 + ], + [ + 0.043648798018693924, + 0.022231101989746094, + -0.0711451843380928, + -0.007128810044378042, + 0.11357326060533524, + 0.04205019399523735, + 0.5453894734382629, + 0.06643234938383102, + 0.06765421479940414, + -0.34158822894096375, + -0.04061922803521156, + 0.5791428685188293, + -0.13038364052772522, + -0.27869412302970886, + 0.4503949284553528, + 0.24633032083511353, + 0.03765139356255531, + 0.21190859377384186, + 0.30909544229507446, + -0.28711605072021484, + -0.23038800060749054, + -0.18473175168037415, + 0.3423629105091095, + 0.23607417941093445, + -0.2824151813983917, + -0.024334443733096123, + -0.2800808846950531, + -0.5341071486473083, + -0.47655776143074036, + -0.2101980745792389, + 0.06628517806529999, + -0.4764931797981262 + ], + [ + 0.02604709565639496, + -0.30473071336746216, + -0.09787827730178833, + -0.07956475764513016, + -0.006243294570595026, + 0.11447826772928238, + 0.45616868138313293, + -0.2255997657775879, + 0.15004774928092957, + -0.0047508953139185905, + -0.06014961004257202, + 0.5432338118553162, + 0.04190630838274956, + 0.064865842461586, + 0.04251528158783913, + 0.29173293709754944, + -0.1923958659172058, + -0.06520266085863113, + 0.03831111267209053, + -0.16712382435798645, + -0.24250619113445282, + -0.1099153533577919, + 0.4151211082935333, + -0.0851958841085434, + -0.19616954028606415, + 0.35036951303482056, + -0.46754857897758484, + -0.03774556145071983, + -0.21750880777835846, + -0.11924846470355988, + -0.021844759583473206, + -0.47471100091934204 + ], + [ + 0.18829993903636932, + -0.11388149857521057, + -0.07561702281236649, + -0.028629586100578308, + 0.17641688883304596, + 0.10877251625061035, + 0.35213416814804077, + -0.24397055804729462, + -0.17458274960517883, + -0.09929115325212479, + 0.09310638159513474, + 0.15124918520450592, + -0.2572510540485382, + -0.4227010905742645, + 0.18778328597545624, + 0.24645322561264038, + -0.014549064449965954, + -0.11107147485017776, + -0.03231094032526016, + -0.1569262593984604, + -0.20803788304328918, + -0.09287557005882263, + 0.14168858528137207, + 0.13861900568008423, + -0.23397031426429749, + 0.2242468297481537, + -0.3292693495750427, + 0.3114551305770874, + 0.029756981879472733, + -0.20619943737983704, + 0.21204395592212677, + -0.29911234974861145 + ], + [ + -0.07944826036691666, + -0.02725861966609955, + -0.0016047647222876549, + -0.04306129366159439, + 0.22247682511806488, + -0.0019070853013545275, + 0.13470123708248138, + -0.3165449798107147, + 0.06522860378026962, + -0.05488650128245354, + 0.07629188895225525, + 0.37064093351364136, + -0.1257496029138565, + -0.06051534041762352, + 0.17231571674346924, + 0.08322744816541672, + -0.006864510010927916, + -0.015757227316498756, + -0.03647872805595398, + -0.04207223281264305, + 0.009635319001972675, + -0.004377535544335842, + 0.3547567129135132, + 0.26432543992996216, + 0.07236974686384201, + 0.023555437102913857, + -0.4608323574066162, + 0.17533916234970093, + -0.1675371676683426, + -0.0585583820939064, + 0.049765992909669876, + -0.322380930185318 + ], + [ + -0.08195760101079941, + -0.1529020220041275, + 0.015624133870005608, + 0.09483330696821213, + -0.14515084028244019, + -0.06693942844867706, + 0.07391861826181412, + -0.2057441771030426, + 0.26196572184562683, + 0.08181632310152054, + 0.0587734691798687, + 0.343505322933197, + -0.23920972645282745, + -0.10627646744251251, + 0.1814487725496292, + 0.40692058205604553, + 0.010944191366434097, + -0.10249241441488266, + 0.008974921889603138, + -0.23678922653198242, + -0.22710329294204712, + -0.09467151761054993, + 0.40969526767730713, + 0.27401211857795715, + -0.17258836328983307, + 0.17567376792430878, + 0.08255106955766678, + -0.5547881722450256, + -0.16680291295051575, + -0.22977215051651, + -0.1312180459499359, + -0.12610694766044617 + ], + [ + 0.18753349781036377, + -0.08869149535894394, + -0.09552310407161713, + 0.11321202665567398, + -0.0378742590546608, + -0.01431140024214983, + 0.37436965107917786, + 0.15319469571113586, + -0.11310172080993652, + 0.13953888416290283, + 0.015315519645810127, + -0.11373379826545715, + -0.21864140033721924, + -0.20804233849048615, + 0.23802751302719116, + 0.18060944974422455, + -0.17200806736946106, + -0.28349992632865906, + 0.10051938146352768, + -0.21133635938167572, + -0.12256352603435516, + 0.0652894452214241, + 0.08509358763694763, + -0.04862962290644646, + 0.0066766622476279736, + 0.05673383176326752, + 0.0799979567527771, + 0.09327559918165207, + 0.16082467138767242, + -0.19250190258026123, + -0.178436741232872, + -0.24168114364147186 + ] + ], + [ + [ + 0.30670368671417236, + -0.3759997487068176, + 0.03066113591194153, + 0.21624110639095306, + 0.1176081970334053, + -0.06785210967063904, + -0.5802224278450012, + -0.06458081305027008, + 0.13061335682868958, + 0.3433685302734375, + -0.06039655581116676, + 0.24697722494602203, + -0.1390620321035385, + 0.3167809545993805, + -0.039082013070583344, + -0.027363166213035583, + 0.07923128455877304, + -0.15907208621501923, + -0.3329041600227356, + 0.08547677099704742, + 0.031120413914322853, + 0.1861925721168518, + 0.279743492603302, + -0.11389197409152985, + 0.24751339852809906, + -0.08336135745048523, + 0.2990586757659912, + 0.20894968509674072, + 0.24882930517196655, + 0.0054617151618003845, + -0.07662498205900192, + -0.12709417939186096 + ], + [ + -0.2303892821073532, + 0.09070535749197006, + -0.0009211364085786045, + -0.7183072566986084, + 0.39319151639938354, + 0.09837675094604492, + -0.12541866302490234, + -0.4064134955406189, + -0.5905455946922302, + 0.35719114542007446, + -0.07510707527399063, + 1.3098602294921875, + 0.08412284404039383, + -0.12170594930648804, + -0.36424216628074646, + -0.39490750432014465, + 0.47344809770584106, + 0.5538473725318909, + 0.4408288300037384, + -0.154671773314476, + 0.0408182255923748, + -9.017964475788176e-05, + 0.8742865324020386, + 0.33373743295669556, + 0.29476651549339294, + -0.006123809609562159, + -0.11888642609119415, + -0.8428882360458374, + 0.1020166277885437, + 0.6465941667556763, + -0.3332286477088928, + -0.7446061968803406 + ], + [ + -0.024740809574723244, + -0.22530828416347504, + 0.06554795056581497, + -0.2811891436576843, + 0.38314178586006165, + 0.0764741450548172, + -0.10634259134531021, + -0.024726979434490204, + -0.3329421877861023, + 0.00021766024292446673, + 0.09068460762500763, + 0.22900766134262085, + 0.14992138743400574, + 0.11447077989578247, + -0.29132288694381714, + -0.027856895700097084, + 0.158420592546463, + 0.25266748666763306, + -0.16421040892601013, + 0.10907779633998871, + 0.20073698461055756, + 0.08518533408641815, + 0.2429226189851761, + 0.01838613487780094, + 0.29791173338890076, + -0.007441937457770109, + -0.294171005487442, + 0.12365972250699997, + 0.06498461216688156, + 0.33211034536361694, + 0.07467753440141678, + -0.4994457960128784 + ], + [ + 0.2030831277370453, + 0.013583279214799404, + 0.13773906230926514, + -0.1280762255191803, + 0.1626998335123062, + -0.06875865906476974, + -0.22269922494888306, + -0.030548250302672386, + -0.2047915905714035, + -0.2459034025669098, + 0.06482002139091492, + 0.22372211515903473, + 0.3928837180137634, + 0.00587328989058733, + -0.02941030263900757, + 0.07918617874383926, + 0.06396358460187912, + 0.12272000312805176, + -0.16816121339797974, + 0.20903301239013672, + 0.032122284173965454, + -0.04932351037859917, + 0.32887592911720276, + 0.26827555894851685, + 0.23950962722301483, + -0.0721241757273674, + -0.13646364212036133, + 0.7328242659568787, + -0.224042147397995, + 0.0938066765666008, + -0.048937469720840454, + -0.2612192928791046 + ], + [ + 0.21349740028381348, + -0.21110408008098602, + 0.12177273631095886, + -0.014619707129895687, + 0.14462797343730927, + -0.014606024138629436, + -0.18122701346874237, + -0.14179429411888123, + -0.24041317403316498, + 0.07854601740837097, + 0.015353660099208355, + 0.248647540807724, + 0.3431304395198822, + -0.2519536316394806, + -0.06003564968705177, + 0.31365591287612915, + 0.07055758684873581, + 0.10696885734796524, + -0.07574553042650223, + 0.20162789523601532, + 0.22474181652069092, + 0.23035159707069397, + 0.22683440148830414, + 0.04635833576321602, + 0.20975244045257568, + -0.20755332708358765, + -0.1518123894929886, + 0.7146691083908081, + -0.11218785494565964, + 0.11674706637859344, + -0.01864267699420452, + -0.6935837268829346 + ], + [ + -0.05972188711166382, + -0.21767748892307281, + 0.08580240607261658, + -0.17776374518871307, + 0.14253807067871094, + -0.007191624492406845, + -0.19553707540035248, + -0.33324775099754333, + -0.28077441453933716, + 0.04179739952087402, + 0.07633712887763977, + 0.08482418954372406, + 0.17240746319293976, + 0.2889474332332611, + -0.11892922222614288, + -0.08732090145349503, + 0.22182680666446686, + -0.008336669765412807, + -0.06676257401704788, + 0.07410957664251328, + -0.06008773297071457, + 0.18604719638824463, + 0.3655361533164978, + -0.003071705810725689, + 0.06322585791349411, + 0.013291491195559502, + -0.1926327496767044, + -0.165904700756073, + 0.16323496401309967, + -0.038504596799612045, + 0.018434442579746246, + -0.36313727498054504 + ], + [ + -0.0046124933287501335, + -0.20889729261398315, + -0.05160985887050629, + 0.05644628778100014, + 0.0037938060704618692, + 0.015730226412415504, + -0.023478295654058456, + -0.19226957857608795, + -0.1708337664604187, + -0.10694121569395065, + -0.03979530930519104, + -0.008107002824544907, + -0.16820357739925385, + -0.20472173392772675, + -0.03549210727214813, + -0.0027272170409560204, + 0.16327813267707825, + -0.005503588356077671, + -0.07021263241767883, + 0.38444891571998596, + 0.10602610558271408, + 0.025376077741384506, + 0.34485524892807007, + 0.07765895128250122, + 0.1890965700149536, + 0.10256603360176086, + -0.3924614489078522, + 0.6062885522842407, + -0.03942011296749115, + -0.003933690022677183, + 0.12744559347629547, + -0.5080903768539429 + ], + [ + 0.1353752762079239, + -0.0793192908167839, + -0.010276056826114655, + -0.09024874866008759, + 0.11006076633930206, + -0.04630637541413307, + -0.32409805059432983, + -0.20187988877296448, + -0.10830337554216385, + -0.07514338195323944, + -0.03966401889920235, + 0.3796505033969879, + 0.11841608583927155, + -0.27100738883018494, + 0.16662032902240753, + 0.2728138267993927, + 0.024808362126350403, + 0.13438469171524048, + -0.18725454807281494, + -0.06834891438484192, + 0.05653739348053932, + 0.18347185850143433, + 0.24668866395950317, + 0.2643004357814789, + 0.15603311359882355, + -0.06715074181556702, + 0.051660459488630295, + 0.1887359917163849, + -0.26494941115379333, + 0.06054963544011116, + 0.018575279042124748, + -0.278828501701355 + ] + ], + [ + [ + 0.14387039840221405, + -0.1992550790309906, + -0.06001484766602516, + 0.280141681432724, + -0.07323245704174042, + -0.06415276229381561, + -0.3279683291912079, + -0.17802831530570984, + 0.15102094411849976, + 0.3202308118343353, + 0.03107699565589428, + -0.2556663453578949, + 0.0214626956731081, + -0.040254224091768265, + 0.1834298074245453, + -0.0819639265537262, + 0.1304350197315216, + -0.10625983774662018, + -0.31660300493240356, + -0.1391557902097702, + 0.3061111867427826, + 0.021518878638744354, + -0.19998110830783844, + 0.24930927157402039, + 0.14388881623744965, + 0.2056519240140915, + -0.06244711950421333, + 0.19454535841941833, + -0.21433933079242706, + -0.1532827615737915, + -0.07764808088541031, + -0.42415186762809753 + ], + [ + -0.3851286768913269, + 0.20741355419158936, + -0.022246714681386948, + -0.250749796628952, + 0.412179172039032, + 0.32986214756965637, + -0.9810655117034912, + -0.1996615082025528, + -0.1541159451007843, + 0.3569817543029785, + -0.016356294974684715, + -0.4542996883392334, + 0.22198431193828583, + 0.4976895749568939, + -0.26415881514549255, + -0.041999369859695435, + -0.00627802824601531, + 0.4301114082336426, + -0.6683260202407837, + -0.010216601192951202, + -0.1646524965763092, + -0.0015242183580994606, + -0.002550938632339239, + -0.05587681755423546, + 0.13554736971855164, + 0.06766516715288162, + 0.3166961669921875, + -0.5503972172737122, + -0.1503661572933197, + 0.42210304737091064, + -0.5721291899681091, + -0.6603180766105652 + ], + [ + 0.04013437405228615, + -0.14869125187397003, + 0.10552678257226944, + -0.10188091546297073, + 0.04381682351231575, + 0.0926082581281662, + -0.6579253673553467, + 0.17065352201461792, + 0.0770612582564354, + -0.05656593292951584, + 0.07616668939590454, + -0.4010752737522125, + 0.11357571929693222, + -0.2331959754228592, + -0.10165634006261826, + 0.17840681970119476, + 0.02369847148656845, + -0.07425134629011154, + -0.3895520567893982, + -0.01924068294465542, + -0.031110119074583054, + 0.27002304792404175, + -0.2777494192123413, + -0.14802174270153046, + 0.1677461564540863, + 0.1367250382900238, + 0.2690589129924774, + 0.0401017852127552, + -0.290983647108078, + 0.18607592582702637, + -0.10307320952415466, + -0.7499489784240723 + ], + [ + 0.0694640576839447, + -0.063662588596344, + 0.03554651886224747, + -0.18755891919136047, + 0.08760815113782883, + 0.114765964448452, + -0.5214653015136719, + 0.0571192167699337, + -0.08095400035381317, + -0.08343566954135895, + 0.08042934536933899, + -0.0629797875881195, + 0.07968239486217499, + 0.3177703619003296, + -0.3109084367752075, + 0.25372156500816345, + 0.14856016635894775, + 0.04633447155356407, + -0.1531716138124466, + -0.000564651854801923, + -0.07462530583143234, + 0.20148707926273346, + 0.1305159628391266, + -0.029584191739559174, + 0.05658057704567909, + -0.15337957441806793, + 0.04806900769472122, + -0.07239856570959091, + 0.14967885613441467, + 0.11016056686639786, + -0.3398953974246979, + -0.11027693748474121 + ], + [ + -0.09870871156454086, + 0.16358113288879395, + 0.025784162804484367, + -0.06789737194776535, + -0.08851974457502365, + 0.09129858016967773, + -0.34513410925865173, + -0.2925410270690918, + -0.08386219292879105, + 0.11382218450307846, + -0.014649411663413048, + 0.15440315008163452, + -0.013798448257148266, + 0.2961573004722595, + 0.008001461625099182, + -0.009658209048211575, + 0.20956413447856903, + 0.10182516276836395, + -0.06760881096124649, + 0.2496936023235321, + 0.005820685997605324, + 0.2580016851425171, + 0.15256746113300323, + -0.024314628913998604, + -0.13873283565044403, + 0.015904655680060387, + 0.2028484046459198, + -0.1949644535779953, + 0.05081550404429436, + -0.027211511507630348, + -0.3091191053390503, + -0.4362914264202118 + ], + [ + -0.05161524936556816, + 0.2580585181713104, + 0.047352977097034454, + -0.036912932991981506, + 0.07293321937322617, + 0.05874193087220192, + -0.5852078795433044, + 0.11741170287132263, + -0.1375768482685089, + 0.14358673989772797, + -0.07549656927585602, + -0.028381390497088432, + 0.18881277740001678, + 0.11338365823030472, + -0.20731684565544128, + 0.1053382158279419, + -0.128074049949646, + 0.20297706127166748, + 0.07746200263500214, + 0.19949813187122345, + -0.0634765550494194, + 0.12969401478767395, + 0.10334251075983047, + -0.030837856233119965, + -0.1278436779975891, + 0.013669418171048164, + 0.37914931774139404, + -0.5544689297676086, + -0.28662994503974915, + 0.018947064876556396, + -0.20250144600868225, + -0.16398443281650543 + ], + [ + 0.028214948251843452, + -0.024129671975970268, + -0.05388138070702553, + 0.11127995699644089, + 0.09398937970399857, + 0.09533551335334778, + -0.010188226588070393, + -0.06947676837444305, + -0.12465008348226547, + 0.2825733423233032, + -0.07442492246627808, + 0.17493127286434174, + 0.01807701773941517, + -0.039777446538209915, + 0.19072318077087402, + 0.3086857199668884, + 0.017522668465971947, + -0.043597444891929626, + 0.005979732144623995, + 0.07541722059249878, + -0.17625316977500916, + 0.09037709981203079, + -0.09531217813491821, + 0.047704581171274185, + -0.13278689980506897, + -0.16990098357200623, + 0.24349573254585266, + -0.14383047819137573, + 0.15557105839252472, + 0.15803973376750946, + 0.007203086744993925, + -0.010332885198295116 + ], + [ + 0.10673892498016357, + -0.24601075053215027, + 0.05619770288467407, + -0.1285020262002945, + 0.017790423706173897, + 0.03461308404803276, + -0.18521685898303986, + 0.2129679173231125, + -0.21285280585289001, + 0.29897668957710266, + -0.0740969255566597, + -0.10113254934549332, + -0.14737297594547272, + 0.10684303194284439, + -0.37205904722213745, + 0.005199951585382223, + 0.032168518751859665, + 0.28121429681777954, + -0.03828441724181175, + 0.3391612768173218, + -0.06317013502120972, + 0.07530516386032104, + 0.12446839362382889, + 0.14087866246700287, + -0.17895877361297607, + 0.1367444097995758, + -0.10331624001264572, + 0.05859815329313278, + -0.03336004167795181, + -0.06944300979375839, + -0.16787545382976532, + -0.5554865598678589 + ] + ] + ], + [ + [ + [ + 0.12989675998687744, + -0.04517862945795059, + 0.032918717712163925, + -0.12533476948738098, + -0.23309019207954407, + 0.0050028301775455475, + -0.2160588949918747, + -0.11831840127706528, + 0.11981314420700073, + -0.05711368843913078, + 0.12597134709358215, + -0.15134382247924805, + -0.24477985501289368, + -0.2289140373468399, + 0.17078955471515656, + -0.23457756638526917, + -0.33866995573043823, + -0.16250382363796234, + -0.40120962262153625, + -0.10265209525823593, + 0.04174662008881569, + 0.1654457002878189, + 0.2614818513393402, + -0.045516237616539, + 0.026618409901857376, + -0.0697396919131279, + -0.335953950881958, + -0.021586284041404724, + -0.08244685083627701, + -0.22594280540943146, + 0.03977235034108162, + -0.313544362783432 + ], + [ + 0.34076815843582153, + 0.23794199526309967, + -0.4579889476299286, + 0.19226518273353577, + -0.19747042655944824, + 0.24392040073871613, + -0.023128343746066093, + -0.1996755301952362, + -0.359723836183548, + 0.3094015121459961, + 0.2620558738708496, + 0.47444239258766174, + -0.11174119263887405, + -0.16635413467884064, + 0.5356983542442322, + 0.9394509792327881, + 0.08559046685695648, + 1.742148756980896, + 0.42305099964141846, + 0.4233430325984955, + 0.7317370772361755, + -0.17882923781871796, + 0.14277830719947815, + -0.4213402569293976, + 0.6366060376167297, + -0.23001334071159363, + -0.6178585886955261, + -0.9624831676483154, + -0.24280805885791779, + 1.0356206893920898, + 0.0261879563331604, + 0.05186522379517555 + ], + [ + 0.16007357835769653, + 0.0477144755423069, + 0.012606780976057053, + 0.3304745554924011, + 0.12810423970222473, + 0.046889662742614746, + 0.1309240758419037, + -0.5366519093513489, + -0.5572762489318848, + -0.12124534696340561, + 0.08674681186676025, + 0.06955204159021378, + 0.13772863149642944, + -0.12800627946853638, + 0.6063936948776245, + 0.040582261979579926, + -0.00018557810108177364, + 0.7177356481552124, + 0.098317950963974, + 0.20989084243774414, + 0.31224584579467773, + -0.1262890249490738, + 0.030209973454475403, + -0.035941656678915024, + 0.3742581605911255, + -0.17629371583461761, + -0.02004115842282772, + 0.5674691796302795, + -0.5405909419059753, + 0.30077409744262695, + 0.0971255674958229, + -0.34323400259017944 + ], + [ + 0.13946495950222015, + -0.16889819502830505, + 0.019446702674031258, + 0.39314255118370056, + -0.0034225957933813334, + 0.02616766095161438, + -0.16827596724033356, + -0.23767933249473572, + -0.2734069228172302, + 0.130742609500885, + 0.012412608601152897, + -0.08561839163303375, + 0.11375688761472702, + -0.17713887989521027, + 0.4148258864879608, + -0.19495131075382233, + 0.13714836537837982, + 0.6101315021514893, + -0.029718680307269096, + -0.16342073678970337, + 0.11605348438024521, + 0.17542240023612976, + 0.036962397396564484, + -0.10685107111930847, + 0.23439712822437286, + 0.09238147735595703, + -0.09808668494224548, + 0.933026134967804, + -0.2998422682285309, + 0.19791190326213837, + 0.1547544300556183, + -0.42142605781555176 + ], + [ + 0.06618838012218475, + -0.3468064069747925, + 0.07886799424886703, + 0.4932181239128113, + 0.13775834441184998, + 0.07827680557966232, + -0.32147735357284546, + 0.03463534265756607, + -0.048414114862680435, + 0.2642655372619629, + -0.07589151710271835, + -0.14893336594104767, + 0.11039790511131287, + 0.19669204950332642, + 0.30290529131889343, + 0.03694553300738335, + 0.026386365294456482, + 0.29852452874183655, + -0.031059294939041138, + -0.18104609847068787, + -0.0036518133711069822, + 0.1869298815727234, + 0.09182864427566528, + -0.06982512027025223, + 0.12243205308914185, + -0.1771441102027893, + 0.18344414234161377, + 0.3749955892562866, + -0.33909478783607483, + 0.1629810929298401, + 0.037679072469472885, + -0.009947082959115505 + ], + [ + 0.1778029352426529, + 0.07942375540733337, + -0.02891511283814907, + 0.3061537742614746, + -0.09208057820796967, + -0.07011471688747406, + -0.3805810809135437, + 0.1172289103269577, + -0.3319684565067291, + 0.4723719358444214, + 0.06886371970176697, + -0.5161396861076355, + 0.03476012870669365, + 0.2455643117427826, + 0.12927784025669098, + 0.04832262173295021, + 0.11835389584302902, + 0.1923554390668869, + 0.013986937701702118, + 0.0824362114071846, + 0.032929204404354095, + 0.1202406957745552, + 0.056696753948926926, + -0.015976250171661377, + 0.08817856758832932, + 0.038665130734443665, + -0.09813803434371948, + 0.2966574430465698, + -0.25990915298461914, + 0.17062592506408691, + -0.007897933013737202, + -0.23148445785045624 + ], + [ + -0.1290990710258484, + -0.05003567785024643, + -0.011143541894853115, + 0.12877027690410614, + -0.16331444680690765, + 0.06275290250778198, + -0.3329024016857147, + -0.16733138263225555, + -0.22893279790878296, + 0.12539558112621307, + 0.02930622734129429, + -0.17044934630393982, + 0.21481506526470184, + 0.09554442763328552, + 0.0025458657182753086, + -0.0891694650053978, + -0.0015701699303463101, + 0.12184114754199982, + -0.061820290982723236, + 0.10949677228927612, + -0.017741989344358444, + 0.09931975603103638, + -0.15137028694152832, + 0.13002517819404602, + -0.10157657414674759, + 0.01925632357597351, + 0.21032188832759857, + 0.0953536406159401, + -0.23182743787765503, + 0.00842980481684208, + -0.009512083604931831, + -0.19765877723693848 + ], + [ + -0.014370698481798172, + -0.23717963695526123, + 0.028081456199288368, + 0.24650806188583374, + 0.019929280504584312, + -0.05490358918905258, + -0.33469823002815247, + 0.060192231088876724, + -0.18713021278381348, + 0.28336861729621887, + -0.020655080676078796, + -0.20317746698856354, + 0.11114801466464996, + 0.01735503599047661, + 0.17464345693588257, + 0.06320668756961823, + 0.10093991458415985, + 0.13698388636112213, + -0.09725020825862885, + -0.07966253161430359, + 0.040120020508766174, + 0.11724333465099335, + 0.16341888904571533, + -0.13733802735805511, + -0.05715864524245262, + -0.17265571653842926, + 0.1541142612695694, + 0.6980870366096497, + -0.45086145401000977, + 0.06314481049776077, + 0.008300727233290672, + -0.0556473545730114 + ] + ], + [ + [ + 0.00012929461081512272, + 0.19960148632526398, + -0.022525735199451447, + -0.16641512513160706, + 0.036230508238077164, + -0.07165512442588806, + -0.3508664071559906, + -0.058194857090711594, + -0.034469813108444214, + -0.09001372009515762, + 0.03523261100053787, + 0.052809346467256546, + -0.2870227098464966, + -0.0913795679807663, + 0.010934186168015003, + -0.1896757036447525, + -0.09628212451934814, + 0.11170026659965515, + -0.05285082384943962, + -0.03094056062400341, + 0.10656749457120895, + 0.1681886911392212, + -0.00927028339356184, + 0.06670305877923965, + 0.2762855887413025, + -0.03514588624238968, + 0.09676877409219742, + -0.05458652973175049, + 0.166644886136055, + 0.13929831981658936, + 0.003097828943282366, + 0.20191225409507751 + ], + [ + 0.05801544710993767, + 0.13273033499717712, + -0.3402198553085327, + -0.010208101943135262, + -0.5174869894981384, + 0.46962669491767883, + 0.44054970145225525, + -0.18416178226470947, + 0.3870873749256134, + -0.3636643588542938, + 0.28628459572792053, + -0.11859992891550064, + -0.338765949010849, + -0.03102896735072136, + 0.07941452413797379, + 0.8891551494598389, + -0.05877891927957535, + 0.2917039096355438, + 0.8618091344833374, + 0.3024533987045288, + -0.3419055640697479, + -0.04561147466301918, + 0.16242989897727966, + -0.2367619425058365, + 0.19109128415584564, + -0.0389060378074646, + -0.4333372414112091, + -0.5268129110336304, + 0.0891050323843956, + 0.09483760595321655, + -0.17740462720394135, + 0.10697949677705765 + ], + [ + 0.16656209528446198, + 0.0574243925511837, + 0.019736172631382942, + 0.1529601514339447, + -0.5113698840141296, + 0.049475960433483124, + 0.14775121212005615, + -0.1940242350101471, + 0.4859648644924164, + -0.1618710607290268, + 0.0737488865852356, + -0.42933833599090576, + -0.23567494750022888, + -0.43127262592315674, + 0.2051834762096405, + 0.16967205703258514, + -0.35936662554740906, + 0.08476153761148453, + 0.47566211223602295, + 0.1557597666978836, + -0.12328600883483887, + 0.07868879288434982, + 0.28638818860054016, + 0.15428484976291656, + -0.1474449336528778, + 0.1322135031223297, + -0.14317192137241364, + -0.4498922526836395, + -0.2946045398712158, + -0.009307846426963806, + 0.05569858103990555, + -0.022124264389276505 + ], + [ + 0.21012234687805176, + -0.05996672064065933, + -0.11257380247116089, + 0.10548967868089676, + -0.23483726382255554, + 0.2381853461265564, + 0.1875465363264084, + -0.09863121807575226, + 0.19306351244449615, + 0.15645045042037964, + 0.040171850472688675, + -0.20891624689102173, + -0.40264466404914856, + -0.17198894917964935, + 0.21344386041164398, + 0.2813435196876526, + -0.0788925513625145, + 0.36656391620635986, + 0.38107866048812866, + 0.23168522119522095, + 0.04434534162282944, + 0.14973677694797516, + 0.26914238929748535, + -0.18838036060333252, + 0.04465021565556526, + 0.22219182550907135, + 0.008739297278225422, + -0.10245567560195923, + -0.17602424323558807, + 0.04325159266591072, + -0.17072126269340515, + -0.0032793835271149874 + ], + [ + 0.217793807387352, + 0.1919480711221695, + 0.06434020400047302, + 0.14378920197486877, + -0.07738050818443298, + 0.07690735906362534, + 0.14358404278755188, + 0.07957375049591064, + 0.21608620882034302, + 0.3097105622291565, + 0.06252864003181458, + -0.0669146329164505, + -0.1537957638502121, + -0.24321900308132172, + 0.22469672560691833, + -0.016796888783574104, + -0.02776501327753067, + 0.2155495136976242, + 0.18892167508602142, + -0.12891672551631927, + 0.0802050307393074, + 0.05321124941110611, + -0.07977604120969772, + 0.24242866039276123, + 0.07744431495666504, + 0.07287685573101044, + 0.22107216715812683, + 0.5591994524002075, + -0.1116136834025383, + -0.11276260018348694, + 0.10486926883459091, + 0.040585897862911224 + ], + [ + 0.1321059912443161, + -0.25750255584716797, + -0.07334403693675995, + -0.0034541303757578135, + -0.17120839655399323, + -0.025674449279904366, + 0.4391927421092987, + 0.32015547156333923, + 0.26591840386390686, + 0.09852655977010727, + -0.000300269341096282, + 0.018704446032643318, + -0.2686263620853424, + -0.07736790925264359, + 0.15729744732379913, + 0.26415660977363586, + 0.034574687480926514, + 0.2441847026348114, + 0.10660991072654724, + 0.05894095078110695, + 0.06014080345630646, + -0.06258171051740646, + -0.12944284081459045, + -0.0040337392129004, + -0.040382493287324905, + -0.05376889556646347, + 0.3253636956214905, + 0.9427987933158875, + -0.15263399481773376, + 0.012551604770123959, + 0.0676860511302948, + -0.41422584652900696 + ], + [ + 0.048968181014060974, + 0.08112471550703049, + 0.07097842544317245, + -0.006874416023492813, + 0.08774896711111069, + 0.08510598540306091, + -0.0810849517583847, + -0.25134000182151794, + 0.3153541684150696, + 0.11867120116949081, + 0.055445440113544464, + -0.2934209704399109, + -0.07034341245889664, + -0.023066557943820953, + 0.10173965990543365, + 0.11814241111278534, + -0.219507098197937, + 0.2548234462738037, + 0.29518842697143555, + -0.097417451441288, + -0.08284124732017517, + -0.007167372852563858, + 0.05371321365237236, + 0.027487769722938538, + 0.06384376436471939, + 0.004851100966334343, + -0.17742817103862762, + 0.07401534914970398, + -0.26374098658561707, + 0.027269206941127777, + -0.09689150750637054, + -0.2623137831687927 + ], + [ + 0.25077763199806213, + -0.18625350296497345, + -0.09767217189073563, + -0.13049481809139252, + -0.19652627408504486, + 0.0709087923169136, + -0.28322142362594604, + -0.0805673748254776, + -0.04794551804661751, + -0.11143603175878525, + -0.009762119501829147, + -0.34127527475357056, + 0.04529017582535744, + 0.2100125551223755, + -0.2336563766002655, + 0.30935031175613403, + 0.02234029397368431, + 0.001763770473189652, + -0.06324310600757599, + 0.5643035769462585, + 0.07545285671949387, + 0.05900813266634941, + -0.08984275907278061, + -0.252499520778656, + 0.1795310378074646, + -0.0799628272652626, + 0.275580495595932, + 0.08790479600429535, + -0.006706783082336187, + 0.22489558160305023, + 0.1373167484998703, + 0.00875071994960308 + ] + ], + [ + [ + -0.1430143266916275, + 0.048005033284425735, + 0.04735097289085388, + -0.14448735117912292, + -0.003078591311350465, + -0.07844721525907516, + 0.1175207644701004, + -0.03167227283120155, + 0.09495712071657181, + 0.06205993890762329, + -0.0009988815290853381, + 0.25582629442214966, + -0.282209187746048, + -0.03699629753828049, + 0.0987396091222763, + -0.28440341353416443, + 0.05667928233742714, + -0.0013298281701281667, + -0.1789368987083435, + 0.12226667255163193, + 0.022762663662433624, + 0.11673710495233536, + -0.09849882125854492, + 0.21407905220985413, + 0.027786362916231155, + -0.15713350474834442, + -0.01766657829284668, + 0.13017454743385315, + 0.03716980665922165, + -0.06842388957738876, + -0.21143634617328644, + -0.08684540539979935 + ], + [ + 0.1851160079240799, + 0.1491222083568573, + -0.4669366776943207, + -0.11005396395921707, + -0.26978471875190735, + 0.2679246664047241, + 0.23528361320495605, + -0.5386158227920532, + 0.07235343754291534, + 0.03483186289668083, + 0.10765937715768814, + 0.8984289765357971, + -0.4114305078983307, + -0.4428088366985321, + 0.6506851315498352, + 1.443001389503479, + 0.17413341999053955, + 0.9781240224838257, + 0.813730776309967, + 0.6430936455726624, + 0.31444624066352844, + -0.19037587940692902, + 1.5917361974716187, + -0.1342201679944992, + 0.862598717212677, + 0.04458237811923027, + -0.6462481021881104, + -0.7563241720199585, + 0.02126506343483925, + 0.20486941933631897, + 0.09903905540704727, + -0.01005230937153101 + ], + [ + 0.12049280852079391, + -0.20672675967216492, + -0.06352551281452179, + -0.14698302745819092, + 0.14669306576251984, + -0.051523007452487946, + 0.7327195405960083, + 0.09989892691373825, + -0.14946843683719635, + -0.29646193981170654, + 0.05225561559200287, + 0.7340328693389893, + -0.12798607349395752, + -0.4474382698535919, + 0.51537024974823, + 0.6624394059181213, + 0.042888764292001724, + 0.27368447184562683, + 0.2620099186897278, + 0.06758320331573486, + 0.24093222618103027, + -0.19876046478748322, + 0.6751323342323303, + 0.12526275217533112, + 0.07039317488670349, + 0.07521816343069077, + -0.00855968613177538, + -0.4459138810634613, + -0.3987720012664795, + 0.16001273691654205, + 0.3577705919742584, + -0.5753912329673767 + ], + [ + -0.009607205167412758, + 0.16012409329414368, + -0.02081925980746746, + 0.13080812990665436, + -0.06694064289331436, + 0.09910216927528381, + 0.5678929090499878, + 0.09150369465351105, + -0.18083776533603668, + -0.011567859910428524, + -0.04800918325781822, + 0.2086852341890335, + -0.047862619161605835, + -0.5554383397102356, + 0.6087705492973328, + 0.39143121242523193, + 0.1695721447467804, + 0.46691107749938965, + -0.10496785491704941, + 0.0172838494181633, + 0.460771381855011, + 0.06206816807389259, + 0.2867938280105591, + 0.02537154033780098, + -0.07634945958852768, + 0.26357701420783997, + -0.23026050627231598, + -0.33866453170776367, + -0.26256462931632996, + 0.14138799905776978, + 0.4141419529914856, + -0.15783269703388214 + ], + [ + 0.10178501904010773, + 0.10038681328296661, + -0.03358439728617668, + -0.1504582166671753, + 0.11221788078546524, + 0.03365330398082733, + 0.4821043908596039, + 0.19256284832954407, + 0.08748017251491547, + -0.06420604884624481, + -0.008804255165159702, + 0.12690865993499756, + -0.014358551241457462, + -0.23246555030345917, + 0.33934956789016724, + 0.3734395205974579, + -0.11692672967910767, + 0.2911449670791626, + -0.14123952388763428, + 0.006231657695025206, + 0.10729030519723892, + -0.30189526081085205, + 0.23585878312587738, + 0.26234155893325806, + -0.14139871299266815, + 0.018559735268354416, + -0.3467809855937958, + 0.30811256170272827, + -0.21978464722633362, + 0.10463979840278625, + 0.08489080518484116, + -0.2893516421318054 + ], + [ + -0.03865363448858261, + 0.017483551055192947, + -0.03168902173638344, + 0.044864214956760406, + -0.034548789262771606, + 0.07913751155138016, + 0.49004432559013367, + -0.0007560474914498627, + -0.19987589120864868, + -0.061643362045288086, + 0.10530898720026016, + 0.18291103839874268, + -0.003546187886968255, + -0.13850481808185577, + 0.2850182056427002, + 0.3709070682525635, + -0.02859513647854328, + 0.17004621028900146, + -0.22971275448799133, + -0.14460398256778717, + 0.42912864685058594, + -0.0290103517472744, + 0.05696798115968704, + -0.1633882224559784, + -0.15564027428627014, + 0.07762052118778229, + -0.19738627970218658, + -0.10048574954271317, + -0.35015833377838135, + 0.04508822783827782, + 0.11975730955600739, + -0.22955511510372162 + ], + [ + 0.08462638407945633, + -0.20382839441299438, + 0.05937567353248596, + -0.05084267258644104, + -0.1480686366558075, + 0.008774999529123306, + 0.12603211402893066, + 0.11361625790596008, + -0.14263863861560822, + 0.0803791880607605, + -0.013659752905368805, + -0.056652236729860306, + 0.08208045363426208, + -0.26601362228393555, + 0.05967842414975166, + 0.2304641455411911, + 0.12371645122766495, + 0.05235854908823967, + -0.264442503452301, + -0.13118630647659302, + 0.19118140637874603, + -0.2902815639972687, + -0.017010020092129707, + -0.03063066117465496, + -0.22270992398262024, + 0.09535205364227295, + 0.13021378219127655, + 0.6676625609397888, + -0.2622085511684418, + -0.058037467300891876, + 0.06052527576684952, + 0.18622951209545135 + ], + [ + -0.13324545323848724, + -0.20891788601875305, + 0.024177713319659233, + 0.14042197167873383, + -0.12123847752809525, + 0.13603198528289795, + 0.3203914165496826, + -0.13333892822265625, + 0.0481836162507534, + 0.2581212818622589, + 0.09825561940670013, + 0.024886662140488625, + -0.015203807502985, + -0.007082541938871145, + 0.08167946338653564, + 0.06016664206981659, + 0.023602064698934555, + 0.3716573715209961, + 0.05006733536720276, + 0.02592037059366703, + -0.08133784681558609, + -0.09440818428993225, + 0.16355302929878235, + 0.06833388656377792, + -0.2625890374183655, + 0.07101177424192429, + -0.22557805478572845, + -0.025715084746479988, + 0.14492765069007874, + 0.05107404664158821, + 0.03824464604258537, + -0.11919405311346054 + ] + ], + [ + [ + -0.13524127006530762, + -0.25696176290512085, + 0.046150822192430496, + -0.022381292656064034, + -0.00583410682156682, + -0.051222044974565506, + -0.3172220289707184, + -0.2725379168987274, + -0.0896119698882103, + 0.22363221645355225, + -0.03955160826444626, + -0.3765224516391754, + -0.15808668732643127, + -0.03669852390885353, + 0.00738118402659893, + -0.059414640069007874, + -0.2219475507736206, + -0.01633925922214985, + -0.2111695110797882, + 0.025441093370318413, + -0.23162458837032318, + 0.07481304556131363, + -0.11293589323759079, + 0.17639201879501343, + -0.001852431334555149, + -0.1622479408979416, + -0.42767083644866943, + 0.38221827149391174, + 0.2752920091152191, + -0.15730661153793335, + -0.1951296478509903, + 0.40679511427879333 + ], + [ + -0.23191705346107483, + 0.34969332814216614, + -0.03084067814052105, + -0.4416583180427551, + 0.6835706233978271, + 0.2448619306087494, + -0.4125019907951355, + -0.6287513971328735, + -0.7600018978118896, + 0.44711944460868835, + 0.00782698392868042, + -0.5592993497848511, + 0.038658980280160904, + 0.5331929326057434, + -0.14521439373493195, + 0.2434019297361374, + 0.26475635170936584, + 0.8561779260635376, + -0.25855502486228943, + -0.09403674304485321, + 1.3650407791137695, + -0.1515679657459259, + 0.23355232179164886, + -0.013780467212200165, + 0.6466450691223145, + 0.04766661301255226, + -0.23228907585144043, + -0.9092606902122498, + -0.1815183013677597, + 0.9818074107170105, + 0.47595077753067017, + -0.1155925914645195 + ], + [ + -0.0836147591471672, + -0.17713326215744019, + 0.16377902030944824, + -0.3352527618408203, + 0.3412916362285614, + 0.14987941086292267, + 0.16310018301010132, + -0.5597352385520935, + -0.5511837005615234, + 0.11285340040922165, + 0.057962387800216675, + -0.6209675073623657, + 0.5492247343063354, + 0.431560754776001, + -0.19368217885494232, + 0.1396542638540268, + 0.3622795045375824, + 0.1799832433462143, + -0.7486908435821533, + 0.09364058822393417, + 0.7761108875274658, + -0.06614936143159866, + 0.12769365310668945, + 0.35941290855407715, + 0.40940624475479126, + -0.23054622113704681, + 0.06020452827215195, + 0.8511754274368286, + -0.06540792435407639, + 0.3230683505535126, + 0.09971252083778381, + -0.4376351833343506 + ], + [ + -0.09898227453231812, + 0.15275096893310547, + 0.11398601531982422, + -0.17216350138187408, + 0.2874385416507721, + -0.10751504451036453, + 0.14092043042182922, + -0.3218402564525604, + -0.3302009403705597, + -0.008541044779121876, + -0.009282639250159264, + -0.3174600303173065, + 0.18286943435668945, + 0.08359921723604202, + -0.019406132400035858, + 0.04322372004389763, + 0.10376803576946259, + 0.11360383033752441, + -0.5076931118965149, + -0.1778416633605957, + 0.6992894411087036, + 0.1472184807062149, + -0.06798777729272842, + 0.09555283933877945, + 0.12115982919931412, + 0.010358436033129692, + 0.14181864261627197, + -0.30452829599380493, + -0.18691715598106384, + 0.15952354669570923, + -0.08069611340761185, + -0.323646605014801 + ], + [ + 0.038250915706157684, + 0.0785348191857338, + 0.018131660297513008, + 0.09277161210775375, + 0.3355741798877716, + -0.08697983622550964, + 0.05408177152276039, + -0.1732690930366516, + -0.28222721815109253, + -0.1744087040424347, + 0.08951134234666824, + -0.13045470416545868, + 0.03890249878168106, + 0.23279941082000732, + -0.10529188811779022, + -0.2640221118927002, + 0.03325921297073364, + 0.16903996467590332, + -0.47145402431488037, + 0.23099006712436676, + 0.6940712332725525, + 0.05316343531012535, + -0.19694195687770844, + 0.017574548721313477, + 0.07295520603656769, + -0.07382597029209137, + -0.1719493567943573, + 0.08131971955299377, + -0.3151188790798187, + 0.01738663762807846, + 0.18534491956233978, + -0.08018501847982407 + ], + [ + 0.16685406863689423, + -0.12789757549762726, + 0.11021511256694794, + -0.30348560214042664, + -0.10706882178783417, + 0.03958292677998543, + 0.027775324881076813, + -0.14609859883785248, + -0.13244377076625824, + -0.018285611644387245, + 0.12834574282169342, + -0.14779044687747955, + 0.05607180669903755, + 0.1429499238729477, + -0.2320782095193863, + -0.2316902130842209, + 0.18220874667167664, + 0.01716490089893341, + -0.16200967133045197, + 0.01796877011656761, + 0.20642337203025818, + 0.03629251569509506, + -0.07148803025484085, + 0.13340029120445251, + -0.02125367522239685, + -0.06845585256814957, + -0.04371485859155655, + -0.8076843023300171, + -0.2451436072587967, + -0.054857321083545685, + -0.2631370723247528, + -0.07475503534078598 + ], + [ + 0.10036636888980865, + -0.2791580259799957, + -0.04277689382433891, + -0.12211167067289352, + 0.10346586257219315, + 0.12259601056575775, + 0.05701703205704689, + -0.116954006254673, + -0.25236985087394714, + -0.3446960151195526, + -0.01876376010477543, + 0.005682604853063822, + 0.28134503960609436, + 0.15350373089313507, + 0.05718223750591278, + -0.09795930236577988, + 0.05137079581618309, + -0.1422009915113449, + -0.28030434250831604, + 0.44445300102233887, + 0.3196086287498474, + 0.17439110577106476, + 0.023986464366316795, + 0.13261179625988007, + -0.04936017468571663, + 0.06528699398040771, + -0.4009551703929901, + -0.1658109426498413, + -0.06491618603467941, + 0.06205412372946739, + -0.19189850986003876, + -0.1476569026708603 + ], + [ + -0.15146033465862274, + -0.025995926931500435, + -0.005979293491691351, + -0.10763993114233017, + 0.06918990612030029, + -0.0848044827580452, + -0.15475966036319733, + 0.010053782723844051, + -0.2250940501689911, + -0.07362049072980881, + -0.016133058816194534, + -0.2470390647649765, + 0.0583377406001091, + 0.12055279314517975, + 0.13727745413780212, + 0.16365498304367065, + 0.114634208381176, + -0.05121097341179848, + -0.23303958773612976, + -0.27812469005584717, + 0.29574140906333923, + 0.11571919173002243, + 0.07265443354845047, + -0.0667436495423317, + -0.09591983258724213, + 0.05014652758836746, + 0.27411067485809326, + -0.3572288155555725, + -0.16261200606822968, + -0.011811159551143646, + 0.18531732261180878, + 0.32546988129615784 + ] + ], + [ + [ + 0.011245929636061192, + 0.19064638018608093, + 0.0012399643892422318, + -0.17280951142311096, + 0.08441780507564545, + -0.006341775879263878, + 0.012661397457122803, + 0.16971604526042938, + 0.16021595895290375, + -0.005062483251094818, + 0.00174831529147923, + 0.10561350733041763, + -0.1703300178050995, + 0.22132304310798645, + -0.23452746868133545, + -0.012769055552780628, + 0.027292659506201744, + 0.3249305486679077, + -0.569064736366272, + -0.23471300303936005, + -0.14555059373378754, + 0.16802752017974854, + 0.14360903203487396, + 0.1678466945886612, + -0.07587282359600067, + 0.22181612253189087, + 0.09710665047168732, + -0.01909855753183365, + -0.15461693704128265, + -0.2028784155845642, + 0.0016229635803028941, + 0.2481217086315155 + ], + [ + -0.3619416654109955, + 0.2716912031173706, + -0.12519174814224243, + -1.2010393142700195, + 0.3546769618988037, + 0.3678126633167267, + -0.8640121817588806, + -0.019491281360387802, + -0.2088746279478073, + 0.4056839942932129, + 0.12704332172870636, + 0.09458184987306595, + 0.034137118607759476, + 0.39387401938438416, + -0.6729397773742676, + 0.042711012065410614, + 0.20924676954746246, + 0.5192292928695679, + -0.031329650431871414, + 0.07743903994560242, + 0.18249793350696564, + 0.20840822160243988, + -0.19139334559440613, + -0.18179848790168762, + -0.09924187511205673, + 0.2623027563095093, + 0.5176408886909485, + -0.3231904208660126, + -0.04916615039110184, + 0.39620983600616455, + 0.1279740035533905, + 0.09410256147384644 + ], + [ + -0.015676921233534813, + 0.1918691247701645, + -0.014106087386608124, + -0.6219682097434998, + 0.13139459490776062, + 0.10128847509622574, + -0.6373302340507507, + 0.015978438779711723, + -0.26688146591186523, + -0.05225566774606705, + 0.038250409066677094, + 0.2898293435573578, + 0.18751642107963562, + 0.628638744354248, + -0.6779073476791382, + -0.07917942851781845, + 0.29464006423950195, + 0.25329938530921936, + -0.35376453399658203, + 0.09578020125627518, + 0.02293466404080391, + 0.1304609626531601, + -0.06411541998386383, + -0.07043379545211792, + -0.10620326548814774, + 0.18411582708358765, + 0.34573206305503845, + -0.11436937004327774, + 0.04484706372022629, + 0.00868218857795, + -0.17505331337451935, + -0.2101234495639801 + ], + [ + 0.016032131388783455, + 0.09469752013683319, + 0.1262204945087433, + -0.4716610312461853, + 0.17165876924991608, + 0.054737936705350876, + -0.36573436856269836, + 0.06272802501916885, + -0.07792867720127106, + -0.18104340136051178, + 0.0997021496295929, + 0.29774919152259827, + 0.028303418308496475, + 0.16426023840904236, + -0.33684274554252625, + -0.2296411097049713, + 0.09713806211948395, + 0.06630238145589828, + -0.1395103633403778, + -0.20361362397670746, + 0.09245368838310242, + 0.18538686633110046, + -0.26579251885414124, + -0.0037404627073556185, + -0.18129175901412964, + 0.03074484132230282, + 0.3956203758716583, + -0.2619435787200928, + -0.4185847043991089, + -0.09346166253089905, + 0.026361890137195587, + 0.015814263373613358 + ], + [ + -0.0088859423995018, + -0.21140791475772858, + 0.12184888869524002, + -0.4989854693412781, + 0.2434346228837967, + -0.04104490950703621, + 0.21506367623806, + 0.1285170316696167, + 0.2142484039068222, + 0.07083716243505478, + 0.11258219927549362, + 0.014468859881162643, + 0.04617912694811821, + 0.16253069043159485, + -0.34588342905044556, + -0.11659596115350723, + -0.16249528527259827, + -0.10365265607833862, + 0.020912930369377136, + -0.32670751214027405, + -0.13237419724464417, + 0.10634757578372955, + -0.065067820250988, + 0.024682331830263138, + -0.1037580743432045, + -0.01906696893274784, + -0.22106480598449707, + -0.36209407448768616, + -0.18188798427581787, + 0.007273453753441572, + 0.19056794047355652, + -0.09867493063211441 + ], + [ + -0.10270878672599792, + -0.01006392017006874, + 0.0011165679898113012, + -0.5181496739387512, + -0.06156124547123909, + -0.10761125385761261, + -0.36782708764076233, + 0.2214369773864746, + 0.2159782499074936, + 0.35106217861175537, + -0.02381810173392296, + 0.08466847240924835, + -0.0717887356877327, + -0.03051825799047947, + -0.12745334208011627, + -0.12047600001096725, + 0.028332889080047607, + -0.14651808142662048, + 0.09687483310699463, + 0.10815602540969849, + 0.004871007055044174, + 0.1745954155921936, + -0.34856921434402466, + -0.11201220750808716, + -0.1328580379486084, + -0.02141672372817993, + -0.18058975040912628, + 0.033386651426553726, + -0.1502014547586441, + 0.049795690923929214, + -0.10959481447935104, + 0.0945938304066658 + ], + [ + -0.11078105121850967, + -0.23933525383472443, + 0.07689382135868073, + -0.3352739214897156, + 0.08130952715873718, + 0.002683413214981556, + 0.051160842180252075, + -0.09719241410493851, + 0.03624396771192551, + 0.13991324603557587, + -0.039273135364055634, + -0.008384729735553265, + -0.00133879529312253, + -0.07291875779628754, + -0.22765441238880157, + -0.07762976735830307, + 0.14086535573005676, + 0.020683852955698967, + 0.03943220525979996, + -0.034688159823417664, + 0.1348818838596344, + 0.11838796734809875, + 0.1014004573225975, + -0.18826605379581451, + -0.08574987202882767, + -0.048178039491176605, + -0.2383304089307785, + -0.33542388677597046, + -0.23207451403141022, + 0.09372331202030182, + 0.16227881610393524, + -0.05008118227124214 + ], + [ + -0.06501199305057526, + -0.1333860456943512, + -0.06949657946825027, + -0.41194289922714233, + 0.13667047023773193, + 0.06557831168174744, + 0.1118428036570549, + -0.2449331283569336, + 0.2616117298603058, + -0.05267081782221794, + -0.04041000083088875, + 0.3945257067680359, + -0.027511686086654663, + -0.001711956923827529, + -0.1203598901629448, + -0.07911645621061325, + 0.10704097896814346, + 0.12676064670085907, + 0.08619842678308487, + 0.060674600303173065, + -0.044800981879234314, + 0.10497460514307022, + -0.14299821853637695, + -0.11057855188846588, + -0.3504083752632141, + -0.13320022821426392, + -0.1915556639432907, + -0.3737933337688446, + -0.1475987583398819, + -0.010841034352779388, + 0.22287702560424805, + -0.295821875333786 + ] + ] + ], + [ + [ + [ + -0.23306506872177124, + -0.1387384831905365, + 0.11210787296295166, + -0.10855378955602646, + -0.09037191420793533, + -0.09667333960533142, + 0.4835786819458008, + -0.07640277594327927, + 0.09046448767185211, + 0.07576790452003479, + 0.06505728513002396, + 0.2343796342611313, + -0.26707011461257935, + 0.1365726888179779, + -0.1499757021665573, + -0.06939801573753357, + 0.019369078800082207, + 0.10120631754398346, + 0.0805845856666565, + -0.15611901879310608, + -0.24056655168533325, + 0.27042126655578613, + -0.16614104807376862, + -0.02962150052189827, + -0.2988046407699585, + -0.14316828548908234, + -0.217149019241333, + 0.02375517040491104, + 0.061584118753671646, + -0.1071092039346695, + -0.09365049004554749, + -0.4111120402812958 + ], + [ + 0.42004916071891785, + -0.03996746242046356, + -0.1969100683927536, + 0.5960530638694763, + -0.20332011580467224, + 0.17179429531097412, + -0.6893696784973145, + -0.6893175840377808, + -0.36487656831741333, + 0.20676147937774658, + 0.20438630878925323, + -0.9502484798431396, + -0.15063126385211945, + -0.3352248966693878, + 0.3362891972064972, + 1.7141101360321045, + 0.2920685410499573, + 0.4815584421157837, + -0.5761962532997131, + 0.2396606057882309, + 0.45813634991645813, + -0.02498445473611355, + 0.10341817885637283, + -0.16226565837860107, + 1.8985357284545898, + -0.17615877091884613, + -0.4462939202785492, + 0.7414244413375854, + 0.18041366338729858, + 1.5870192050933838, + 0.423315167427063, + -0.3397500216960907 + ], + [ + 0.2394450455904007, + -0.17901985347270966, + 0.029253629967570305, + 0.567072868347168, + 0.030081918463110924, + -0.01828325167298317, + -0.3623555600643158, + 0.1082402691245079, + -0.37372636795043945, + -0.041066549718379974, + 0.044210247695446014, + -0.6734482049942017, + 0.6434903740882874, + 0.059348203241825104, + 0.3622872531414032, + 0.5981597900390625, + 0.24066251516342163, + 0.002804695861414075, + -0.9240162968635559, + 0.004572646226733923, + 0.1483767181634903, + -0.0800786241889, + -0.27972373366355896, + 0.2961694002151489, + 0.8149831295013428, + -0.26719850301742554, + 0.12169276177883148, + 0.9697459936141968, + -0.015449268743395805, + 0.5981376767158508, + 0.10874950140714645, + 0.032835282385349274 + ], + [ + 0.26710063219070435, + -0.08970867842435837, + 0.10712624341249466, + 0.49375706911087036, + 0.5195204615592957, + -0.1286853700876236, + -0.2726675271987915, + -0.20735083520412445, + -0.24469724297523499, + 0.1046019196510315, + 0.08808492869138718, + -0.5869953632354736, + 0.35899096727371216, + 0.48899027705192566, + 0.45434990525245667, + 0.25941741466522217, + -0.04752064123749733, + -0.2843411862850189, + -0.7085121273994446, + 0.2751377522945404, + -0.05566667392849922, + 0.08060953766107559, + -0.3948501944541931, + -0.07807279378175735, + 0.0811496302485466, + -0.08270774781703949, + 0.20009595155715942, + 0.027651268988847733, + -0.17487561702728271, + 0.00596208032220602, + 0.17089959979057312, + 0.18171165883541107 + ], + [ + 0.016260160133242607, + 0.3830411732196808, + 0.0767698734998703, + 0.442423015832901, + 0.17583008110523224, + -0.02265009470283985, + -0.7561827301979065, + -0.014627434313297272, + -0.15007078647613525, + 0.14950743317604065, + 0.025276700034737587, + -0.35356736183166504, + 0.3322787284851074, + 0.20341576635837555, + 0.2336411476135254, + 0.17184320092201233, + 0.06050040200352669, + -0.038763608783483505, + -0.5744636058807373, + 0.03610791638493538, + 0.003686703974381089, + -0.0844530388712883, + -0.408540278673172, + 0.29082000255584717, + -0.20360183715820312, + -0.12292226403951645, + 0.37740880250930786, + -0.0065307593904435635, + -0.07120057940483093, + -0.20100682973861694, + -0.03267411142587662, + 0.356337308883667 + ], + [ + 0.1005653515458107, + -0.01897706277668476, + -0.03530992940068245, + 0.6124470829963684, + 0.05972253903746605, + -0.012197240255773067, + -0.9218688607215881, + 0.1600894182920456, + -0.27039635181427, + 0.05796094983816147, + -0.021957969292998314, + -0.356618732213974, + 0.01655203476548195, + 0.3265240490436554, + 0.31375205516815186, + 0.22676625847816467, + 0.36755359172821045, + 0.17146435379981995, + -0.37284713983535767, + 0.36996570229530334, + 0.0725410208106041, + -0.11413319408893585, + -0.12853994965553284, + -0.07747181504964828, + 0.5482784509658813, + -0.16518568992614746, + 0.33432772755622864, + 0.6911231875419617, + -0.1744849979877472, + 0.1077529564499855, + 0.19800513982772827, + 0.5133975744247437 + ], + [ + 0.08804845809936523, + 0.3290887475013733, + 0.07907306402921677, + 0.3450990319252014, + 0.2770085632801056, + -0.1583309918642044, + -0.8847423195838928, + 0.18719923496246338, + -0.010188160464167595, + -0.09213750064373016, + 0.07763629406690598, + -0.24395278096199036, + -0.007607427891343832, + 0.3096424341201782, + 0.06175990775227547, + -0.0798560157418251, + 0.17455394566059113, + -0.07223948836326599, + -0.50656658411026, + 0.10333908349275589, + -0.21429985761642456, + 0.1219419538974762, + -0.34353095293045044, + 0.003917441703379154, + -0.42757201194763184, + 0.07206320017576218, + -0.026425795629620552, + -0.6745452284812927, + -0.16066087782382965, + -0.3327265977859497, + 0.028588546440005302, + 0.3208146393299103 + ], + [ + 0.3495956361293793, + 0.3383358418941498, + 0.005266850348562002, + 0.10161113739013672, + 0.20134423673152924, + 0.005052013788372278, + -0.7766538858413696, + 0.3009302616119385, + -0.15420745313167572, + -0.13038493692874908, + -0.03437495604157448, + -0.2967709004878998, + 0.1394757181406021, + 0.22000496089458466, + 0.05657580494880676, + 0.18159328401088715, + 0.04510533809661865, + -0.04458943009376526, + -0.45499351620674133, + 0.17639298737049103, + -0.0917147770524025, + -0.09025375545024872, + -0.25397515296936035, + 0.00651407428085804, + -0.4554053843021393, + -0.23455089330673218, + -0.16039879620075226, + -0.6092105507850647, + -0.11711984127759933, + -0.20551125705242157, + 0.17021805047988892, + 0.22385993599891663 + ] + ], + [ + [ + -0.1958354413509369, + 0.2778851389884949, + 0.1516699343919754, + 0.053148917853832245, + 0.007711273618042469, + -0.04871435835957527, + 0.4578596353530884, + 0.3394324779510498, + 0.28433752059936523, + 0.0773925855755806, + 0.11615420132875443, + 0.2917326092720032, + -0.20244689285755157, + 0.0062970309518277645, + 0.09137346595525742, + 0.10738728940486908, + -0.03586828336119652, + -0.18476596474647522, + -0.06019403040409088, + -0.024249088019132614, + 0.022917743772268295, + 0.056018609553575516, + -0.1460045874118805, + 0.10257052630186081, + -0.08298202604055405, + -0.040058039128780365, + 0.011777374893426895, + -0.14642108976840973, + -0.19487644731998444, + -0.2499757558107376, + 0.06507836282253265, + -0.054250821471214294 + ], + [ + 0.3058096766471863, + -0.11523734778165817, + -0.1630752980709076, + 0.5140019655227661, + -0.72704017162323, + 0.10748423635959625, + -0.28386396169662476, + -0.3669167757034302, + -0.08493765443563461, + 0.04954967275261879, + 0.05793987587094307, + -0.004901977255940437, + -0.140789195895195, + -0.37108874320983887, + 0.21668480336666107, + 0.9733977317810059, + -0.14478734135627747, + -0.09048911184072495, + -1.1393948793411255, + 0.4068997800350189, + 0.547258198261261, + -0.12457756698131561, + 2.0573208332061768, + 0.03305937349796295, + 1.0969620943069458, + -0.08341655880212784, + 0.20100805163383484, + -0.16253100335597992, + 0.09513746947050095, + 2.7528109550476074, + 0.4198480546474457, + -0.5959774851799011 + ], + [ + 0.3836604356765747, + 0.2723720669746399, + 0.03927331417798996, + 0.31068891286849976, + -0.3376396596431732, + -0.01655638962984085, + -1.0601844787597656, + -0.036885570734739304, + 0.31020328402519226, + 0.12474969029426575, + 0.019807428121566772, + 0.03474487364292145, + 0.0001764732733136043, + 0.10352888703346252, + -0.022729236632585526, + 0.48837873339653015, + -0.10557485371828079, + -0.07655993849039078, + -0.4852023124694824, + 0.10372702032327652, + 0.3453470468521118, + 0.079131118953228, + 0.8560282588005066, + 0.20660364627838135, + 0.43843939900398254, + -0.045009445399045944, + 0.4034181237220764, + 1.0430241823196411, + 0.3481961190700531, + 0.8842346668243408, + 0.5023558735847473, + -0.3239313066005707 + ], + [ + 0.2014482319355011, + -0.3140527606010437, + 0.024076825007796288, + 0.15505246818065643, + -0.24447950720787048, + -0.08202844113111496, + -1.1549170017242432, + -0.026865938678383827, + 0.1067022830247879, + -0.1822061687707901, + -0.06987321376800537, + -0.18542878329753876, + -0.06286879628896713, + -0.14853762090206146, + -0.1690514087677002, + 0.2729834318161011, + 0.005600497592240572, + 0.32427340745925903, + -0.19299085438251495, + 0.2474919855594635, + 0.39996224641799927, + 0.0020546498708426952, + 0.5135283470153809, + -0.18160390853881836, + 0.686211884021759, + 0.03384719789028168, + 0.49170762300491333, + 1.6539043188095093, + 0.21981367468833923, + 0.39712774753570557, + 0.40677154064178467, + -0.1368110328912735 + ], + [ + 0.11234057694673538, + 0.008012213744223118, + 0.01035863533616066, + 0.09958560019731522, + -0.14051134884357452, + -0.12461365014314651, + -0.4677800238132477, + -0.13595852255821228, + 0.1515127420425415, + -0.006172783672809601, + 0.07159527391195297, + -0.18261964619159698, + 0.023228844627738, + -0.06173596903681755, + -0.04977773502469063, + 0.23826873302459717, + -0.010762188583612442, + 0.47674161195755005, + -0.05157133564352989, + -0.1829712688922882, + 0.3751477897167206, + -0.12727564573287964, + 0.2601465582847595, + 0.06936068087816238, + 0.7386653423309326, + 0.0034630652517080307, + -0.1867193579673767, + 1.4111407995224, + 0.09662490338087082, + 0.44463926553726196, + 0.127627894282341, + -0.15091152489185333 + ], + [ + -0.07607143372297287, + -0.16528533399105072, + 0.02057187631726265, + 0.15592893958091736, + -0.25859034061431885, + 0.07458215951919556, + -0.29652437567710876, + -0.12109191715717316, + 0.04108757525682449, + 0.14898943901062012, + -0.02746696025133133, + -0.16040262579917908, + 0.1188686341047287, + -0.3337736129760742, + -0.12282329797744751, + 0.06875547766685486, + 0.20463839173316956, + 0.3475191593170166, + 0.2869076728820801, + 0.2875661849975586, + 0.487178772687912, + 0.03840570151805878, + 0.4145105183124542, + -0.14092625677585602, + 0.8961583971977234, + -0.1587633639574051, + 0.031635984778404236, + 1.4579062461853027, + 0.31049680709838867, + 0.6498042345046997, + 0.15070189535617828, + -0.05605955049395561 + ], + [ + 0.27533864974975586, + -0.09900195896625519, + 0.0634196326136589, + 0.012663641013205051, + -0.056137360632419586, + 0.004056988749653101, + -0.4304206371307373, + 0.21172481775283813, + 0.04014630615711212, + 0.1321963369846344, + -0.001249600201845169, + -0.12499640882015228, + 0.04477272182703018, + 0.25596994161605835, + -0.12471064925193787, + 0.24400927126407623, + -0.05059955269098282, + 0.19043026864528656, + 0.18487538397312164, + -0.13944533467292786, + 0.39939647912979126, + 0.15748099982738495, + 0.32745668292045593, + 0.3292994201183319, + 0.7652881741523743, + 0.20494653284549713, + -0.0138180460780859, + 1.1691755056381226, + 0.009304772131145, + 0.14557521045207977, + 0.1658463031053543, + -0.4382005035877228 + ], + [ + 0.15983793139457703, + -0.47680389881134033, + 0.03912728279829025, + 0.3954351842403412, + 0.0008790577412582934, + -0.14195555448532104, + -1.039062261581421, + 0.0741804912686348, + -0.09960456192493439, + 0.05777741223573685, + 0.03853030502796173, + -0.4477938413619995, + 0.17233631014823914, + 0.28843286633491516, + 0.0450361967086792, + 0.17194239795207977, + 0.39983823895454407, + 0.4144349694252014, + -0.1826292723417282, + 1.0408539772033691, + 0.448720782995224, + -0.03802018240094185, + 0.15095606446266174, + -0.027184493839740753, + 1.2223008871078491, + 0.07919114828109741, + -0.08822181820869446, + 2.2453646659851074, + -0.15082141757011414, + 0.37358126044273376, + 0.11736559867858887, + 0.2200234830379486 + ] + ], + [ + [ + -0.11945109069347382, + 0.129801407456398, + 0.06569640338420868, + 0.04482998326420784, + 0.0011477434309199452, + 0.030754074454307556, + 0.17581376433372498, + -0.03263520449399948, + 0.01822012849152088, + 0.20163944363594055, + 0.07951897382736206, + -0.20865345001220703, + -0.3149917721748352, + 0.029957210645079613, + -0.14235441386699677, + 0.030965276062488556, + 0.029432974755764008, + -0.225878044962883, + -0.07147516310214996, + -0.19246266782283783, + -0.3332853615283966, + -0.06710272282361984, + -0.1685972958803177, + 0.2657589614391327, + 0.01054416224360466, + -0.054469022899866104, + -0.020047543570399284, + -0.04280376806855202, + -0.11603298783302307, + -0.19666893780231476, + -0.05429966747760773, + 0.10496558248996735 + ], + [ + 0.08706630766391754, + 0.20469623804092407, + -0.3018518090248108, + 0.63774573802948, + -0.24058270454406738, + 0.13940437138080597, + -0.09575312584638596, + -0.8186343312263489, + -0.3465079069137573, + -0.08182845264673233, + 0.10000995546579361, + -0.33406567573547363, + -0.22898627817630768, + -1.0493577718734741, + 0.4634590446949005, + 1.0030797719955444, + 0.28633445501327515, + 0.47172388434410095, + -0.8723708391189575, + 0.2672383785247803, + 0.9992568492889404, + -0.37198710441589355, + 2.248333215713501, + -0.40585851669311523, + 1.5469244718551636, + 0.1964055597782135, + -0.6972534656524658, + -1.3144702911376953, + 0.09208894520998001, + 2.687682628631592, + 0.5366439819335938, + -0.14774566888809204 + ], + [ + 0.2519083023071289, + 0.02863074094057083, + 0.02214452251791954, + 0.6024419069290161, + -0.3247314393520355, + 0.1466996669769287, + -0.46271660923957825, + -0.1972169280052185, + -0.08101975172758102, + -0.054504092782735825, + 0.14775153994560242, + -0.4785890281200409, + 0.3883582353591919, + -0.8831827640533447, + 0.3996775448322296, + 0.34927472472190857, + 0.07686368376016617, + 0.07758481055498123, + -0.10635364800691605, + -0.005670147016644478, + 0.7895249724388123, + -0.36748260259628296, + 0.9167026877403259, + 0.3189333975315094, + 1.223345160484314, + 0.04072174057364464, + -0.09037474542856216, + 0.43173056840896606, + 0.10019289702177048, + 1.0987414121627808, + 0.4723452627658844, + -0.2426159530878067 + ], + [ + 0.025214767083525658, + 0.005567019339650869, + 0.0057558962143957615, + 0.3396565318107605, + -0.03826482966542244, + 0.10511481016874313, + -0.5544688105583191, + -0.1660761535167694, + -0.4715164601802826, + -0.16228774189949036, + -0.041378770023584366, + -0.14464925229549408, + -0.03606205806136131, + -0.300082802772522, + 0.1276749074459076, + 0.12305185943841934, + 0.16616764664649963, + 0.23157086968421936, + -0.14050447940826416, + -0.03401664271950722, + 0.6218377947807312, + -0.1307327002286911, + 0.4807053208351135, + 0.007044068071991205, + 0.7398251891136169, + 0.20976588129997253, + -0.03178946301341057, + 0.032991454005241394, + 0.011937621980905533, + 0.8127813935279846, + 0.2826518714427948, + 0.0762016549706459 + ], + [ + -0.09922955930233002, + 0.2677338123321533, + 0.059330809861421585, + 0.3606557548046112, + -0.17663733661174774, + -0.061354152858257294, + -0.28062114119529724, + -0.26668280363082886, + 0.06831192970275879, + -0.16752661764621735, + -0.05123687908053398, + -0.1588943898677826, + 0.2581575810909271, + -0.20259426534175873, + 0.11983867734670639, + -0.19491204619407654, + 0.1401851624250412, + -0.19107389450073242, + -0.06482301652431488, + -0.10819478332996368, + 0.6078178286552429, + -0.14384014904499054, + 0.3211381733417511, + 0.0747068002820015, + 0.7399072051048279, + 0.05678520351648331, + 0.15058298408985138, + -0.7294926047325134, + -0.09384425729513168, + 0.44381722807884216, + 0.031253617256879807, + 0.2647254168987274 + ], + [ + 0.11219313740730286, + 0.2622165083885193, + 0.008419645950198174, + 0.09591883420944214, + 0.058808811008930206, + -0.037328239530324936, + 0.02393951825797558, + 0.1333134025335312, + -0.31920066475868225, + -0.026917437091469765, + -0.00945414137095213, + -0.15563549101352692, + -0.05558271333575249, + -0.09065933525562286, + 0.11486856639385223, + -0.20892225205898285, + 0.2704310715198517, + -0.43367061018943787, + 0.02633056789636612, + -0.16146789491176605, + 0.1333492398262024, + -0.23748144507408142, + 0.06038827449083328, + -0.21744871139526367, + 0.10321588069200516, + 0.11097769439220428, + -0.07849182188510895, + -1.287186622619629, + -0.05900200828909874, + 0.006947231013327837, + -0.19846618175506592, + 0.5772877931594849 + ], + [ + 0.06516116112470627, + 0.0930887833237648, + -0.08416987210512161, + 0.21809051930904388, + 0.0820157378911972, + 0.005178077612072229, + -0.2691558301448822, + 0.09817571192979813, + -0.17957694828510284, + 0.008086309768259525, + 0.040655333548784256, + -0.002441741293296218, + 0.38324856758117676, + -0.1859835386276245, + -0.006358244456350803, + -0.05795624107122421, + 0.08127719163894653, + -0.08418974280357361, + -0.4179350435733795, + -0.03659604862332344, + 0.3001044690608978, + -0.09239643812179565, + -0.007853493094444275, + -0.00339685776270926, + 0.3814001977443695, + 0.17326472699642181, + 0.3655587136745453, + 0.13259921967983246, + 0.09191148728132248, + 0.29780125617980957, + -0.03569171950221062, + -0.4251598119735718 + ], + [ + -0.05016351118683815, + 0.1825518012046814, + -0.10159998387098312, + 0.21469371020793915, + -0.06941056996583939, + 0.047788191586732864, + 0.17718000710010529, + -0.06282035261392593, + -0.20236346125602722, + -0.02170601114630699, + 0.01626521535217762, + -0.14720724523067474, + 0.064341701567173, + -0.8610607385635376, + 0.21712680160999298, + 0.21402712166309357, + 0.13393345475196838, + 0.27059993147850037, + 0.25078076124191284, + -0.03401685133576393, + 0.6551145911216736, + -0.13868117332458496, + 0.3761565387248993, + 0.06449629366397858, + 0.4148881733417511, + 0.14084722101688385, + 0.1574803739786148, + 1.66932213306427, + -0.15274855494499207, + 0.6037615537643433, + 0.10310032218694687, + 0.02911185659468174 + ] + ], + [ + [ + 0.14508379995822906, + -0.02919628657400608, + 0.09161558747291565, + -0.05010195076465607, + -0.09046167135238647, + 0.11851254105567932, + 0.1720859557390213, + -0.023106524720788002, + 0.09445679932832718, + 0.03964468836784363, + 0.009472223930060863, + -0.11176532506942749, + -0.09459327161312103, + 0.08704594522714615, + 0.18016082048416138, + -0.10782637447118759, + -0.030488356947898865, + 0.06785957515239716, + 0.007262405939400196, + -0.23421873152256012, + -0.07387053221464157, + 0.15632610023021698, + -0.2117629051208496, + 0.22782590985298157, + -0.3037717342376709, + -0.010633145458996296, + 0.10625630617141724, + -0.1645764708518982, + -0.21214845776557922, + -0.2370736300945282, + 0.027693044394254684, + 0.5905345678329468 + ], + [ + 0.20062503218650818, + 0.04145265370607376, + 0.014134221710264683, + -0.6900733113288879, + 0.5579072833061218, + 0.243052676320076, + 0.6212235689163208, + -0.1438533067703247, + -1.0071070194244385, + 0.219336599111557, + 0.07579788565635681, + -0.8949573636054993, + -0.39318594336509705, + 0.48772305250167847, + -0.48188546299934387, + 0.4158861041069031, + 0.7360816597938538, + -0.8053932785987854, + 0.9284707307815552, + 0.1516817957162857, + 0.3810890316963196, + -0.050392087548971176, + -0.5788314342498779, + 0.0636233314871788, + 0.5536918044090271, + -0.03714779391884804, + 0.3770984411239624, + 0.8622979521751404, + 0.02098853327333927, + -0.00698370486497879, + 0.48734429478645325, + 0.38342997431755066 + ], + [ + 0.23495249450206757, + -0.23863352835178375, + 0.12096494436264038, + -0.18755708634853363, + 0.372374564409256, + 0.0686357170343399, + 1.6192792654037476, + -0.03951602429151535, + -0.3627797067165375, + -0.45338961482048035, + 0.06456133723258972, + -0.5106227397918701, + 0.14023561775684357, + 0.48667973279953003, + 0.10624148696660995, + -0.22584067285060883, + 0.3438711166381836, + -0.6973229646682739, + 0.06597629189491272, + 0.1449183225631714, + -0.03143966197967529, + 0.10400118678808212, + -0.5485822558403015, + 0.014991510659456253, + 0.21798311173915863, + -0.08520060777664185, + 0.16802886128425598, + -0.1145523265004158, + -0.17609430849552155, + -0.10173267126083374, + -0.057459644973278046, + 0.7731430530548096 + ], + [ + -0.014525576494634151, + -0.03317289426922798, + 0.1089845597743988, + 0.2035256028175354, + 0.04906643554568291, + 0.023993076756596565, + 1.0517582893371582, + -0.10936050862073898, + -0.34089067578315735, + -0.26646262407302856, + 0.059628307819366455, + -0.42861926555633545, + 0.09663993120193481, + 0.3007911741733551, + -0.061566323041915894, + -0.24381603300571442, + 0.25356945395469666, + -0.606897234916687, + 0.0021874469239264727, + -0.10072681307792664, + -0.11889681965112686, + 0.005412958562374115, + -0.4247949421405792, + -0.010412939824163914, + 0.18589572608470917, + -0.13999532163143158, + 0.24109463393688202, + -0.6689198017120361, + -0.09091654419898987, + -0.08031494170427322, + -0.06017259135842323, + 0.9541127681732178 + ], + [ + -0.07951224595308304, + 0.083574578166008, + 0.12566733360290527, + 0.1279248297214508, + 0.07070863246917725, + 0.1543501913547516, + 0.25672057271003723, + 0.010687966831028461, + -0.16345122456550598, + -0.23737657070159912, + 0.019034365192055702, + -0.4248296320438385, + 0.15315106511116028, + 0.28110772371292114, + 0.19344384968280792, + -0.28227663040161133, + 0.348101407289505, + -0.7297376394271851, + 0.05858693644404411, + -0.1276983618736267, + -0.27591776847839355, + -0.03818367049098015, + -0.22967614233493805, + -0.0645371600985527, + 0.060972779989242554, + -0.0427527129650116, + 0.16587162017822266, + -0.8843944668769836, + -0.2821630537509918, + -0.24201160669326782, + -0.15607576072216034, + 0.6946235299110413 + ], + [ + -0.13267160952091217, + -0.21166108548641205, + -0.05135800689458847, + -0.19318953156471252, + 0.19883185625076294, + 0.020025111734867096, + 0.5932791829109192, + 0.390983521938324, + -0.17024348676204681, + -0.3765328526496887, + 0.02702495828270912, + 0.010627985000610352, + 0.3230777084827423, + 0.2599082887172699, + -0.02905692160129547, + -0.13967972993850708, + -0.09983661025762558, + -0.1323903650045395, + 0.11487437039613724, + -0.4892607629299164, + -0.04182838648557663, + -0.07182887941598892, + -0.24360232055187225, + -0.20108385384082794, + -0.3496813178062439, + -0.02673979103565216, + 0.43570783734321594, + -0.25774452090263367, + 0.019039561972022057, + -0.27310118079185486, + 0.1425037831068039, + 0.5961256623268127 + ], + [ + 0.021879414096474648, + 0.4437756836414337, + 0.012087230570614338, + 0.4587562680244446, + -0.10159854590892792, + 0.019643206149339676, + 0.19286023080348969, + 0.22960731387138367, + -0.08204404264688492, + -0.4488760530948639, + -0.023550253361463547, + -0.35243287682533264, + 0.22860069572925568, + -0.015627767890691757, + 0.14173029363155365, + -0.15333418548107147, + 0.11490108072757721, + -0.00353050883859396, + 0.056624885648489, + -0.40155190229415894, + 0.027966661378741264, + -0.14531616866588593, + -0.4600851535797119, + -0.20522938668727875, + 0.04914562404155731, + -0.11849985271692276, + 0.2531563341617584, + -0.7791181802749634, + -0.07958748191595078, + -0.18684709072113037, + -0.001266336883418262, + 0.43031635880470276 + ], + [ + 0.04501070827245712, + 0.40840622782707214, + 0.08372923731803894, + 0.2055412232875824, + 0.2117031216621399, + 0.06567991524934769, + 0.7788124680519104, + 0.16199497878551483, + -0.4063258767127991, + -0.015281367115676403, + 0.11040038615465164, + 0.1996685415506363, + 0.018173880875110626, + 0.2013627141714096, + 0.03714217245578766, + 0.18495914340019226, + 0.05706408619880676, + -0.5506871342658997, + -0.06649450957775116, + -0.8994590640068054, + -0.00423783715814352, + -0.17680130898952484, + -0.3911796808242798, + -0.14690834283828735, + -0.19329297542572021, + -0.099944107234478, + 0.35400599241256714, + -1.3791574239730835, + -0.05015333369374275, + -0.3304564952850342, + -0.19397476315498352, + 0.3923012316226959 + ] + ], + [ + [ + -0.16696572303771973, + -0.13364596664905548, + 0.1171668991446495, + 0.10056708753108978, + 0.0915440246462822, + 0.08061052113771439, + -0.050144825130701065, + 0.5011735558509827, + -0.22017979621887207, + -0.14549224078655243, + 0.008422205224633217, + -0.33751076459884644, + -0.10165262222290039, + -0.24474729597568512, + 0.029705125838518143, + -0.01581789180636406, + -0.34519195556640625, + 0.05829700455069542, + 0.3864544928073883, + -0.2678866982460022, + -0.0953119769692421, + 0.13604240119457245, + 0.11835359036922455, + -0.1167437732219696, + -0.5403475761413574, + 0.06229535490274429, + -0.08379329741001129, + -0.27716562151908875, + -0.050636935979127884, + -0.12452588230371475, + 0.01943212002515793, + -0.09223223477602005 + ], + [ + -0.221866175532341, + 0.16573873162269592, + -0.169407919049263, + -2.5731234550476074, + 0.3834681510925293, + 0.3430509865283966, + 0.7127097845077515, + -0.32514068484306335, + -0.12928247451782227, + -0.27526193857192993, + 0.08225689828395844, + 2.276848316192627, + 0.008403087966144085, + 0.46630650758743286, + -0.9697747826576233, + 0.010399887338280678, + 0.07895438373088837, + -1.2635598182678223, + 4.679153919219971, + -0.23879587650299072, + 0.06534110009670258, + -0.06025088578462601, + -0.03499111905694008, + -0.08287232369184494, + -0.7152665853500366, + 0.10133637487888336, + 0.22983340919017792, + 1.4766937494277954, + -0.23231860995292664, + -0.7045912742614746, + 0.6789252161979675, + 0.6390566229820251 + ], + [ + -0.09785300493240356, + 0.22442112863063812, + -0.03759407624602318, + -1.247062087059021, + 0.1605510115623474, + 0.08460354804992676, + 1.3674949407577515, + 0.16240207850933075, + 0.29395750164985657, + -0.029484810307621956, + 0.05966494604945183, + 1.5350801944732666, + 0.04272013530135155, + 0.3422525227069855, + -0.4201512336730957, + -0.43978598713874817, + -0.10772538185119629, + -0.8291482329368591, + 1.3479728698730469, + -0.5263103246688843, + -0.1543271541595459, + 0.05137256160378456, + -0.13015425205230713, + -0.0464957021176815, + -1.1109204292297363, + -0.06852405518293381, + 0.44947749376296997, + -0.12675446271896362, + -0.23201435804367065, + -0.8722343444824219, + 0.13632090389728546, + 0.42829659581184387 + ], + [ + 0.10801226645708084, + -0.28042709827423096, + -0.05393468588590622, + -1.2466132640838623, + 0.012950009666383266, + 0.05183418095111847, + 1.1851811408996582, + 0.02702324464917183, + 0.1687147468328476, + -0.08430074155330658, + -0.016934579238295555, + 1.1518510580062866, + 0.11950241774320602, + 0.34274834394454956, + -0.4311216175556183, + -0.37115564942359924, + -0.26661160588264465, + -0.6274175643920898, + 0.7608069777488708, + -0.29037779569625854, + -0.15813763439655304, + 0.027967583388090134, + 0.12113068997859955, + -0.04486895352602005, + -1.0113911628723145, + 0.06376635283231735, + 0.27066054940223694, + 0.06729330867528915, + -0.024270467460155487, + -0.5355405807495117, + 0.3877447247505188, + 0.19543693959712982 + ], + [ + -0.07762796431779861, + -0.1921011209487915, + -0.03895237296819687, + -0.8493082523345947, + -0.025061093270778656, + -0.025349918752908707, + 0.8707203269004822, + 0.37736791372299194, + 0.08553315699100494, + -0.17526037991046906, + -0.044884126633405685, + 1.2108454704284668, + 0.2718728482723236, + 0.19070672988891602, + -0.40706339478492737, + -0.42778775095939636, + -0.06590962409973145, + -0.5471310615539551, + 0.4580930769443512, + -0.7354713678359985, + 0.0439612902700901, + -0.07205488532781601, + -0.20977485179901123, + -0.2055625021457672, + -0.8882583379745483, + -0.07244822382926941, + 0.09563937038183212, + -0.07666153460741043, + 0.0033561682794243097, + -0.4559871256351471, + 0.08066937327384949, + 0.24053500592708588 + ], + [ + -0.13307124376296997, + -0.042326729744672775, + 0.040500909090042114, + -0.7215739488601685, + 0.08140784502029419, + -0.16152365505695343, + 0.978931725025177, + -0.07894943654537201, + 0.12221676856279373, + -0.12668195366859436, + -0.05192321166396141, + 0.9856858849525452, + 0.02705325186252594, + 0.3189965784549713, + -0.4038747549057007, + -0.24782444536685944, + 0.037708934396505356, + -0.20973166823387146, + 0.0929059237241745, + -0.466745525598526, + -0.0007588538574054837, + 0.15038476884365082, + -0.03921433910727501, + -0.17249399423599243, + -0.2746153175830841, + -0.0327167771756649, + 0.0569433756172657, + 0.17315183579921722, + -0.07756597548723221, + -0.23182980716228485, + 0.4091942310333252, + 0.32935699820518494 + ], + [ + 0.0010056779719889164, + 0.00017223706527147442, + 0.06751995533704758, + -0.38114452362060547, + -0.13378925621509552, + -0.03133080527186394, + 0.45208296179771423, + 0.40273088216781616, + 0.3384617567062378, + 0.15812502801418304, + -0.0021528275683522224, + 0.7823845148086548, + -0.01818712428212166, + -0.12505991756916046, + -0.11920782178640366, + -0.14382724463939667, + -0.21391405165195465, + 0.0467260517179966, + 0.3490385413169861, + -0.6308271288871765, + -0.05932697281241417, + -0.05205933377146721, + -0.11881677061319351, + -0.06319572776556015, + -0.27183887362480164, + -0.021437175571918488, + 0.07095760852098465, + -0.11136292666196823, + -0.14584526419639587, + -0.16393230855464935, + 0.032976847141981125, + -0.08320535719394684 + ], + [ + 0.023734474554657936, + -0.3168199360370636, + -0.016073793172836304, + -0.9030609726905823, + 0.04119814559817314, + -0.09399380534887314, + 0.9787577390670776, + 0.07024133950471878, + -0.023190297186374664, + -0.04113855957984924, + 0.08815838396549225, + 0.8052789568901062, + 0.08388077467679977, + 0.5825448632240295, + -0.22796209156513214, + -0.47085028886795044, + 0.15516626834869385, + -0.6408253312110901, + 0.31798601150512695, + -0.9602464437484741, + -0.008030841127038002, + -0.12295776605606079, + -0.16304311156272888, + -0.1183261051774025, + -0.050125397741794586, + -0.15394653379917145, + -0.3136257529258728, + -0.7199011445045471, + -0.2825005054473877, + -0.2750853896141052, + -0.020170260220766068, + 0.40137961506843567 + ] + ] + ] + ], + [ + -0.554452657699585, + 0.4535163640975952, + 1.3920046091079712, + 2.6810762882232666, + 1.898964285850525, + -0.9576305150985718, + -1.7349952459335327, + 0.1820012629032135, + 1.172502040863037, + 1.1686756610870361, + -0.4753027558326721, + -1.7965710163116455, + 1.2578811645507812, + 0.9688960909843445, + 1.7270870208740234, + -1.071925401687622, + 1.1399062871932983, + -1.5433635711669922, + -2.4327049255371094, + -0.3190879225730896, + -1.5639928579330444, + 1.304421067237854, + -1.0481361150741577, + 0.9942411184310913, + -2.2074806690216064, + 1.6903067827224731, + -0.036115214228630066, + -0.4054082930088043, + 0.6927939057350159, + -2.1582422256469727, + -0.9612119197845459, + 0.5788724422454834 + ] + ] + } + ] +} \ No newline at end of file diff --git a/JammLab/Resources/BasicPitchModel/cnn_onset_2_model.json b/JammLab/Resources/BasicPitchModel/cnn_onset_2_model.json new file mode 100644 index 0000000..4a73763 --- /dev/null +++ b/JammLab/Resources/BasicPitchModel/cnn_onset_2_model.json @@ -0,0 +1,950 @@ +{ + "in_shape": [ + 1, + null, + 88, + 33 + ], + "layers": [ + { + "type": "conv2d", + "activation": "sigmoid", + "shape": [ + 1, + null, + 88, + 1 + ], + "kernel_size_time": 3, + "kernel_size_feature": 3, + "dilation": 1, + "strides": 1, + "num_filters_in": 33, + "num_features_in": 88, + "num_filters_out": 1, + "padding": "same", + "weights": [ + [ + [ + [ + [ + 0.029619259759783745 + ], + [ + 0.003604025347158313 + ], + [ + 0.03323238715529442 + ], + [ + 0.05663453787565231 + ], + [ + 0.05222143605351448 + ], + [ + 0.003889265237376094 + ], + [ + -0.020436357706785202 + ], + [ + 0.038425836712121964 + ], + [ + -0.03372349590063095 + ], + [ + 0.033551692962646484 + ], + [ + 0.0019456845475360751 + ], + [ + -0.004042146727442741 + ], + [ + -0.00012680985673796386 + ], + [ + -0.028087103739380836 + ], + [ + -0.039181750267744064 + ], + [ + -0.09790737926959991 + ], + [ + 0.030161600559949875 + ], + [ + 0.0161209087818861 + ], + [ + 0.05954240635037422 + ], + [ + -0.002274606842547655 + ], + [ + 0.03084123693406582 + ], + [ + 0.05161402374505997 + ], + [ + -0.019394416362047195 + ], + [ + 0.05399709939956665 + ], + [ + -0.019747303798794746 + ], + [ + -0.01198793575167656 + ], + [ + 0.009352544322609901 + ], + [ + -0.014560949057340622 + ], + [ + -0.016378868371248245 + ], + [ + -0.0584833025932312 + ], + [ + -0.07535823434591293 + ], + [ + 0.025234626606106758 + ], + [ + -0.01423961017280817 + ] + ], + [ + [ + 0.24009527266025543 + ], + [ + -0.02748076431453228 + ], + [ + 0.02732815034687519 + ], + [ + 0.07360173016786575 + ], + [ + -0.02111572027206421 + ], + [ + -0.07726837694644928 + ], + [ + -0.015140729025006294 + ], + [ + 0.04621383175253868 + ], + [ + -0.021509911864995956 + ], + [ + -0.04217614233493805 + ], + [ + -0.02931121177971363 + ], + [ + -0.013163563795387745 + ], + [ + -0.02090492472052574 + ], + [ + -0.04976015165448189 + ], + [ + 0.047729115933179855 + ], + [ + 0.012330548837780952 + ], + [ + -0.01831592619419098 + ], + [ + -0.05505986511707306 + ], + [ + 0.008266164921224117 + ], + [ + -0.019050801172852516 + ], + [ + -0.01697925291955471 + ], + [ + 0.0893247127532959 + ], + [ + -0.05563950538635254 + ], + [ + 0.0288397204130888 + ], + [ + -0.031366221606731415 + ], + [ + -0.10060587525367737 + ], + [ + -0.015078275464475155 + ], + [ + -0.018237916752696037 + ], + [ + 0.02393556572496891 + ], + [ + -0.039543215185403824 + ], + [ + 0.07984033972024918 + ], + [ + 0.011052779853343964 + ], + [ + -0.013022289611399174 + ] + ], + [ + [ + 0.018380844965577126 + ], + [ + -0.007653142791241407 + ], + [ + 0.03213290125131607 + ], + [ + 0.026461543515324593 + ], + [ + -0.0006714844494126737 + ], + [ + 0.005802706349641085 + ], + [ + 0.012416264973580837 + ], + [ + 0.02380133792757988 + ], + [ + -0.0084803132340312 + ], + [ + 0.010892920196056366 + ], + [ + 0.0058015636168420315 + ], + [ + -0.0032008958514779806 + ], + [ + 0.004013776779174805 + ], + [ + -0.014109397307038307 + ], + [ + 0.007791736163198948 + ], + [ + 0.009723225608468056 + ], + [ + 0.03575237840414047 + ], + [ + -0.0061295656487345695 + ], + [ + 0.045220863074064255 + ], + [ + -0.010183257982134819 + ], + [ + 0.009707151912152767 + ], + [ + -0.04111291095614433 + ], + [ + 0.0018075773259624839 + ], + [ + -0.03114478476345539 + ], + [ + -0.010931422933936119 + ], + [ + -0.020219091325998306 + ], + [ + 0.003832712071016431 + ], + [ + -0.017476486042141914 + ], + [ + 0.003982656169682741 + ], + [ + -0.01458861492574215 + ], + [ + 0.018215728923678398 + ], + [ + 0.01276887021958828 + ], + [ + -0.005162898916751146 + ] + ] + ], + [ + [ + [ + 0.022289156913757324 + ], + [ + 0.009230717085301876 + ], + [ + 0.03402344882488251 + ], + [ + 0.03692690283060074 + ], + [ + 0.08948439359664917 + ], + [ + 0.002459646202623844 + ], + [ + -0.03781338036060333 + ], + [ + -0.006490844301879406 + ], + [ + -0.015260049141943455 + ], + [ + 0.01247861236333847 + ], + [ + -0.03640824928879738 + ], + [ + -0.014480463229119778 + ], + [ + 0.04469229280948639 + ], + [ + -0.020555801689624786 + ], + [ + -0.03453211113810539 + ], + [ + -0.12208610028028488 + ], + [ + 0.01859663426876068 + ], + [ + -0.0008554028463549912 + ], + [ + 0.024995025247335434 + ], + [ + 0.012742570601403713 + ], + [ + 0.026150943711400032 + ], + [ + 0.04375866800546646 + ], + [ + -0.023449353873729706 + ], + [ + 0.00915711559355259 + ], + [ + -0.029468020424246788 + ], + [ + 0.05862440541386604 + ], + [ + -0.033476442098617554 + ], + [ + -0.035934001207351685 + ], + [ + -0.0036958088167011738 + ], + [ + -0.06678387522697449 + ], + [ + -0.06039731204509735 + ], + [ + 0.04551265016198158 + ], + [ + -0.016840804368257523 + ] + ], + [ + [ + 0.3512360155582428 + ], + [ + -0.04112149775028229 + ], + [ + 0.038147471845149994 + ], + [ + 0.043540023267269135 + ], + [ + -0.030814578756690025 + ], + [ + -0.11488520354032516 + ], + [ + -0.029034191742539406 + ], + [ + -0.013081854209303856 + ], + [ + -0.018614543601870537 + ], + [ + -0.06757228821516037 + ], + [ + -0.07493409514427185 + ], + [ + -0.02262847125530243 + ], + [ + 0.034807994961738586 + ], + [ + -0.06775157153606415 + ], + [ + 0.0709703266620636 + ], + [ + 0.010524180717766285 + ], + [ + -0.045610733330249786 + ], + [ + -0.07149282097816467 + ], + [ + 0.039878807961940765 + ], + [ + -0.0699450746178627 + ], + [ + -0.03218328207731247 + ], + [ + 0.0830877423286438 + ], + [ + -0.08588273078203201 + ], + [ + 0.04950792342424393 + ], + [ + -0.057015273720026016 + ], + [ + -0.1511801779270172 + ], + [ + -0.0691324770450592 + ], + [ + 0.013735144399106503 + ], + [ + 0.05962655320763588 + ], + [ + -0.034871216863393784 + ], + [ + 0.09287749230861664 + ], + [ + -0.0013269360642880201 + ], + [ + -0.03361208364367485 + ] + ], + [ + [ + -0.005243861116468906 + ], + [ + -0.014836051501333714 + ], + [ + 0.02640514262020588 + ], + [ + 0.02256111614406109 + ], + [ + -0.01601363532245159 + ], + [ + -0.01260481495410204 + ], + [ + 0.007468162104487419 + ], + [ + -0.000842115783598274 + ], + [ + -0.0010021697962656617 + ], + [ + 0.0014673923142254353 + ], + [ + -0.0031402953900396824 + ], + [ + -0.008550249971449375 + ], + [ + 0.013305878266692162 + ], + [ + -0.01920526847243309 + ], + [ + 0.0039015624206513166 + ], + [ + 0.002652887487784028 + ], + [ + 0.01773177832365036 + ], + [ + -0.013012228533625603 + ], + [ + 0.07562827318906784 + ], + [ + -0.019170274958014488 + ], + [ + 0.002964319195598364 + ], + [ + -0.041819535195827484 + ], + [ + -0.016641737893223763 + ], + [ + -0.03315851092338562 + ], + [ + -0.022573471069335938 + ], + [ + 0.02500460483133793 + ], + [ + -0.037567391991615295 + ], + [ + -0.002052377676591277 + ], + [ + 0.003923674114048481 + ], + [ + 0.0012632987927645445 + ], + [ + -0.0037196415942162275 + ], + [ + 0.029904864728450775 + ], + [ + -0.014024658128619194 + ] + ] + ], + [ + [ + [ + 0.03644957020878792 + ], + [ + 0.011588278226554394 + ], + [ + 0.02604282833635807 + ], + [ + 0.047486867755651474 + ], + [ + 0.130997896194458 + ], + [ + 0.023185662925243378 + ], + [ + -0.032108452171087265 + ], + [ + 0.051327183842659 + ], + [ + -0.017049312591552734 + ], + [ + -0.004583831410855055 + ], + [ + -0.032389044761657715 + ], + [ + -0.014481105841696262 + ], + [ + 0.1134050041437149 + ], + [ + 0.005636401940137148 + ], + [ + -0.027646219357848167 + ], + [ + -0.13573560118675232 + ], + [ + 0.011916090734302998 + ], + [ + -0.004351395647972822 + ], + [ + -0.009844012558460236 + ], + [ + 0.11543305218219757 + ], + [ + 0.021071655675768852 + ], + [ + -0.0002149916981579736 + ], + [ + 0.01237348560243845 + ], + [ + -0.015897467732429504 + ], + [ + -0.013315209187567234 + ], + [ + 0.10449302941560745 + ], + [ + -0.011237037368118763 + ], + [ + -0.04261191934347153 + ], + [ + -0.013800514861941338 + ], + [ + -0.037860993295907974 + ], + [ + -0.08314038068056107 + ], + [ + 0.07072032243013382 + ], + [ + -0.01573692262172699 + ] + ], + [ + [ + 0.452563613653183 + ], + [ + -0.036972686648368835 + ], + [ + 0.02156221494078636 + ], + [ + 0.03551863878965378 + ], + [ + -0.012486271560192108 + ], + [ + -0.12194753438234329 + ], + [ + -0.026304038241505623 + ], + [ + -0.06839510798454285 + ], + [ + -0.059574853628873825 + ], + [ + -0.07624702900648117 + ], + [ + -0.0464610792696476 + ], + [ + -0.02215738035738468 + ], + [ + 0.08859449625015259 + ], + [ + -0.050749946385622025 + ], + [ + 0.09414441883563995 + ], + [ + 0.026809005066752434 + ], + [ + -0.03952755406498909 + ], + [ + -0.06784122437238693 + ], + [ + 0.0631866529583931 + ], + [ + -0.09937144070863724 + ], + [ + -0.048646215349435806 + ], + [ + 0.05033298581838608 + ], + [ + -0.08980566263198853 + ], + [ + 0.11568523943424225 + ], + [ + -0.04850824549794197 + ], + [ + -0.23008699715137482 + ], + [ + -0.04406071826815605 + ], + [ + 0.035207122564315796 + ], + [ + 0.07972811162471771 + ], + [ + -0.011156006716191769 + ], + [ + 0.1132323294878006 + ], + [ + 0.006361722480505705 + ], + [ + -0.047375332564115524 + ] + ], + [ + [ + -0.004354607779532671 + ], + [ + -0.011762904934585094 + ], + [ + 0.01206930074840784 + ], + [ + 0.040622856467962265 + ], + [ + 0.0021851765923202038 + ], + [ + 0.006867991294711828 + ], + [ + 0.00498944241553545 + ], + [ + -0.01438653003424406 + ], + [ + 0.003170289099216461 + ], + [ + 0.003983920905739069 + ], + [ + 0.016393963247537613 + ], + [ + -0.008108914829790592 + ], + [ + 0.02757560834288597 + ], + [ + -0.0003816672833636403 + ], + [ + 0.013246352784335613 + ], + [ + 0.011240650899708271 + ], + [ + 0.015601377934217453 + ], + [ + -0.0069315871223807335 + ], + [ + 0.07104633748531342 + ], + [ + -0.0356980636715889 + ], + [ + -0.009930310770869255 + ], + [ + -0.04277143254876137 + ], + [ + -0.004996682517230511 + ], + [ + -0.023285720497369766 + ], + [ + 0.004121796227991581 + ], + [ + 0.07024645060300827 + ], + [ + -0.018844574689865112 + ], + [ + 0.009226424619555473 + ], + [ + 0.009908956475555897 + ], + [ + 0.030665036290884018 + ], + [ + -0.05489335209131241 + ], + [ + 0.018782397732138634 + ], + [ + -0.020496457815170288 + ] + ] + ] + ], + [ + -0.36014845967292786 + ] + ] + } + ] +} \ No newline at end of file diff --git a/JammLab/Resources/BasicPitchModel/features_model.ort b/JammLab/Resources/BasicPitchModel/features_model.ort new file mode 100644 index 0000000..3fcd20d Binary files /dev/null and b/JammLab/Resources/BasicPitchModel/features_model.ort differ diff --git a/JammLab/Resources/ThirdPartyNotices/BasicPitch-LICENSE.txt b/JammLab/Resources/ThirdPartyNotices/BasicPitch-LICENSE.txt new file mode 100644 index 0000000..dc22a73 --- /dev/null +++ b/JammLab/Resources/ThirdPartyNotices/BasicPitch-LICENSE.txt @@ -0,0 +1,203 @@ +Copyright 2022 Spotify AB + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/JammLab/Resources/ThirdPartyNotices/BasicPitch-NOTICE.txt b/JammLab/Resources/ThirdPartyNotices/BasicPitch-NOTICE.txt new file mode 100644 index 0000000..7b08b10 --- /dev/null +++ b/JammLab/Resources/ThirdPartyNotices/BasicPitch-NOTICE.txt @@ -0,0 +1,31 @@ +Basic Pitch +Copyright 2022 Spotify AB + +This product includes software developed at +Spotify AB (http://www.spotify.com/). + +This product includes software from Librosa (ISC). +* Copyright (C) 2013--2017, librosa development team. + +This product includes software from mir_eval (MIT) +* Copyright (C) 2014 Colin Raffel + +This product includes software from numpy (BSD) +* Copyright (C) 2005-2022, NumPy Developers. + +This product includes software from pretty-midi (MIT) +* Copyright (C) 2014 Colin Raffel + +This product includes software from resampy (ISC) +* Copyright (C) 2016, Brian McFee + +This product includes software from scipy (BSD) +* Copyright (C) 2001-2002 Enthought, Inc. 2003-2022, SciPy Developers + +This product includes software from tensorflow (Apache 2.0) +* Copyright (C) 2019 Google, LLC + +The tests for `basic-pitch` include audio files from the +Vocadito dataset liscened under Creative Commons +Attribution 4.0 International. The dataset can be found at: +https://zenodo.org/record/5578807#.YnRm5vPMKDU diff --git a/JammLab/Resources/ThirdPartyNotices/NeuralNote-LICENSE.txt b/JammLab/Resources/ThirdPartyNotices/NeuralNote-LICENSE.txt new file mode 100644 index 0000000..43c7fc7 --- /dev/null +++ b/JammLab/Resources/ThirdPartyNotices/NeuralNote-LICENSE.txt @@ -0,0 +1,203 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Copyright 2024 Damien Ronssin \ No newline at end of file diff --git a/JammLab/Resources/ThirdPartyNotices/ONNXRuntime-LICENSE.txt b/JammLab/Resources/ThirdPartyNotices/ONNXRuntime-LICENSE.txt new file mode 100644 index 0000000..48bc6bb --- /dev/null +++ b/JammLab/Resources/ThirdPartyNotices/ONNXRuntime-LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/JammLab/Resources/ThirdPartyNotices/ONNXRuntime-ThirdPartyNotices.txt b/JammLab/Resources/ThirdPartyNotices/ONNXRuntime-ThirdPartyNotices.txt new file mode 100644 index 0000000..e925f75 --- /dev/null +++ b/JammLab/Resources/ThirdPartyNotices/ONNXRuntime-ThirdPartyNotices.txt @@ -0,0 +1,5786 @@ +THIRD PARTY SOFTWARE NOTICES AND INFORMATION + +Do Not Translate or Localize + +This software incorporates material from third parties. Microsoft makes certain +open source code available at http://3rdpartysource.microsoft.com, or you may +send a check or money order for US $5.00, including the product name, the open +source component name, and version number, to: + +Source Code Compliance Team +Microsoft Corporation +One Microsoft Way +Redmond, WA 98052 +USA + +Notwithstanding any other terms, you may reverse engineer this software to the +extent required to debug changes to any libraries licensed under the GNU Lesser +General Public License. + +_____ + +Intel Math Kernel Library (Intel MKL) + +Intel Simplified Software License (Version April 2018) + +Copyright (c) 2018 Intel Corporation. + +Use and Redistribution. You may use and redistribute the software (the ā€œSoftwareā€), without modification, +provided the following conditions are met: + +* Redistributions must reproduce the above copyright notice and the following terms of use in the Software +and in the documentation and/or other materials provided with the distribution. + +* Neither the name of Intel nor the names of its suppliers may be used to endorse or promote products +derived from this Software without specific prior written permission. + +* No reverse engineering, decompilation, or disassembly of this Software is permitted. + +Limited patent license. Intel grants you a world-wide, royalty-free, non-exclusive license under patents it now +or hereafter owns or controls to make, have made, use, import, offer to sell and sell (ā€œUtilizeā€) this Software, +but solely to the extent that any such patent is necessary to Utilize the Software alone. The patent license +shall not apply to any combinations which include this software. No hardware per se is licensed hereunder. + +Third party and other Intel programs. ā€œThird Party Programsā€ are the files listed in the ā€œthird-party-programs.txtā€ +text file that is included with the Software and may include Intel programs under separate license terms. +Third Party Programs, even if included with the distribution of the Materials, are governed by +separate license terms and those license terms solely govern your use of those programs. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. THIS SOFTWARE IS +NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS WHERE FAILURE OF THE SOFTWARE +MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE THAT YOU ARE FULLY RESPONSIBLE FOR ANY +CLAIMS, COSTS, DAMAGES, EXPENSES, AND ATTORNEYS’ FEES ARISING OUT OF ANY SUCH USE, +EVEN IF ANY CLAIM ALLEGES THAT INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF +THE MATERIALS. + +LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL 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. YOU AGREE TO INDEMNIFY AND HOLD INTEL HARMLESS AGAINST ANY CLAIMS +AND EXPENSES RESULTING FROM YOUR USE OR UNAUTHORIZED USE OF THE SOFTWARE. + +No support. Intel may make changes to the Software, at any time without notice, and is not obligated to +support, update or provide training for the Software. + +Termination. Intel may terminate your right to use the Software in the event of your breach of this Agreement +and you fail to cure the breach within a reasonable period of time. + +Feedback. Should you provide Intel with comments, modifications, corrections, enhancements or other input +(ā€œFeedbackā€) related to the Software Intel will be free to use, disclose, reproduce, license or otherwise +distribute or exploit the Feedback in its sole discretion without any obligations or restrictions of any kind, +including without limitation, intellectual property rights or licensing obligations. + +Compliance with laws. You agree to comply with all relevant laws and regulations governing your use, +transfer, import or export (or prohibition thereof) of the Software. + +Governing law. All disputes will be governed by the laws of the United States of America and the State of +Delaware without reference to conflict of law principles and subject to the exclusive jurisdiction of the state or +federal courts sitting in the State of Delaware, and each party agrees that it submits to the personal +jurisdiction and venue of those courts and waives any objections. The United Nations Convention on +Contracts for the International Sale of Goods (1980) is specifically excluded and will not apply to the +Software. + +*Other names and brands may be claimed as the property of others. + +_____ + +protocolbuffers/protobuf + +Copyright 2008 Google Inc. All rights reserved. + +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. + + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +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. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + +_____ + +madler/zlib + +The deflate format used by zlib was defined by Phil Katz. The deflate and +zlib specifications were written by L. Peter Deutsch. Thanks to all the +people who reported problems and suggested various improvements in zlib; they +are too numerous to cite here. + +Copyright notice: + + (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* receiving +lengthy legal documents to sign. The sources are provided for free but without +warranty of any kind. The library has been entirely written by Jean-loup +Gailly and Mark Adler; it does not include third-party code. + +If you redistribute modified sources, we would appreciate that you include in +the file ChangeLog history information documenting your changes. Please read +the FAQ for more information on the distribution of modified source versions. + +_____ + +pybind/pybind11 + +Copyright (c) 2016 Wenzel Jakob , All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +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 HOLDER 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. + +Please also refer to the file CONTRIBUTING.md, which clarifies licensing of +external contributions to this project including patches, pull requests, etc. + +_____ + +onnx +Open Neural Network Exchange + +Copyright (c) Facebook, Inc. and Microsoft Corporation. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +_____ + +Eigen + +MPL v2.0 +Mozilla Public License Version 2.0 + + +================================== + +1. Definitions + +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions + +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities + +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination + +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + +_____ + +intel/dnnl + +Copyright 2016-2018 Intel Corporation + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +sub-components: + +xbyak + +Copyright (c) 2007 MITSUNARI Shigeo. All rights reserved. + +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. +Neither the name of the copyright owner nor the names of its contributors may +be used to endorse or promote products derived from this software without +specific prior written permission. + +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. + +_____ + +Microsoft GSL + +Copyright (c) 2015 Microsoft Corporation. All rights reserved. + +This code is licensed under the MIT License (MIT). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +_____ + +Tensorflow + +Copyright 2018 The TensorFlow Authors. All rights reserved. + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017, The TensorFlow Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +_____ + +Microsoft Cognitive Toolkit (CNTK) + +Copyright (c) Microsoft Corporation. All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +_____ + +NumPy License + +Copyright (c) 2005, NumPy Developers + +All rights reserved. + +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. + Neither the name of the NumPy Developers nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +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. + +_____ + +Pytorch / Caffe2 + +From PyTorch: + +Copyright (c) 2016- Facebook, Inc (Adam Paszke) +Copyright (c) 2014- Facebook, Inc (Soumith Chintala) +Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) +Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) +Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) +Copyright (c) 2011-2013 NYU (Clement Farabet) +Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) +Copyright (c) 2006 Idiap Research Institute (Samy Bengio) +Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) + +From Caffe2: + +Copyright (c) 2016-present, Facebook Inc. All rights reserved. + +All contributions by Facebook: +Copyright (c) 2016 Facebook Inc. + +All contributions by Google: +Copyright (c) 2015 Google Inc. +All rights reserved. + +All contributions by Yangqing Jia: +Copyright (c) 2015 Yangqing Jia +All rights reserved. + +All contributions from Caffe: +Copyright(c) 2013, 2014, 2015, the respective contributors +All rights reserved. + +All other contributions: +Copyright(c) 2015, 2016 the respective contributors +All rights reserved. + +Caffe2 uses a copyright model similar to Caffe: each contributor holds +copyright over their contributions to Caffe2. The project versioning records +all such contribution and copyright details. If a contributor wants to further +mark their specific copyright on a particular contribution, they should +indicate their copyright solely in the commit message of the change when it is +committed. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories America + and IDIAP Research Institute nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +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. + +_____ + +Caffe + +COPYRIGHT + +All contributions by the University of California: +Copyright (c) 2014-2017 The Regents of the University of California (Regents) +All rights reserved. + +All other contributions: +Copyright (c) 2014-2017, the respective contributors +All rights reserved. + +Caffe uses a shared copyright model: each contributor holds copyright over +their contributions to Caffe. The project versioning records all such +contribution and copyright details. If a contributor wants to further mark +their specific copyright on a particular contribution, they should indicate +their copyright solely in the commit message of the change when it is +committed. + +LICENSE + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. 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. + +CONTRIBUTION AGREEMENT + +By contributing to the BVLC/caffe repository through pull-request, comment, +or otherwise, the contributor releases their content to the +license and copyright terms herein. + +_____ + +The LLVM Compiler Infrastructure + +============================================================================== +LLVM Release License +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== +Copyrights and Licenses for Third Party Software Distributed with LLVM: +============================================================================== +The LLVM software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the LLVM Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + +The following pieces of software have additional or alternate copyrights, +licenses, and/or restrictions: + +Program Directory +------- --------- +Google Test llvm/utils/unittest/googletest +OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} +pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} +ARM contributions llvm/lib/Target/ARM/LICENSE.TXT +md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h + +_____ + +google/benchmark + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +CONTRIBUTORS + +# People who have agreed to one of the CLAs and can contribute patches. +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees are listed here +# but not in AUTHORS, because Google holds the copyright. +# +# Names should be added to this file only after verifying that +# the individual or the individual's organization has agreed to +# the appropriate Contributor License Agreement, found here: +# +# https://developers.google.com/open-source/cla/individual +# https://developers.google.com/open-source/cla/corporate +# +# The agreement for individuals can be filled out on the web. +# +# When adding J Random Contributor's name to this file, +# either J's name or J's organization's name should be +# added to the AUTHORS file, depending on whether the +# individual or corporate CLA was used. +# +# Names should be added to this file as: +# Name +# +# Please keep the list sorted. + +Albert Pretorius +Arne Beer +Billy Robert O'Neal III +Chris Kennelly +Christopher Seymour +David Coeurjolly +Deniz Evrenci +Dominic Hamon +Dominik Czarnota +Eric Fiselier +Eugene Zhuk +Evgeny Safronov +Federico Ficarelli +Felix Homann +Ismael Jimenez Martinez +Jern-Kuan Leong +JianXiong Zhou +Joao Paulo Magalhaes +John Millikin +Jussi Knuuttila +Kai Wolf +Kishan Kumar +Kaito Udagawa +Lei Xu +Matt Clarkson +Maxim Vafin +Nick Hutchinson +Oleksandr Sochka +Pascal Leroy +Paul Redmond +Pierre Phaneuf +Radoslav Yovchev +Raul Marin +Ray Glover +Robert Guo +Roman Lebedev +Shuo Chen +Tobias UlvgĆ„rd +Tom Madams +Yixuan Qiu +Yusuke Suzuki +Zbigniew Skowron + +AUTHORS + +# This is the official list of benchmark authors for copyright purposes. +# This file is distinct from the CONTRIBUTORS files. +# See the latter for an explanation. +# +# Names should be added to this file as: +# Name or Organization +# The email address is not required for organizations. +# +# Please keep the list sorted. + +Albert Pretorius +Arne Beer +Carto +Christopher Seymour +David Coeurjolly +Deniz Evrenci +Dirac Research +Dominik Czarnota +Eric Fiselier +Eugene Zhuk +Evgeny Safronov +Federico Ficarelli +Felix Homann +Google Inc. +International Business Machines Corporation +Ismael Jimenez Martinez +Jern-Kuan Leong +JianXiong Zhou +Joao Paulo Magalhaes +Jussi Knuuttila +Kaito Udagawa +Kishan Kumar +Lei Xu +Matt Clarkson +Maxim Vafin +MongoDB Inc. +Nick Hutchinson +Oleksandr Sochka +Paul Redmond +Radoslav Yovchev +Roman Lebedev +Shuo Chen +Steinar H. Gunderson +Stripe, Inc. +Yixuan Qiu +Yusuke Suzuki +Zbigniew Skowron + +_____ + +HalidelR + +Copyright (c) 2016 HalideIR contributors +Copyright (c) 2012-2014 MIT CSAIL, Google Inc., and other contributors +HalideIR is derived from the Halide project. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +_____ + +Distributed Machine Learning Common Codebase + +Copyright (c) 2015 by Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +_____ + +DLPack: Open In Memory Tensor Structure + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017 by Contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +_____ + +HowardHinnant/date + +The source code in this project is released using the MIT License. There is no +global license for the project because each file is licensed individually with +different author names and/or dates. + +If you contribute to this project, please add your name to the license of each +file you modify. If you have already contributed to this project and forgot to +add your name to the license, please feel free to submit a new P/R to add your +name to the license in each file you modified. + +For convenience, here is a copy of the MIT license found in each file except +without author names or dates: + +The MIT License (MIT) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +_____ + +TVM Open Deep Learning Compiler Stack + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +CONTRIBUTORS + +TVM Contributors +================ +TVM adopts the Apache style model and governs by merit. We believe that it is important to create an inclusive community where everyone can use, +contribute to, and influence the direction of the project. We actively invite contributors who have earned the merit to be part of the development community. + +See the [community structure document](http://docs.tvm.ai/contribute/community.html) for the explanation of community structure and contribution guidelines. + +## Committers +- [Tianqi Chen](https://github.com/tqchen) (PMC) +- [Thierry Moreau](http://homes.cs.washington.edu/~moreau/) +- [Ziheng Jiang](https://github.com/ZihengJiang) +- [Haichen Shen](http://homes.cs.washington.edu/~haichen/) +- [Yizhi Liu](https://github.com/yzhliu) + +## Code Owners +- [Aditya Atluri](https://github.com/adityaatluri) ROCM +- [Leyuan Wang](https://github.com/Laurawly) TOPI +- [Yuwei Hu](https://github.com/Huyuwei) TOPI +- [Zhixun Tan](https://github.com/phisiart) OpenGL/WebGL backend +- [Nick Hynes](https://github.com/nhynes) SGX and secured computing +- [Lianmin Zheng](https://github.com/merrymercy) AutoTVM + +## Reviewers +- [Zhi Chen](https://github.com/zhiics) +- [Xiaoqiang Dan](https://github.com/xqdan) +- [Liangfu Chen](https://github.com/liangfu) +- [Masahiro Masuda](https://github.com/masahi) +- [Kazutaka Morita](https://github.com/kazum) +- [Tatsuya Nishiyama](https://github.com/nishi-t) +- [Pariksheet Pinjari](https://github.com/PariksheetPinjari909) +- [Jared Roesch](https://github.com/jroesch) +- [Siva](https://github.com/srkreddy1238) +- [Siju Samuel](https://github.com/siju-samuel) +- [Alex Weaver](https://github.com/alex-weaver) +- [Yao Wang](https://github.com/kevinthesun) +- [Jian Weng](https://github.com/were) +- [Eddie Yan](https://github.com/eqy) +- [Joshua Z. Zhang](https://github.com/zhreshold) + +## List of Contributors +- [Full List of Contributors](https://github.com/dmlc/tvm/graphs/contributors) + - To contributors: please add your name to the list. +- [Qiao Zhang](https://github.com/zhangqiaorjc) +- [Haolong Zhang](https://github.com/haolongzhangm) +- [Cody Hao Yu](https://github.com/comaniac) +- [Chris Nuernberger](https://github.com/cnuernber) + +_____ + +FreeBSD: getopt.c file + +Copyright (c) 1987, 1993, 1994 +The Regents of the University of California. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the University nor the names of its contributors +may be used to endorse or promote products derived from this software +without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. +_____ + + +google/googletest + +Copyright 2008, Google Inc. +All rights reserved. + +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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +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. + +_____ + +G3log : Asynchronous logger with Dynamic Sinks + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to +_____ + +Scikit-learn + +Copyright (c) 2007–2018 The scikit-learn developers. +All rights reserved. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + a. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + b. 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. + c. Neither the name of the Scikit-learn Developers nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + +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 REGENTS 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. + +_____ + +google/nsync + +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +_____ + +google/re2 + +Copyright (c) 2009 The RE2 Authors. All rights reserved. + +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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +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. +_____ +onnx/onnx-tensorrt + +MIT License + +Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. +Copyright (c) 2018 Open Neural Network Exchange + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +_____ +nvidia/cutlass + +Copyright (c) 2017 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +SPDX-License-Identifier: BSD-3-Clause + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +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 HOLDER 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. + +_____ +Boost + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + +_____ + +JDAI-CV/DNNLibrary + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2019] [JD.com Inc. JD AI] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +_____ + +google/flatbuffers + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +_____ + +google/glog + +Copyright (c) 2008, Google Inc. +All rights reserved. + +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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +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. + + +A function gettimeofday in utilities.cc is based on + +http://www.google.com/codesearch/p?hl=en#dR3YEbitojA/COPYING&q=GetSystemTimeAsFileTime%20license:bsd + +The license of this code is: + +Copyright (c) 2003-2008, Jouni Malinen and contributors +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name(s) of the above-listed copyright holder(s) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +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. + +_____ + +abseil-cpp +https://github.com/abseil/abseil-cpp + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +_____ + +microsoft/wil + +MIT License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE + +_____ + +nlohmann/json + +MIT License + +Copyright (c) 2013-2019 Niels Lohmann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +_____ + +dcleblanc/SafeInt + +MIT License + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +_____ +Open MPI + +3-Clause BSD License + +Most files in this release are marked with the copyrights of the +organizations who have edited them. The copyrights below are in no +particular order and generally reflect members of the Open MPI core +team who have contributed code to this release. The copyrights for +code used under license from other parties are included in the +corresponding files. + +Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana + University Research and Technology + Corporation. All rights reserved. +Copyright (c) 2004-2017 The University of Tennessee and The University + of Tennessee Research Foundation. All rights + reserved. +Copyright (c) 2004-2010 High Performance Computing Center Stuttgart, + University of Stuttgart. All rights reserved. +Copyright (c) 2004-2008 The Regents of the University of California. + All rights reserved. +Copyright (c) 2006-2017 Los Alamos National Security, LLC. All rights + reserved. +Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved. +Copyright (c) 2006-2010 Voltaire, Inc. All rights reserved. +Copyright (c) 2006-2017 Sandia National Laboratories. All rights reserved. +Copyright (c) 2006-2010 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. +Copyright (c) 2006-2017 The University of Houston. All rights reserved. +Copyright (c) 2006-2009 Myricom, Inc. All rights reserved. +Copyright (c) 2007-2017 UT-Battelle, LLC. All rights reserved. +Copyright (c) 2007-2017 IBM Corporation. All rights reserved. +Copyright (c) 1998-2005 Forschungszentrum Juelich, Juelich Supercomputing + Centre, Federal Republic of Germany +Copyright (c) 2005-2008 ZIH, TU Dresden, Federal Republic of Germany +Copyright (c) 2007 Evergrid, Inc. All rights reserved. +Copyright (c) 2008 Chelsio, Inc. All rights reserved. +Copyright (c) 2008-2009 Institut National de Recherche en + Informatique. All rights reserved. +Copyright (c) 2007 Lawrence Livermore National Security, LLC. + All rights reserved. +Copyright (c) 2007-2017 Mellanox Technologies. All rights reserved. +Copyright (c) 2006-2010 QLogic Corporation. All rights reserved. +Copyright (c) 2008-2017 Oak Ridge National Labs. All rights reserved. +Copyright (c) 2006-2012 Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2009-2015 Bull SAS. All rights reserved. +Copyright (c) 2010 ARM ltd. All rights reserved. +Copyright (c) 2016 ARM, Inc. All rights reserved. +Copyright (c) 2010-2011 Alex Brick . All rights reserved. +Copyright (c) 2012 The University of Wisconsin-La Crosse. All rights + reserved. +Copyright (c) 2013-2016 Intel, Inc. All rights reserved. +Copyright (c) 2011-2017 NVIDIA Corporation. All rights reserved. +Copyright (c) 2016 Broadcom Limited. All rights reserved. +Copyright (c) 2011-2017 Fujitsu Limited. All rights reserved. +Copyright (c) 2014-2015 Hewlett-Packard Development Company, LP. All + rights reserved. +Copyright (c) 2013-2017 Research Organization for Information Science (RIST). + All rights reserved. +Copyright (c) 2017-2018 Amazon.com, Inc. or its affiliates. All Rights + reserved. +Copyright (c) 2018 DataDirect Networks. All rights reserved. +Copyright (c) 2018-2019 Triad National Security, LLC. All rights reserved. + +$COPYRIGHT$ + +Additional copyrights may follow + +$HEADER$ + +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 listed + in this license in the documentation and/or other materials + provided with the distribution. + +- Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +The copyright holders provide no reassurances that the source code +provided does not infringe any patent, copyright, or any other +intellectual property rights of third parties. The copyright holders +disclaim any liability to any recipient for claims brought against +recipient by any third party for infringement of that parties +intellectual property rights. + +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. + +_____ + +The Android Open Source Project + +Copyright (C) 2017 The Android Open Source Project +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +------ + +libprotobuf-mutator + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ----- + + openucx/ucx + https://github.com/openucx/ucx + + Copyright (c) 2014-2015 UT-Battelle, LLC. All rights reserved. + Copyright (C) 2014-2020 Mellanox Technologies Ltd. All rights reserved. + Copyright (C) 2014-2015 The University of Houston System. All rights reserved. + Copyright (C) 2015 The University of Tennessee and The University + of Tennessee Research Foundation. All rights reserved. + Copyright (C) 2016-2020 ARM Ltd. All rights reserved. + Copyright (c) 2016 Los Alamos National Security, LLC. All rights reserved. + Copyright (C) 2016-2020 Advanced Micro Devices, Inc. All rights reserved. + Copyright (C) 2019 UChicago Argonne, LLC. All rights reserved. + Copyright (c) 2018-2020 NVIDIA CORPORATION. All rights reserved. + Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + Copyright (C) 2016-2020 Stony Brook University. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. 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. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + 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 + HOLDER 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. + + ----- + + From PyTorch: + + Copyright (c) 2016- Facebook, Inc (Adam Paszke) + Copyright (c) 2014- Facebook, Inc (Soumith Chintala) + Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) + Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) + Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) + Copyright (c) 2011-2013 NYU (Clement Farabet) + Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) + Copyright (c) 2006 Idiap Research Institute (Samy Bengio) + Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) + + From Caffe2: + + Copyright (c) 2016-present, Facebook Inc. All rights reserved. + + All contributions by Facebook: + Copyright (c) 2016 Facebook Inc. + + All contributions by Google: + Copyright (c) 2015 Google Inc. + All rights reserved. + + All contributions by Yangqing Jia: + Copyright (c) 2015 Yangqing Jia + All rights reserved. + + All contributions from Caffe: + Copyright(c) 2013, 2014, 2015, the respective contributors + All rights reserved. + + All other contributions: + Copyright(c) 2015, 2016 the respective contributors + All rights reserved. + + Caffe2 uses a copyright model similar to Caffe: each contributor holds + copyright over their contributions to Caffe2. The project versioning records + all such contribution and copyright details. If a contributor wants to further + mark their specific copyright on a particular contribution, they should + indicate their copyright solely in the commit message of the change when it is + committed. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. 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. + + 3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories America + and IDIAP Research Institute nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + + 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. + +_____ + + mpi4py + https://github.com/mpi4py/mpi4py/ + + ======================= + LICENSE: MPI for Python + ======================= + + :Author: Lisandro Dalcin + :Contact: dalcinl@gmail.com + + + Copyright (c) 2019, Lisandro Dalcin. + All rights reserved. + + 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 HOLDER 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 + HOLDER 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. +_____ +huggingface/transformers + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +_____ +msgpack/msgpack-python + +Copyright (C) 2008-2011 INADA Naoki + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +_____ +lanpa/tensorboardX + +MIT License + +Copyright (c) 2017 Tzu-Wei Huang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +_____ +tensorflow/tensorboard + +Copyright 2017 The TensorFlow Authors. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017, The TensorFlow Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +_____ + +cerberus + +Cerberus is a lightweight and extensible data validation library for Python. + +ISC License + +Copyright (c) 2012-2016 Nicola Iarocci. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +_____ + +MurmurHash3 + +MIT license + +https://github.com/aappleby/smhasher + +SMHasher is a test suite designed to test the distribution, collision, and +performance properties of non-cryptographic hash functions. +This is the home for the MurmurHash family of hash functions along with the +SMHasher test suite used to verify them. +SMHasher is released under the MIT license. +All MurmurHash versions are public domain software, and the author disclaims all copyright to their code. + +_____ + +gtest-ios-framework + +https://github.com/mestevens/gtest-ios-framework + +Copyright (c) 2013 Matthew Stevens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +_____ + +DLPack + +https://github.com/dmlc/dlpack + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017 by Contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +_____ + +emsdk + +MIT/Expat license + +https://github.com/emscripten-core/emsdk + +Copyright (c) 2018 Emscripten authors (see AUTHORS in Emscripten) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +---------------------------------------------------------------------------- + +This is the MIT/Expat Licence. For more information see: + +1. http://www.opensource.org/licenses/mit-license.php + +2. http://en.wikipedia.org/wiki/MIT_License + +_____ + +coremltools + +BSD-3-Clause License + +https://github.com/apple/coremltools + +Copyright (c) 2020, Apple Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +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. +Ā© 2021 GitHub, Inc. + +_____ + +react-native + +MIT License + +https://github.com/facebook/react-native + +Copyright (c) Facebook, Inc. and its affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +_____ + +pytorch/cpuinfo + +BSD 2-Clause "Simplified" License + +https://github.com/pytorch/cpuinfo + +Copyright (c) 2019 Google LLC +Copyright (c) 2017-2018 Facebook Inc. +Copyright (C) 2012-2017 Georgia Institute of Technology +Copyright (C) 2010-2012 Marat Dukhan + +All rights reserved. + +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 HOLDER 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. + +_____ + +SQLite Is Public Domain + +All of the code and documentation in SQLite has been dedicated to the public +domain by the authors. All code authors, and representatives of the companies +they work for, have signed affidavits dedicating their contributions to the +public domain and originals of those signed affidavits are stored in a firesafe +at the main offices of Hwaci. Anyone is free to copy, modify, publish, use, +compile, sell, or distribute the original SQLite code, either in source code +form or as a compiled binary, for any purpose, commercial or non-commercial, +and by any means. + +The previous paragraph applies to the deliverable code and documentation in +SQLite - those parts of the SQLite library that you actually bundle and ship +with a larger application. Some scripts used as part of the build process (for +example the "configure" scripts generated by autoconf) might fall under other +open-source licenses. Nothing from these build scripts ever reaches the final +deliverable SQLite library, however, and so the licenses associated with those +scripts should not be a factor in assessing your rights to copy and use the +SQLite library. + +All of the deliverable code in SQLite has been written from scratch. No code +has been taken from other projects or from the open internet. Every line of +code can be traced back to its original author, and all of those authors have +public domain dedications on file. So the SQLite code base is clean and is +uncontaminated with licensed code from other projects. + +_____ + +google/XNNPACK + +BSD License + +For XNNPACK software + +Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +Copyright 2019 Google LLC + +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. + + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +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 HOLDER 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. + +_____ + +google/sentencepiece, https://github.com/google/sentencepiece +(included when statically linked with onnxruntime-extensions) + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +_____ + +dlfcn-win32/dlfcn-win32 is licensed under the MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +_____ + +The Python Imaging Library (PIL) is + + Copyright Ā© 1997-2011 by Secret Labs AB + Copyright Ā© 1995-2011 by Fredrik Lundh + +Pillow is the friendly PIL fork. It is + + Copyright Ā© 2010-2023 by Alex Clark and contributors + +Like PIL, Pillow is licensed under the open source HPND License: + +By obtaining, using, and/or copying this software and/or its associated +documentation, you agree that you have read, understood, and will comply +with the following terms and conditions: + +Permission to use, copy, modify, and distribute this software and its +associated documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies, and that +both that copyright notice and this permission notice appear in supporting +documentation, and that the name of Secret Labs AB or the author not be +used in advertising or publicity pertaining to distribution of the software +without specific, written prior permission. + +SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL, +INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +_____ + +openssl/openssl, https://github.com/openssl/openssl + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + +_____ + +Tencent/rapidjson, https://github.com/Tencent/rapidjson + +Tencent is pleased to support the open source community by making RapidJSON available. + +Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. + +If you have downloaded a copy of the RapidJSON binary from Tencent, please note that the RapidJSON binary is licensed under the MIT License. +If you have downloaded a copy of the RapidJSON source code from Tencent, please note that RapidJSON source code is licensed under the MIT License, except for the third-party components listed below which are subject to different license terms. Your integration of RapidJSON into your own projects may require compliance with the MIT License, as well as the other licenses applicable to the third-party components included within RapidJSON. To avoid the problematic JSON license in your own projects, it's sufficient to exclude the bin/jsonchecker/ directory, as it's the only code under the JSON license. +A copy of the MIT License is included in this file. + +Other dependencies and licenses: + +Open Source Software Licensed Under the BSD License: +-------------------------------------------------------------------- + +The msinttypes r29 +Copyright (c) 2006-2013 Alexander Chemeris +All rights reserved. + +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. +* Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS AND 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. + +Open Source Software Licensed Under the JSON License: +-------------------------------------------------------------------- + +json.org +Copyright (c) 2002 JSON.org +All Rights Reserved. + +JSON_checker +Copyright (c) 2002 JSON.org +All Rights Reserved. + + +Terms of the JSON License: +--------------------------------------------------- + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +The Software shall be used for Good, not Evil. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Terms of the MIT License: +-------------------------------------------------------------------- + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +_____ + +boostorg/boost, https://github.com/boostorg/boost + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +_____ + +libb64/libb64, https://github.com/libb64/libb64 + +Copyright-Only Dedication (based on United States law) or Public Domain Certification + +The person or persons who have associated work with this document (the "Dedicator" or "Certifier") hereby either (a) certifies that, to the best of his knowledge, the work of authorship identified is in the public domain of the country from which the work is published, or (b) hereby dedicates whatever copyright the dedicators holds in the work of authorship identified below (the "Work") to the public domain. A certifier, moreover, dedicates any copyright interest he may have in the associated work, and for these purposes, is described as a "dedicator" below. + +A certifier has taken reasonable steps to verify the copyright status of this work. Certifier recognizes that his good faith efforts may not shield him from liability if in fact the work certified is not in the public domain. + +Dedicator makes this dedication for the benefit of the public at large and to the detriment of the Dedicator's heirs and successors. Dedicator intends this dedication to be an overt act of relinquishment in perpetuity of all present and future rights under copyright law, whether vested or contingent, in the Work. Dedicator understands that such relinquishment of all rights includes the relinquishment of all rights to enforce (by lawsuit or otherwise) those copyrights in the Work. + +Dedicator recognizes that, once placed in the public domain, the Work may be freely reproduced, distributed, transmitted, used, modified, built upon, or otherwise exploited by anyone for any purpose, commercial or non-commercial, and in any way, including by methods that have not yet been invented or conceived. + +_____ + +posix pthread library, https://sourceforge.net/projects/pthreads4w + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +_____ + +Triton Inference Server & Client, https://github.com/triton-inference-server + +Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. + +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. + * Neither the name of NVIDIA CORPORATION nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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. + +_____ + +microsoft/mimalloc, https://github.com/microsoft/mimalloc + +MIT License + +Copyright (c) 2018-2021 Microsoft Corporation, Daan Leijen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/JammLab/Resources/ThirdPartyNotices/RTNeural-LICENSE.txt b/JammLab/Resources/ThirdPartyNotices/RTNeural-LICENSE.txt new file mode 100644 index 0000000..872610c --- /dev/null +++ b/JammLab/Resources/ThirdPartyNotices/RTNeural-LICENSE.txt @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2020, jatinchowdhury18 +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +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 HOLDER 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. diff --git a/JammLab/Resources/ThirdPartyNotices/nlohmann-json-LICENSE.txt b/JammLab/Resources/ThirdPartyNotices/nlohmann-json-LICENSE.txt new file mode 100644 index 0000000..70c6af6 --- /dev/null +++ b/JammLab/Resources/ThirdPartyNotices/nlohmann-json-LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013-2022 Niels Lohmann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/JammLab/Services/ProjectPersistenceCoordinator.swift b/JammLab/Services/ProjectPersistenceCoordinator.swift index 4a0ba3a..7213617 100644 --- a/JammLab/Services/ProjectPersistenceCoordinator.swift +++ b/JammLab/Services/ProjectPersistenceCoordinator.swift @@ -32,6 +32,7 @@ struct ProjectDocumentSnapshot { let notes: [TimecodedNote] let harmonySymbols: [HarmonySymbol] let notationItems: [NotationMeasureItem] + let stemTranscriptionTracks: [StemTranscriptionTrack] let notationPartClefs: [NotationPartID: Clef] let projectKeySelection: ProjectKeySelection? let loopRegion: LoopRegion @@ -224,6 +225,11 @@ struct ProjectPersistenceCoordinator { duration: snapshot.duration, notationPartClefs: snapshot.notationPartClefs ), + stemTranscriptionTracks: ProjectStateNormalizer.normalizedStemTranscriptionTracks( + snapshot.stemTranscriptionTracks, + duration: snapshot.duration, + notationItems: snapshot.notationItems + ), notationPartClefs: NotationPartClefOverrides.normalized(snapshot.notationPartClefs), projectKeySelection: snapshot.projectKeySelection, loopStart: snapshot.loopRegion.clamped(to: snapshot.duration, minimumLength: snapshot.loopMinimumLength).start, diff --git a/JammLab/Services/StemTranscriptionMIDIExporter.swift b/JammLab/Services/StemTranscriptionMIDIExporter.swift new file mode 100644 index 0000000..ea08a49 --- /dev/null +++ b/JammLab/Services/StemTranscriptionMIDIExporter.swift @@ -0,0 +1,100 @@ +import AppKit +import Foundation +import UniformTypeIdentifiers + +enum StemTranscriptionMIDIExporter { + static func data( + for track: StemTranscriptionTrack, + ticksPerQuarter: UInt16 = 480, + tempoBPM: Double + ) -> Data { + let secondsPerQuarter = 60.0 / max(1, tempoBPM) + let noteEvents = track.notes.flatMap { note -> [(tick: UInt32, bytes: [UInt8])] in + let startTick = UInt32(max(0, (note.projectStartTimeSeconds / secondsPerQuarter + * Double(ticksPerQuarter)).rounded())) + let endTick = UInt32(max( + Double(startTick + 1), + (note.projectEndTimeSeconds / secondsPerQuarter * Double(ticksPerQuarter)).rounded() + )) + let pitch = UInt8(clamping: note.midiPitch) + let velocity = UInt8(clamping: Int((max(0, min(1, note.confidence)) * 127).rounded())) + return [ + (startTick, [0x90, pitch, max(1, velocity)]), + (endTick, [0x80, pitch, 0]) + ] + }.sorted { + if $0.tick != $1.tick { return $0.tick < $1.tick } + return $0.bytes[0] < $1.bytes[0] + } + + var trackBytes: [UInt8] = [] + let microsecondsPerQuarter = UInt32((60_000_000 / max(1, tempoBPM)).rounded()) + trackBytes += [0x00, 0xFF, 0x51, 0x03] + trackBytes += [ + UInt8((microsecondsPerQuarter >> 16) & 0xFF), + UInt8((microsecondsPerQuarter >> 8) & 0xFF), + UInt8(microsecondsPerQuarter & 0xFF) + ] + + var previousTick: UInt32 = 0 + for event in noteEvents { + trackBytes += variableLength(event.tick - previousTick) + trackBytes += event.bytes + previousTick = event.tick + } + trackBytes += [0x00, 0xFF, 0x2F, 0x00] + + var data = Data("MThd".utf8) + data.append(contentsOf: [0, 0, 0, 6, 0, 0, 0, 1]) + data.append(contentsOf: [ + UInt8((ticksPerQuarter >> 8) & 0xFF), + UInt8(ticksPerQuarter & 0xFF) + ]) + data.append(Data("MTrk".utf8)) + let length = UInt32(trackBytes.count) + data.append(contentsOf: [ + UInt8((length >> 24) & 0xFF), + UInt8((length >> 16) & 0xFF), + UInt8((length >> 8) & 0xFF), + UInt8(length & 0xFF) + ]) + data.append(contentsOf: trackBytes) + return data + } + + private static func variableLength(_ value: UInt32) -> [UInt8] { + var value = value + var buffer = [UInt8(value & 0x7F)] + while value > 0x7F { + value >>= 7 + buffer.insert(UInt8(value & 0x7F) | 0x80, at: 0) + } + return buffer + } +} + +final class StemTranscriptionMIDIDocumentService { + @MainActor + func chooseExportURL(defaultName: String) -> URL? { + let panel = NSSavePanel() + panel.title = "Export Stem Transcription" + panel.prompt = "Export" + panel.canCreateDirectories = true + if let midiType = UTType(filenameExtension: "mid") { + panel.allowedContentTypes = [midiType] + } + panel.nameFieldStringValue = defaultName + guard panel.runModal() == .OK, let url = panel.url else { return nil } + return url.pathExtension.lowercased() == "mid" + ? url + : url.deletingPathExtension().appendingPathExtension("mid") + } + + func save(_ data: Data, to url: URL) throws { + try FileManager.default.createDirectory( + at: url.deletingLastPathComponent(), + withIntermediateDirectories: true + ) + try data.write(to: url, options: .atomic) + } +} diff --git a/JammLab/Services/StemTranscriptionNotationMapper.swift b/JammLab/Services/StemTranscriptionNotationMapper.swift new file mode 100644 index 0000000..0861412 --- /dev/null +++ b/JammLab/Services/StemTranscriptionNotationMapper.swift @@ -0,0 +1,187 @@ +import Foundation + +struct StemTranscriptionNotationOutput: Equatable { + var track: StemTranscriptionTrack + var notationItems: [NotationMeasureItem] +} + +enum StemTranscriptionNotationMapper { + static func map( + result: RawStemTranscriptionResult, + stemType: StemType, + trackID: UUID = UUID(), + notationPartID: NotationPartID? = nil, + sourceFingerprint: StemSourceFingerprint, + timelineMapping: StemTimelineMapping, + configuration: StemTranscriptionConfiguration, + tempoMap: TempoMap, + projectDuration: TimeInterval, + keyName: String? + ) throws -> StemTranscriptionNotationOutput { + let resolvedPartID = notationPartID ?? .stem(stemType) + let content = NotationViewportFactory().scoreContent( + tempoMap: tempoMap, + duration: projectDuration, + keyName: keyName, + partID: resolvedPartID + ) + guard content.isReady, !content.measures.isEmpty else { + throw StemTranscriptionError.resultCouldNotBeAdded + } + + let measureStarts = absoluteQuarterStarts(for: content.measures) + let quantum = 4.0 / Double(max(1, configuration.quantizationDenominator)) + let keySignature = content.keySignature + var storedNotes: [StemTranscriptionNote] = [] + var notationItems: [NotationMeasureItem] = [] + + for rawNote in result.notes { + let projectStart = timelineMapping.projectTime(forSourceTime: rawNote.startTimeSeconds) + let projectEnd = timelineMapping.projectTime(forSourceTime: rawNote.endTimeSeconds) + guard projectStart.isFinite, + projectEnd.isFinite, + projectEnd > projectStart, + projectEnd > 0, + projectStart < projectDuration + else { continue } + + let clampedStart = min(projectDuration, max(0, projectStart)) + let clampedEnd = min(projectDuration, max(0, projectEnd)) + guard clampedEnd > clampedStart else { continue } + + let rawAbsoluteStart = absoluteQuarter( + at: clampedStart, + measures: content.measures, + measureStarts: measureStarts + ) + let rawAbsoluteEnd = absoluteQuarter( + at: clampedEnd, + measures: content.measures, + measureStarts: measureStarts + ) + let quantizedStart = quantize(rawAbsoluteStart, quantum: quantum) + let quantizedEnd = max( + quantizedStart + quantum, + quantize(rawAbsoluteEnd, quantum: quantum) + ) + + let itemIDs = makeNotationItems( + fromAbsoluteQuarter: quantizedStart, + toAbsoluteQuarter: quantizedEnd, + midiPitch: rawNote.midiPitch, + partID: resolvedPartID, + measures: content.measures, + measureStarts: measureStarts, + keySignature: keySignature + ) + notationItems.append(contentsOf: itemIDs.items) + storedNotes.append(StemTranscriptionNote( + midiPitch: rawNote.midiPitch, + rawStartTimeSeconds: rawNote.startTimeSeconds, + rawEndTimeSeconds: rawNote.endTimeSeconds, + projectStartTimeSeconds: clampedStart, + projectEndTimeSeconds: clampedEnd, + confidence: rawNote.confidence, + pitchBends: rawNote.pitchBends, + notationItemIDs: itemIDs.ids + )) + } + + let track = StemTranscriptionTrack( + id: trackID, + stemType: stemType, + notationPartID: resolvedPartID, + sourceFingerprint: sourceFingerprint, + configuration: configuration, + notes: storedNotes, + timings: result.timings, + warnings: result.warnings + ) + return StemTranscriptionNotationOutput(track: track, notationItems: notationItems) + } + + private static func absoluteQuarterStarts(for measures: [ScoreMeasure]) -> [Double] { + var cursor = 0.0 + return measures.map { measure in + defer { + cursor += NotationMeasureTiming.quarterLength(for: measure.attributes.timeSignature) + } + return cursor + } + } + + private static func absoluteQuarter( + at time: TimeInterval, + measures: [ScoreMeasure], + measureStarts: [Double] + ) -> Double { + let index = measures.firstIndex(where: { NotationMeasureTiming.containsEventTime(time, in: $0) }) + ?? max(0, measures.count - 1) + return measureStarts[index] + NotationMeasureTiming.quarterOffset(for: time, in: measures[index]) + } + + private static func quantize(_ value: Double, quantum: Double) -> Double { + guard quantum > 0 else { return value } + return (value / quantum).rounded() * quantum + } + + private static func makeNotationItems( + fromAbsoluteQuarter start: Double, + toAbsoluteQuarter end: Double, + midiPitch: Int, + partID: NotationPartID, + measures: [ScoreMeasure], + measureStarts: [Double], + keySignature: KeySignature + ) -> (items: [NotationMeasureItem], ids: [String]) { + var chunks: [(measure: ScoreMeasure, offset: Double, duration: Double)] = [] + for (index, measure) in measures.enumerated() { + let measureStart = measureStarts[index] + let measureEnd = measureStart + + NotationMeasureTiming.quarterLength(for: measure.attributes.timeSignature) + let chunkStart = max(start, measureStart) + let chunkEnd = min(end, measureEnd) + if chunkEnd > chunkStart + NotationMeasureTiming.timelineTolerance { + chunks.append(( + measure, + chunkStart - measureStart, + chunkEnd - chunkStart + )) + } + } + + let ids = chunks.map { _ in UUID().uuidString } + let pitch = NotationPitchMapper.pitch( + forMIDINoteNumber: midiPitch, + keySignature: keySignature + ) + let items = chunks.enumerated().map { index, chunk in + NotationMeasureItem( + id: ids[index], + partID: partID, + kind: .note, + pitch: pitch, + measureNumber: chunk.measure.number, + measureStartTime: chunk.measure.startTime, + offsetInQuarterNotes: chunk.offset, + durationInQuarterNotes: chunk.duration, + displayDuration: closestDisplayDuration(to: chunk.duration), + tieTargetItemID: index + 1 < ids.count ? ids[index + 1] : nil + ) + } + return (items, ids) + } + + private static func closestDisplayDuration(to quarterDuration: Double) -> NotationDuration { + let candidates = NotationDuration.restDecompositionDenominators.flatMap { denominator in + [ + NotationDuration(denominator: denominator), + NotationDuration(denominator: denominator, isDotted: true) + ] + } + return candidates.min { + abs($0.durationInQuarterNotes - quarterDuration) + < abs($1.durationInQuarterNotes - quarterDuration) + } ?? NotationDuration() + } +} diff --git a/JammLab/Services/StemTranscriptionService.swift b/JammLab/Services/StemTranscriptionService.swift new file mode 100644 index 0000000..989e257 --- /dev/null +++ b/JammLab/Services/StemTranscriptionService.swift @@ -0,0 +1,395 @@ +import AudioToolbox +import Foundation + +enum StemTranscriptionError: LocalizedError, Equatable { + case unsupportedStemType + case stemAudioUnavailable + case unsupportedAudioFormat + case audioDecodingFailed + case resamplingFailed + case modelResourceMissing + case modelInitializationFailed + case inferenceFailed + case invalidModelOutput + case cancelled + case sourceStemChanged + case resultCouldNotBeAdded + + var errorDescription: String? { + switch self { + case .unsupportedStemType: + return "Basic Pitch transcription is not available for Drum stems." + case .stemAudioUnavailable: + return "The selected stem audio is unavailable." + case .unsupportedAudioFormat: + return "The selected stem uses an unsupported audio format." + case .audioDecodingFailed: + return "JammLab could not decode the selected stem." + case .resamplingFailed: + return "JammLab could not prepare the stem for transcription." + case .modelResourceMissing: + return "The built-in Basic Pitch model is missing." + case .modelInitializationFailed: + return "The built-in transcription model could not be initialized." + case .inferenceFailed: + return "The selected stem could not be transcribed." + case .invalidModelOutput: + return "The transcription model returned an invalid result." + case .cancelled: + return "Transcription was cancelled." + case .sourceStemChanged: + return "The source stem changed while it was being transcribed." + case .resultCouldNotBeAdded: + return "The transcription result could not be added to the project." + } + } +} + +struct RawStemTranscriptionNote: Equatable { + var midiPitch: Int + var startTimeSeconds: TimeInterval + var endTimeSeconds: TimeInterval + var confidence: Double + var pitchBends: [Int] +} + +struct RawStemTranscriptionResult: Equatable { + var notes: [RawStemTranscriptionNote] + var timings: StemTranscriptionTimings + var warnings: [String] +} + +struct PreparedTranscriptionAudio { + var url: URL + var temporaryDirectory: URL + var sampleCount: Int + var preparationDuration: Double + + func cleanup(fileManager: FileManager = .default) { + try? fileManager.removeItem(at: temporaryDirectory) + } +} + +final class StemTranscriptionOperation: @unchecked Sendable { + fileprivate let nativeToken = JMTranscriptionCancellationToken() + private let lock = NSLock() + private var cancelled = false + + var isCancelled: Bool { + lock.withLock { cancelled } + } + + func cancel() { + lock.withLock { cancelled = true } + nativeToken.cancel() + } +} + +protocol StemTranscribing: Sendable { + func transcribe( + stemType: StemType, + stemURL: URL, + configuration: StemTranscriptionConfiguration, + operation: StemTranscriptionOperation, + progress: @escaping @Sendable (StemTranscriptionPhase, Double) -> Void + ) async throws -> RawStemTranscriptionResult +} + +final class StemTranscriptionService: StemTranscribing, @unchecked Sendable { + static let modelSampleRate = 22_050.0 + private let bridge = JMBasicPitchBridge() + + func transcribe( + stemType: StemType, + stemURL: URL, + configuration: StemTranscriptionConfiguration, + operation: StemTranscriptionOperation, + progress: @escaping @Sendable (StemTranscriptionPhase, Double) -> Void + ) async throws -> RawStemTranscriptionResult { + guard stemType.supportsBasicPitchTranscription else { + throw StemTranscriptionError.unsupportedStemType + } + return try await Task.detached(priority: .userInitiated) { + let totalStart = ContinuousClock.now + progress(.preparingAudio, 0) + let prepared = try self.prepareAudio( + at: stemURL, + operation: operation, + progress: { progress(.preparingAudio, min(1, max(0, $0))) } + ) + defer { prepared.cleanup() } + + guard !operation.isCancelled else { throw StemTranscriptionError.cancelled } + progress(.loadingModel, 0) + + let nativeConfiguration = self.makeNativeConfiguration(from: configuration) + + let result: JMTranscriptionResult + do { + result = try self.bridge.transcribePCMFile( + at: prepared.url, + sampleCount: UInt(prepared.sampleCount), + sampleRate: Self.modelSampleRate, + configuration: nativeConfiguration, + cancellationToken: operation.nativeToken, + progress: { progress(.transcribing, $0) } + ) + } catch { + throw self.mapBridgeError(error as NSError, cancelled: operation.isCancelled) + } + guard !operation.isCancelled else { throw StemTranscriptionError.cancelled } + progress(.processingNotes, 0) + + let rawResult = try self.makeRawResult( + from: result, + preparedAudio: prepared, + totalStart: totalStart + ) + progress(.processingNotes, 1) + return rawResult + }.value + } + + func prepareAudio( + at sourceURL: URL, + operation: StemTranscriptionOperation, + progress: @escaping (Double) -> Void + ) throws -> PreparedTranscriptionAudio { + guard FileManager.default.fileExists(atPath: sourceURL.path) else { + throw StemTranscriptionError.stemAudioUnavailable + } + + let start = ContinuousClock.now + var audioFile: ExtAudioFileRef? + let openStatus = ExtAudioFileOpenURL(sourceURL as CFURL, &audioFile) + guard openStatus == noErr, let audioFile else { + throw StemTranscriptionError.unsupportedAudioFormat + } + defer { ExtAudioFileDispose(audioFile) } + + var sourceFormat = AudioStreamBasicDescription() + var sourceFormatSize = UInt32(MemoryLayout.size) + let formatStatus = ExtAudioFileGetProperty( + audioFile, + kExtAudioFileProperty_FileDataFormat, + &sourceFormatSize, + &sourceFormat + ) + guard formatStatus == noErr, + sourceFormat.mSampleRate.isFinite, + sourceFormat.mSampleRate > 0 + else { + throw StemTranscriptionError.unsupportedAudioFormat + } + + var sourceLengthFrames: Int64 = 0 + var propertySize = UInt32(MemoryLayout.size) + let lengthStatus = ExtAudioFileGetProperty( + audioFile, + kExtAudioFileProperty_FileLengthFrames, + &propertySize, + &sourceLengthFrames + ) + guard lengthStatus == noErr else { throw StemTranscriptionError.audioDecodingFailed } + let expectedOutputFrames = Double(sourceLengthFrames) + * Self.modelSampleRate + / sourceFormat.mSampleRate + + let sourceChannelCount = max(1, Int(sourceFormat.mChannelsPerFrame)) + let bytesPerFrame = UInt32(MemoryLayout.size * sourceChannelCount) + var clientFormat = AudioStreamBasicDescription( + mSampleRate: Self.modelSampleRate, + mFormatID: kAudioFormatLinearPCM, + mFormatFlags: kAudioFormatFlagIsFloat | kAudioFormatFlagIsPacked | kAudioFormatFlagsNativeEndian, + mBytesPerPacket: bytesPerFrame, + mFramesPerPacket: 1, + mBytesPerFrame: bytesPerFrame, + mChannelsPerFrame: UInt32(sourceChannelCount), + mBitsPerChannel: 32, + mReserved: 0 + ) + let clientStatus = ExtAudioFileSetProperty( + audioFile, + kExtAudioFileProperty_ClientDataFormat, + UInt32(MemoryLayout.size), + &clientFormat + ) + guard clientStatus == noErr else { throw StemTranscriptionError.resamplingFailed } + + let temporaryDirectory = FileManager.default.temporaryDirectory + .appendingPathComponent("JammLabTranscription-\(UUID().uuidString)", isDirectory: true) + try FileManager.default.createDirectory( + at: temporaryDirectory, + withIntermediateDirectories: true + ) + let outputURL = temporaryDirectory.appendingPathComponent("mono-22050.f32") + FileManager.default.createFile(atPath: outputURL.path, contents: nil) + guard let output = try? FileHandle(forWritingTo: outputURL) else { + try? FileManager.default.removeItem(at: temporaryDirectory) + throw StemTranscriptionError.resamplingFailed + } + defer { try? output.close() } + + let chunkCapacity: UInt32 = 32_768 + var interleavedSamples = Array( + repeating: Float.zero, + count: Int(chunkCapacity) * sourceChannelCount + ) + var monoSamples = Array(repeating: Float.zero, count: Int(chunkCapacity)) + var sampleCount = 0 + do { + while true { + guard !operation.isCancelled else { throw StemTranscriptionError.cancelled } + var frameCount = chunkCapacity + let readStatus = interleavedSamples.withUnsafeMutableBytes { bytes -> OSStatus in + let buffer = AudioBuffer( + mNumberChannels: UInt32(sourceChannelCount), + mDataByteSize: chunkCapacity * bytesPerFrame, + mData: bytes.baseAddress + ) + var bufferList = AudioBufferList(mNumberBuffers: 1, mBuffers: buffer) + return ExtAudioFileRead(audioFile, &frameCount, &bufferList) + } + guard readStatus == noErr else { throw StemTranscriptionError.audioDecodingFailed } + guard frameCount > 0 else { break } + + for frameIndex in 0...size + try output.write(contentsOf: Data(bytes: bytes.baseAddress!, count: count)) + } + sampleCount += Int(frameCount) + if expectedOutputFrames > 0 { + progress(min(0.99, Double(sampleCount) / expectedOutputFrames)) + } + } + } catch { + try? FileManager.default.removeItem(at: temporaryDirectory) + throw error + } + + guard sampleCount > 0 else { + try? FileManager.default.removeItem(at: temporaryDirectory) + throw StemTranscriptionError.audioDecodingFailed + } + progress(1) + let elapsed = start.duration(to: .now) + let seconds = Double(elapsed.components.seconds) + + Double(elapsed.components.attoseconds) / 1e18 + return PreparedTranscriptionAudio( + url: outputURL, + temporaryDirectory: temporaryDirectory, + sampleCount: sampleCount, + preparationDuration: seconds + ) + } + + private func makeNativeConfiguration( + from configuration: StemTranscriptionConfiguration + ) -> JMTranscriptionConfiguration { + let nativeConfiguration = JMTranscriptionConfiguration() + nativeConfiguration.minimumNoteDurationMilliseconds = + Float(configuration.minimumNoteDurationMilliseconds) + nativeConfiguration.noteSensitivity = Float(configuration.noteSensitivity) + nativeConfiguration.splitSensitivity = Float(configuration.splitSensitivity) + nativeConfiguration.includePitchBends = configuration.includePitchBends + nativeConfiguration.windowDurationSeconds = 30 + nativeConfiguration.overlapDurationSeconds = 2 + return nativeConfiguration + } + + private func makeRawResult( + from result: JMTranscriptionResult, + preparedAudio: PreparedTranscriptionAudio, + totalStart: ContinuousClock.Instant + ) throws -> RawStemTranscriptionResult { + let notes = try makeRawNotes(from: result.notes) + return RawStemTranscriptionResult( + notes: notes, + timings: StemTranscriptionTimings( + audioPreparationSeconds: preparedAudio.preparationDuration, + modelLoadSeconds: result.timings.modelLoadSeconds, + inferenceSeconds: result.timings.inferenceSeconds, + postProcessingSeconds: result.timings.postProcessingSeconds, + totalSeconds: elapsedSeconds(since: totalStart), + processedDurationSeconds: result.processedDurationSeconds + ), + warnings: result.warnings + ) + } + + private func makeRawNotes( + from notes: [JMTranscriptionNote] + ) throws -> [RawStemTranscriptionNote] { + let rawNotes = notes.compactMap { note -> RawStemTranscriptionNote? in + guard (0...127).contains(note.pitch), + note.startTimeSeconds.isFinite, + note.endTimeSeconds.isFinite, + note.endTimeSeconds > note.startTimeSeconds, + note.confidence.isFinite + else { return nil } + return RawStemTranscriptionNote( + midiPitch: note.pitch, + startTimeSeconds: note.startTimeSeconds, + endTimeSeconds: note.endTimeSeconds, + confidence: note.confidence, + pitchBends: note.pitchBends.map(\.intValue) + ) + } + guard rawNotes.count == notes.count else { + throw StemTranscriptionError.invalidModelOutput + } + return rawNotes + } + + private func elapsedSeconds(since start: ContinuousClock.Instant) -> Double { + let elapsed = start.duration(to: .now) + return Double(elapsed.components.seconds) + + Double(elapsed.components.attoseconds) / 1e18 + } + + private func mapBridgeError(_ error: NSError?, cancelled: Bool) -> StemTranscriptionError { + if cancelled { + return .cancelled + } + guard error?.domain == JMTranscriptionErrorDomain else { + return .inferenceFailed + } + if error?.code == BridgeErrorCode.cancelled { + return .cancelled + } + switch error?.code { + case BridgeErrorCode.emptyInput: + return .audioDecodingFailed + case BridgeErrorCode.unsupportedSampleRate: + return .resamplingFailed + case BridgeErrorCode.audioReadFailed: + return .audioDecodingFailed + case BridgeErrorCode.modelResourceMissing: + return .modelResourceMissing + case BridgeErrorCode.modelInitializationFailed: + return .modelInitializationFailed + case BridgeErrorCode.invalidModelOutput: + return .invalidModelOutput + default: + return .inferenceFailed + } + } + + private enum BridgeErrorCode { + static let emptyInput = 1 + static let unsupportedSampleRate = 2 + static let audioReadFailed = 3 + static let modelResourceMissing = 4 + static let modelInitializationFailed = 5 + static let invalidModelOutput = 7 + static let cancelled = 8 + } +} diff --git a/JammLab/Transcription/Native/BasicPitchTranscriptionEngine.cpp b/JammLab/Transcription/Native/BasicPitchTranscriptionEngine.cpp new file mode 100644 index 0000000..43fb69a --- /dev/null +++ b/JammLab/Transcription/Native/BasicPitchTranscriptionEngine.cpp @@ -0,0 +1,257 @@ +#include "BasicPitchTranscriptionEngine.h" + +#include "Engine/BasicPitch.h" + +#include +#include +#include +#include +#include +#include + +namespace jammlab::transcription +{ +namespace +{ + using Clock = std::chrono::steady_clock; + + constexpr std::size_t minimumModelSamples = 2 * static_cast(BASIC_PITCH_SAMPLE_RATE); + constexpr double progressReservedForPostProcessing = 0.02; + constexpr double boundaryEpsilonSeconds = 1.0e-5; + + double elapsedSeconds(Clock::time_point start) + { + return std::chrono::duration(Clock::now() - start).count(); + } + + void checkCancellation(const ProgressCallback& callback, double progress) + { + if (callback && !callback(std::clamp(progress, 0.0, 1.0))) { + throw Error(ErrorCode::cancelled, "Transcription was cancelled"); + } + } + + void validateConfiguration(const Configuration& configuration) + { + if (!std::isfinite(configuration.windowDurationSeconds) || configuration.windowDurationSeconds < 2.0 + || !std::isfinite(configuration.overlapDurationSeconds) || configuration.overlapDurationSeconds < 0 + || configuration.overlapDurationSeconds >= configuration.windowDurationSeconds) { + throw Error(ErrorCode::inferenceFailed, "Invalid transcription window configuration"); + } + } + + void sanitizeSamples(std::vector& samples) + { + for (auto& sample: samples) { + sample = std::isfinite(sample) ? std::clamp(sample, -1.0f, 1.0f) : 0.0f; + } + } + + void stitchNotes(std::vector& notes, const std::vector& windowBoundaries) + { + std::sort(notes.begin(), notes.end(), [](const Note& lhs, const Note& rhs) { + if (lhs.startTimeSeconds != rhs.startTimeSeconds) { + return lhs.startTimeSeconds < rhs.startTimeSeconds; + } + if (lhs.pitch != rhs.pitch) { + return lhs.pitch < rhs.pitch; + } + return lhs.endTimeSeconds < rhs.endTimeSeconds; + }); + + std::vector stitched; + stitched.reserve(notes.size()); + for (auto& note: notes) { + if (note.pitch < MIN_MIDI_NOTE || note.pitch > MAX_MIDI_NOTE || !std::isfinite(note.startTimeSeconds) + || !std::isfinite(note.endTimeSeconds) || note.endTimeSeconds <= note.startTimeSeconds + || !std::isfinite(note.confidence)) { + continue; + } + + auto duplicate = std::find_if(stitched.rbegin(), stitched.rend(), [&](const Note& candidate) { + if (candidate.pitch != note.pitch) { + return false; + } + return std::any_of(windowBoundaries.begin(), windowBoundaries.end(), [&](double boundary) { + return std::abs(candidate.endTimeSeconds - boundary) <= boundaryEpsilonSeconds + && std::abs(note.startTimeSeconds - boundary) <= boundaryEpsilonSeconds; + }); + }); + + if (duplicate != stitched.rend()) { + duplicate->startTimeSeconds = std::min(duplicate->startTimeSeconds, note.startTimeSeconds); + duplicate->endTimeSeconds = std::max(duplicate->endTimeSeconds, note.endTimeSeconds); + duplicate->confidence = std::max(duplicate->confidence, note.confidence); + if (duplicate->pitchBends.empty()) { + duplicate->pitchBends = std::move(note.pitchBends); + } + } else { + stitched.push_back(std::move(note)); + } + } + notes = std::move(stitched); + } + +} // namespace + +namespace detail +{ + void stitchNotesAtWindowBoundaries(std::vector& notes, const std::vector& windowBoundaries) + { + stitchNotes(notes, windowBoundaries); + } +} // namespace detail + +Error::Error(ErrorCode code, const std::string& message) + : std::runtime_error(message) + , code_(code) +{ +} + +ErrorCode Error::code() const noexcept +{ + return code_; +} + +BasicPitchTranscriptionEngine::BasicPitchTranscriptionEngine(std::filesystem::path modelDirectory) + : modelDirectory_(std::move(modelDirectory)) +{ +} + +BasicPitchTranscriptionEngine::~BasicPitchTranscriptionEngine() = default; + +void BasicPitchTranscriptionEngine::ensureModelLoaded(Timings& timings) +{ + if (model_) { + return; + } + + const auto start = Clock::now(); + if (!std::filesystem::is_directory(modelDirectory_)) { + throw Error(ErrorCode::modelResourceMissing, "Basic Pitch model directory is missing"); + } + + try { + model_ = std::make_unique(modelDirectory_); + } catch (const std::exception& exception) { + throw Error(ErrorCode::modelInitializationFailed, exception.what()); + } + timings.modelLoadSeconds = elapsedSeconds(start); +} + +Result BasicPitchTranscriptionEngine::transcribePCMFile(const std::filesystem::path& pcmFile, + std::size_t sampleCount, + double sampleRate, + const Configuration& configuration, + const ProgressCallback& progressCallback) +{ + const auto totalStart = Clock::now(); + Result result; + + if (sampleCount == 0) { + throw Error(ErrorCode::emptyInput, "Stem audio contains no samples"); + } + if (!std::isfinite(sampleRate) || std::abs(sampleRate - requiredSampleRate) > 0.01) { + throw Error(ErrorCode::unsupportedSampleRate, "Basic Pitch requires 22050 Hz mono PCM"); + } + validateConfiguration(configuration); + checkCancellation(progressCallback, 0); + ensureModelLoaded(result.timings); + + std::ifstream stream(pcmFile, std::ios::binary); + if (!stream.is_open()) { + throw Error(ErrorCode::audioReadFailed, "Prepared stem audio could not be opened"); + } + + const auto windowSamples = std::max( + minimumModelSamples, static_cast(std::llround(configuration.windowDurationSeconds * sampleRate))); + const auto overlapSamples = + static_cast(std::llround(configuration.overlapDurationSeconds * sampleRate)); + const auto stepSamples = windowSamples - overlapSamples; + const auto windowCount = sampleCount <= windowSamples + ? std::size_t {1} + : 1 + (sampleCount - windowSamples + stepSamples - 1) / stepSamples; + + result.notes.reserve(windowCount * 128); + std::vector windowBoundaries; + if (windowCount > 1) { + windowBoundaries.reserve(windowCount - 1); + } + const auto inferenceStart = Clock::now(); + + for (std::size_t windowIndex = 0; windowIndex < windowCount; ++windowIndex) { + const auto windowStartSample = std::min(windowIndex * stepSamples, sampleCount); + const auto readableSamples = std::min(windowSamples, sampleCount - windowStartSample); + std::vector audio(std::max(readableSamples, minimumModelSamples), 0.0f); + + stream.clear(); + stream.seekg(static_cast(windowStartSample * sizeof(float)), std::ios::beg); + stream.read(reinterpret_cast(audio.data()), + static_cast(readableSamples * sizeof(float))); + if (static_cast(stream.gcount()) != readableSamples * sizeof(float)) { + throw Error(ErrorCode::audioReadFailed, "Prepared stem audio ended unexpectedly"); + } + sanitizeSamples(audio); + checkCancellation(progressCallback, + (1.0 - progressReservedForPostProcessing) * static_cast(windowIndex) + / static_cast(windowCount)); + + try { + model_->reset(); + model_->setParameters(std::clamp(configuration.noteSensitivity, 0.05f, 0.95f), + std::clamp(configuration.splitSensitivity, 0.05f, 0.95f), + std::max(configuration.minimumNoteDurationMilliseconds, 1.0f), + configuration.includePitchBends); + model_->transcribeToMIDI(audio.data(), static_cast(audio.size()), [&](double localProgress) { + const auto overall = (static_cast(windowIndex) + std::clamp(localProgress, 0.0, 1.0)) + / static_cast(windowCount); + return !progressCallback || progressCallback((1.0 - progressReservedForPostProcessing) * overall); + }); + } catch (const Error&) { + throw; + } catch (const std::runtime_error& exception) { + if (std::string(exception.what()) == "transcription_cancelled") { + throw Error(ErrorCode::cancelled, "Transcription was cancelled"); + } + throw Error(ErrorCode::inferenceFailed, exception.what()); + } catch (const std::exception& exception) { + throw Error(ErrorCode::inferenceFailed, exception.what()); + } + + const auto windowStartSeconds = static_cast(windowStartSample) / sampleRate; + const auto windowEndSeconds = static_cast(windowStartSample + readableSamples) / sampleRate; + const auto halfOverlapSeconds = configuration.overlapDurationSeconds / 2.0; + const auto acceptedStart = windowIndex == 0 ? windowStartSeconds : windowStartSeconds + halfOverlapSeconds; + const auto acceptedEnd = + windowIndex + 1 == windowCount ? windowEndSeconds : windowEndSeconds - halfOverlapSeconds; + if (windowIndex + 1 < windowCount) { + windowBoundaries.push_back(acceptedEnd); + } + + for (const auto& event: model_->getNoteEvents()) { + Note note {event.pitch, + windowStartSeconds + event.startTime, + windowStartSeconds + event.endTime, + event.amplitude, + event.bends}; + if (note.endTimeSeconds <= acceptedStart || note.startTimeSeconds >= acceptedEnd) { + continue; + } + note.startTimeSeconds = std::max(note.startTimeSeconds, acceptedStart); + note.endTimeSeconds = std::min(note.endTimeSeconds, acceptedEnd); + result.notes.push_back(std::move(note)); + } + } + + result.timings.inferenceSeconds = elapsedSeconds(inferenceStart); + const auto postProcessingStart = Clock::now(); + checkCancellation(progressCallback, 1.0 - progressReservedForPostProcessing); + detail::stitchNotesAtWindowBoundaries(result.notes, windowBoundaries); + result.timings.postProcessingSeconds = elapsedSeconds(postProcessingStart); + result.processedDurationSeconds = static_cast(sampleCount) / sampleRate; + result.timings.totalSeconds = elapsedSeconds(totalStart); + checkCancellation(progressCallback, 1); + return result; +} + +} // namespace jammlab::transcription diff --git a/JammLab/Transcription/Native/BasicPitchTranscriptionEngine.h b/JammLab/Transcription/Native/BasicPitchTranscriptionEngine.h new file mode 100644 index 0000000..fda81ef --- /dev/null +++ b/JammLab/Transcription/Native/BasicPitchTranscriptionEngine.h @@ -0,0 +1,102 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +class BasicPitch; + +namespace jammlab::transcription +{ + +enum class ErrorCode { + emptyInput, + unsupportedSampleRate, + audioReadFailed, + modelResourceMissing, + modelInitializationFailed, + inferenceFailed, + invalidModelOutput, + cancelled +}; + +class Error final : public std::runtime_error +{ +public: + Error(ErrorCode code, const std::string& message); + + [[nodiscard]] ErrorCode code() const noexcept; + +private: + ErrorCode code_; +}; + +struct Configuration { + float noteSensitivity = 0.7f; + float splitSensitivity = 0.5f; + float minimumNoteDurationMilliseconds = 125.0f; + bool includePitchBends = false; + double windowDurationSeconds = 30.0; + double overlapDurationSeconds = 2.0; +}; + +struct Note { + int pitch = 0; + double startTimeSeconds = 0; + double endTimeSeconds = 0; + double confidence = 0; + std::vector pitchBends; +}; + +struct Timings { + double modelLoadSeconds = 0; + double inferenceSeconds = 0; + double postProcessingSeconds = 0; + double totalSeconds = 0; +}; + +struct Result { + std::vector notes; + double processedDurationSeconds = 0; + std::vector warnings; + Timings timings; +}; + +using ProgressCallback = std::function; + +namespace detail +{ + // Kept as a pure seam so overlap behavior can be verified without model + // inference. + void stitchNotesAtWindowBoundaries(std::vector& notes, const std::vector& windowBoundaries); +} // namespace detail + +class BasicPitchTranscriptionEngine final +{ +public: + static constexpr double requiredSampleRate = 22050.0; + + explicit BasicPitchTranscriptionEngine(std::filesystem::path modelDirectory); + ~BasicPitchTranscriptionEngine(); + + BasicPitchTranscriptionEngine(const BasicPitchTranscriptionEngine&) = delete; + BasicPitchTranscriptionEngine& operator=(const BasicPitchTranscriptionEngine&) = delete; + + Result transcribePCMFile(const std::filesystem::path& pcmFile, + std::size_t sampleCount, + double sampleRate, + const Configuration& configuration, + const ProgressCallback& progressCallback = {}); + +private: + void ensureModelLoaded(Timings& timings); + + std::filesystem::path modelDirectory_; + std::unique_ptr model_; +}; + +} // namespace jammlab::transcription diff --git a/JammLab/Transcription/Native/Engine/BasicPitch.cpp b/JammLab/Transcription/Native/Engine/BasicPitch.cpp new file mode 100644 index 0000000..9b17fbb --- /dev/null +++ b/JammLab/Transcription/Native/Engine/BasicPitch.cpp @@ -0,0 +1,134 @@ +// +// Created by Damien Ronssin on 10.03.23. +// + +#include "BasicPitch.h" + +#include +#include + +BasicPitch::BasicPitch(const std::filesystem::path& modelDirectory) + : mFeaturesCalculator(modelDirectory / "features_model.ort") + , mBasicPitchCNN(modelDirectory) +{ +} + +void BasicPitch::reset() +{ + mBasicPitchCNN.reset(); + mNotesCreator.clear(); + + mContoursPG.clear(); + mContoursPG.shrink_to_fit(); + mNotesPG.clear(); + mNotesPG.shrink_to_fit(); + mOnsetsPG.clear(); + mOnsetsPG.shrink_to_fit(); + mNoteEvents.clear(); + mNoteEvents.shrink_to_fit(); + + mNumFrames = 0; +} + +void BasicPitch::setParameters( + float inNoteSensitivity, + float inSplitSensitivity, + float inMinNoteDurationMs, + bool includePitchBends +) +{ + mParams.frameThreshold = 1.0f - inNoteSensitivity; + mParams.onsetThreshold = 1.0f - inSplitSensitivity; + + mParams.minNoteLength = + static_cast(std::round(inMinNoteDurationMs / 1000.0f / (FFT_HOP / BASIC_PITCH_SAMPLE_RATE))); + + mParams.pitchBend = includePitchBends ? MultiPitchBend : NoPitchBend; + mParams.melodiaTrick = true; + mParams.inferOnsets = true; +} + +void BasicPitch::transcribeToMIDI( + float* inAudio, + int inNumSamples, + const ProgressCallback& progressCallback +) +{ + if (inAudio == nullptr || inNumSamples <= 0) { + throw std::invalid_argument("Basic Pitch audio input is empty"); + } + if (progressCallback && !progressCallback(0)) { + throw std::runtime_error("transcription_cancelled"); + } + + const float* stacked_cqt = mFeaturesCalculator.computeFeatures(inAudio, inNumSamples, mNumFrames); + if (mNumFrames == 0) { + mNoteEvents.clear(); + return; + } + if (progressCallback && !progressCallback(0.15)) { + throw std::runtime_error("transcription_cancelled"); + } + + mOnsetsPG.resize(mNumFrames, std::vector(static_cast(NUM_FREQ_OUT), 0.0f)); + mNotesPG.resize(mNumFrames, std::vector(static_cast(NUM_FREQ_OUT), 0.0f)); + mContoursPG.resize(mNumFrames, std::vector(static_cast(NUM_FREQ_IN), 0.0f)); + + mOnsetsPG.shrink_to_fit(); + mNotesPG.shrink_to_fit(); + mContoursPG.shrink_to_fit(); + + mBasicPitchCNN.reset(); + + const size_t num_lh_frames = BasicPitchCNN::getNumFramesLookahead(); + + std::vector zero_stacked_cqt(NUM_HARMONICS * NUM_FREQ_IN, 0.0f); + + // Run the CNN with 0 input and discard output (only for num_lh_frames) + for (int i = 0; i < num_lh_frames; i++) { + mBasicPitchCNN.frameInference(zero_stacked_cqt.data(), mContoursPG[0], mNotesPG[0], mOnsetsPG[0]); + } + + // Run the CNN with real inputs and discard outputs (only for num_lh_frames) + for (size_t frame_idx = 0; frame_idx < num_lh_frames; frame_idx++) { + mBasicPitchCNN.frameInference( + stacked_cqt + frame_idx * NUM_HARMONICS * NUM_FREQ_IN, mContoursPG[0], mNotesPG[0], mOnsetsPG[0]); + } + + // Run the CNN with real inputs and correct outputs + for (size_t frame_idx = num_lh_frames; frame_idx < mNumFrames; frame_idx++) { + mBasicPitchCNN.frameInference(stacked_cqt + frame_idx * NUM_HARMONICS * NUM_FREQ_IN, + mContoursPG[frame_idx - num_lh_frames], + mNotesPG[frame_idx - num_lh_frames], + mOnsetsPG[frame_idx - num_lh_frames]); + if (progressCallback && (frame_idx % 32 == 0)) { + const auto progress = 0.15 + 0.75 * static_cast(frame_idx) / static_cast(mNumFrames); + if (!progressCallback(progress)) { + throw std::runtime_error("transcription_cancelled"); + } + } + } + + // Run end with zeroes as input and last frames as output + for (size_t frame_idx = mNumFrames; frame_idx < mNumFrames + num_lh_frames; frame_idx++) { + mBasicPitchCNN.frameInference(zero_stacked_cqt.data(), + mContoursPG[frame_idx - num_lh_frames], + mNotesPG[frame_idx - num_lh_frames], + mOnsetsPG[frame_idx - num_lh_frames]); + } + + mNoteEvents = mNotesCreator.convert(mNotesPG, mOnsetsPG, mContoursPG, mParams, true); + if (progressCallback && !progressCallback(1)) { + throw std::runtime_error("transcription_cancelled"); + } +} + +void BasicPitch::updateMIDI() +{ + mNoteEvents = mNotesCreator.convert(mNotesPG, mOnsetsPG, mContoursPG, mParams, false); +} + +const std::vector& BasicPitch::getNoteEvents() const +{ + return mNoteEvents; +} diff --git a/JammLab/Transcription/Native/Engine/BasicPitch.h b/JammLab/Transcription/Native/Engine/BasicPitch.h new file mode 100644 index 0000000..27a5f68 --- /dev/null +++ b/JammLab/Transcription/Native/Engine/BasicPitch.h @@ -0,0 +1,83 @@ +// +// Created by Damien Ronssin on 10.03.23. +// + +#ifndef BasicPitch_h +#define BasicPitch_h + +#include +#include + +#include "BasicPitchCNN.h" +#include "BasicPitchConstants.h" +#include "Features.h" +#include "Notes.h" + +/** + * Class to get midi transcription from raw audio. + */ +class BasicPitch +{ +public: + using ProgressCallback = std::function; + + explicit BasicPitch(const std::filesystem::path& modelDirectory); + + /** + * Resets all states of model, clear the posteriorgrams vector computed by the CNN and the note event vector. + */ + void reset(); + + /** + * Set parameters for next transcription or midi update. + * @param inNoteSensitivity Note sensitivity threshold (0.05, 0.95). Higher gives more notes. + * @param inSplitSensitivity Split sensitivity threshold (0.05, 0.95). Higher will split note more, lower will merge close notes with same pitch + * @param inMinNoteDurationMs Minimum note duration to keep in ms. + */ + void setParameters( + float inNoteSensitivity, + float inSplitSensitivity, + float inMinNoteDurationMs, + bool includePitchBends + ); + + /** + * Transcribe the input audio. The note event vector can be obtained after this with getNoteEvents + * @param inAudio Pointer to raw audio (must be at 22050 Hz) + * @param inNumSamples Number of input samples available. + */ + void transcribeToMIDI( + float* inAudio, + int inNumSamples, + const ProgressCallback& progressCallback = {} + ); + + /** + * Function to call to update the midi transcription with new parameters. + * The whole Features + CNN is not rerun for this. Only Notes::Convert is. + */ + void updateMIDI(); + + /** + * @return Note event vector. + */ + const std::vector& getNoteEvents() const; + +private: + // Posteriorgrams vector + std::vector> mContoursPG; + std::vector> mNotesPG; + std::vector> mOnsetsPG; + + std::vector mNoteEvents; + + Notes::ConvertParams mParams; + + size_t mNumFrames = 0; + + Features mFeaturesCalculator; + BasicPitchCNN mBasicPitchCNN; + Notes mNotesCreator; +}; + +#endif // BasicPitch_h diff --git a/JammLab/Transcription/Native/Engine/BasicPitchCNN.cpp b/JammLab/Transcription/Native/Engine/BasicPitchCNN.cpp new file mode 100644 index 0000000..d9bbe8d --- /dev/null +++ b/JammLab/Transcription/Native/Engine/BasicPitchCNN.cpp @@ -0,0 +1,147 @@ +// +// Created by Damien Ronssin on 03.03.23. +// + +#include "BasicPitchCNN.h" + +#include +#include + +using json = nlohmann::json; + +namespace +{ +json loadModelJson(const std::filesystem::path& modelDirectory, const char* filename) +{ + const auto path = modelDirectory / filename; + std::ifstream stream(path); + if (!stream.is_open()) { + throw std::runtime_error(std::string("Basic Pitch model resource is missing: ") + filename); + } + return json::parse(stream); +} +} // namespace + +BasicPitchCNN::BasicPitchCNN(const std::filesystem::path& modelDirectory) +{ + const auto json_cnn_contour = loadModelJson(modelDirectory, "cnn_contour_model.json"); + mCNNContour.parseJson(json_cnn_contour); + + const auto json_cnn_note = loadModelJson(modelDirectory, "cnn_note_model.json"); + mCNNNote.parseJson(json_cnn_note); + + const auto json_cnn_onset_input = loadModelJson(modelDirectory, "cnn_onset_1_model.json"); + mCNNOnsetInput.parseJson(json_cnn_onset_input); + + const auto json_cnn_onset_output = loadModelJson(modelDirectory, "cnn_onset_2_model.json"); + mCNNOnsetOutput.parseJson(json_cnn_onset_output); +} + +void BasicPitchCNN::reset() +{ + for (auto& array: mContoursCircularBuffer) { + array.fill(0.0f); + } + + for (auto& array: mNotesCircularBuffer) { + array.fill(0.0f); + } + + for (auto& array: mConcat2CircularBuffer) { + array.fill(0.0f); + } + + mCNNContour.reset(); + mCNNNote.reset(); + mCNNOnsetInput.reset(); + mCNNOnsetOutput.reset(); + + mNoteIdx = 0; + mContourIdx = 0; + mConcat2Idx = 0; + + mInputArray.fill(0.0f); +} + +int BasicPitchCNN::getNumFramesLookahead() +{ + return mTotalLookahead; +} + +void BasicPitchCNN::frameInference(const float* inData, + std::vector& outContours, + std::vector& outNotes, + std::vector& outOnsets) +{ + // Checks on parameters + assert(outContours.size() == NUM_FREQ_IN); + assert(outNotes.size() == NUM_FREQ_OUT); + assert(outOnsets.size() == NUM_FREQ_OUT); + + // Copy data in aligned input array for inference + std::copy(inData, inData + NUM_HARMONICS * NUM_FREQ_IN, mInputArray.begin()); + + _runModels(); + + // Fill output vectors + std::copy(mCNNOnsetOutput.getOutputs(), mCNNOnsetOutput.getOutputs() + NUM_FREQ_OUT, outOnsets.begin()); + + std::copy(mNotesCircularBuffer[(size_t) _wrapIndex(mNoteIdx + 1, mNumNoteStored)].begin(), + mNotesCircularBuffer[(size_t) _wrapIndex(mNoteIdx + 1, mNumNoteStored)].end(), + outNotes.begin()); + + std::copy(mContoursCircularBuffer[(size_t) _wrapIndex(mContourIdx + 1, mNumContourStored)].begin(), + mContoursCircularBuffer[(size_t) _wrapIndex(mContourIdx + 1, mNumContourStored)].end(), + outContours.begin()); + + // Increment index for different circular buffers + mContourIdx = (mContourIdx == mNumContourStored - 1) ? 0 : mContourIdx + 1; + mNoteIdx = (mNoteIdx == mNumNoteStored - 1) ? 0 : mNoteIdx + 1; + mConcat2Idx = (mConcat2Idx == mNumConcat2Stored - 1) ? 0 : mConcat2Idx + 1; +} + +void BasicPitchCNN::_runModels() +{ + // Run models and push results in appropriate circular buffer + mCNNOnsetInput.forward(mInputArray.data()); + std::copy(mCNNOnsetInput.getOutputs(), + mCNNOnsetInput.getOutputs() + 32 * NUM_FREQ_OUT, + mConcat2CircularBuffer[(size_t) mConcat2Idx].begin()); + + mCNNContour.forward(mInputArray.data()); + std::copy(mCNNContour.getOutputs(), + mCNNContour.getOutputs() + NUM_FREQ_IN, + mContoursCircularBuffer[(size_t) mContourIdx].begin()); + + mCNNNote.forward(mCNNContour.getOutputs()); + std::copy( + mCNNNote.getOutputs(), mCNNNote.getOutputs() + NUM_FREQ_OUT, mNotesCircularBuffer[(size_t) mNoteIdx].begin()); + + // Concat operation with correct frame shift + _concat(); + + mCNNOnsetOutput.forward(mConcatArray.data()); +} + +constexpr int BasicPitchCNN::_wrapIndex(int inIndex, int inSize) +{ + int wrapped_index = inIndex % inSize; + + if (wrapped_index < 0) { + wrapped_index += inSize; + } + + return wrapped_index; +} + +void BasicPitchCNN::_concat() +{ + auto concat2_index = (size_t) _wrapIndex(mConcat2Idx + 1, mNumConcat2Stored); + + for (size_t i = 0; i < NUM_FREQ_OUT; i++) { + mConcatArray[i * 33] = mCNNNote.getOutputs()[i]; + std::copy(mConcat2CircularBuffer[concat2_index].begin() + i * 32, + mConcat2CircularBuffer[concat2_index].begin() + (i + 1) * 32, + mConcatArray.begin() + i * 33 + 1); + } +} diff --git a/JammLab/Transcription/Native/Engine/BasicPitchCNN.h b/JammLab/Transcription/Native/Engine/BasicPitchCNN.h new file mode 100644 index 0000000..6d02b52 --- /dev/null +++ b/JammLab/Transcription/Native/Engine/BasicPitchCNN.h @@ -0,0 +1,122 @@ +// +// Created by Damien Ronssin on 03.03.23. +// + +#ifndef BasicPitchCNN_h +#define BasicPitchCNN_h + +#include + +#include "RTNeural/RTNeural.h" + +#include "BasicPitchConstants.h" + +/** + * Class to run basic pitch CNN with RTNeural + */ +class BasicPitchCNN +{ +public: + explicit BasicPitchCNN(const std::filesystem::path& modelDirectory); + + ~BasicPitchCNN() = default; + + /** + * Resets the internal state of the CNN. + */ + void reset(); + + /** + * @return The number of future lookahead of basic pitch cnn. + * It corresponds to the number of padded frames done left and right (in tensorflow for example) + * in order to have aligned input and output when running with valid padding. + */ + static int getNumFramesLookahead(); + + /** + * Run inference for a single frame. inData should have 8 * 264 elements + * @param inData input features (CQT harmonically stacked). + * @param outContours output vector for contour posteriorgrams. Size should be 264 + * @param outNotes output vector for note posteriorgrams. Size should be 88 + * @param outOnsets output vector for onset posteriorgrams. Size should be 88 + */ + void frameInference(const float* inData, + std::vector& outContours, + std::vector& outNotes, + std::vector& outOnsets); + +private: + /** + * Run different sequential models with correct time offset ... + */ + void _runModels(); + + /** + * Perform concat operation with correct time offset + */ + void _concat(); + + /** + * Return in-range index for given size as if periodic. + * @param inIndex maybe out of range index + * @param inSize Size of container + * @return Wrapped index (in-range) + */ + static constexpr int _wrapIndex(int inIndex, int inSize); + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) std::array mInputArray {}; + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) std::array mConcatArray {}; + + static constexpr int mLookaheadCNNContour = 3; + static constexpr int mLookaheadCNNNote = 6; + static constexpr int mLookaheadCNNOnsetInput = 2; + static constexpr int mLookaheadCNNOnsetOutput = 1; + static constexpr int mTotalLookahead = mLookaheadCNNContour + mLookaheadCNNNote + mLookaheadCNNOnsetOutput; + + static constexpr int mNumContourStored = mTotalLookahead - mLookaheadCNNContour + 1; + static constexpr int mNumNoteStored = mTotalLookahead - (mLookaheadCNNContour + mLookaheadCNNNote) + 1; + static constexpr int mNumConcat2Stored = mLookaheadCNNContour + mLookaheadCNNNote - mLookaheadCNNOnsetInput + 1; + + std::array, mNumContourStored> mContoursCircularBuffer {}; + std::array, mNumNoteStored> mNotesCircularBuffer {}; // Also concat 1 + std::array, mNumConcat2Stored> mConcat2CircularBuffer {}; + + int mContourIdx = 0; + int mNoteIdx = 0; + int mConcat2Idx = 0; + + RTNeural::ModelT, + RTNeural::ReLuActivationT, + RTNeural::Conv2DT, + RTNeural::SigmoidActivationT> + mCNNContour; + + RTNeural::ModelT, + RTNeural::ReLuActivationT, + RTNeural::Conv2DT, + RTNeural::SigmoidActivationT> + mCNNNote; + + RTNeural::ModelT, + RTNeural::ReLuActivationT> + mCNNOnsetInput; + + RTNeural::ModelT, + RTNeural::SigmoidActivationT> + mCNNOnsetOutput; +}; + +#endif // BasicPitchCNN_h diff --git a/JammLab/Transcription/Native/Engine/BasicPitchConstants.h b/JammLab/Transcription/Native/Engine/BasicPitchConstants.h new file mode 100644 index 0000000..03806b0 --- /dev/null +++ b/JammLab/Transcription/Native/Engine/BasicPitchConstants.h @@ -0,0 +1,27 @@ +// +// Created by Damien Ronssin on 04.03.23. +// + +#ifndef NN_CONSTANTS_H +#define NN_CONSTANTS_H + +static constexpr int NUM_HARMONICS = 8; +static constexpr int NUM_FREQ_IN = 264; +static constexpr int NUM_FREQ_OUT = 88; +static constexpr double BASIC_PITCH_SAMPLE_RATE = 22050.0; + +static constexpr int MIDI_OFFSET = 21; +static constexpr int FFT_HOP = 256; +static constexpr int AUDIO_SAMPLE_RATE = 22050; +static constexpr int MAX_NOTE_IDX = 87; +// duration in seconds of training examples - original 1 +static constexpr int AUDIO_WINDOW_LENGTH = 2; + +// lowest key on a piano +static constexpr float ANNOTATIONS_BASE_FREQUENCY = 27.5; +static constexpr int CONTOURS_BINS_PER_SEMITONE = 3; + +static constexpr int MIN_MIDI_NOTE = 21; +static constexpr int MAX_MIDI_NOTE = 108; + +#endif //NN_CONSTANTS_H diff --git a/JammLab/Transcription/Native/Engine/Features.cpp b/JammLab/Transcription/Native/Engine/Features.cpp new file mode 100644 index 0000000..cbd5d37 --- /dev/null +++ b/JammLab/Transcription/Native/Engine/Features.cpp @@ -0,0 +1,45 @@ +// +// Created by Damien Ronssin on 04.03.23. +// + +#include "Features.h" + +#include + +Features::Features(const std::filesystem::path& modelPath) + : mMemoryInfo(nullptr) + , mSession(nullptr) +{ + if (!std::filesystem::is_regular_file(modelPath)) { + throw std::runtime_error("Basic Pitch feature model is missing"); + } + + mMemoryInfo = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU); + + mSessionOptions.SetInterOpNumThreads(1); + mSessionOptions.SetIntraOpNumThreads(1); + + mSession = Ort::Session(mEnv, modelPath.c_str(), mSessionOptions); +} + +const float* Features::computeFeatures(float* inAudio, size_t inNumSamples, size_t& outNumFrames) +{ + mInputShape[0] = 1; + mInputShape[1] = static_cast(inNumSamples); + mInputShape[2] = 1; + + mInput.clear(); + mInput.push_back( + Ort::Value::CreateTensor(mMemoryInfo, inAudio, inNumSamples, mInputShape.data(), mInputShape.size())); + + mOutput = mSession.Run(mRunOptions, mInputNames, mInput.data(), 1, mOutputNames, 1); + + auto out_shape = mOutput[0].GetTensorTypeAndShapeInfo().GetShape(); + assert(out_shape[0] == 1 && out_shape[2] == NUM_FREQ_IN && out_shape[3] == NUM_HARMONICS); + + outNumFrames = static_cast(out_shape[1]); + + mInput.clear(); + + return mOutput[0].GetTensorData(); +} diff --git a/JammLab/Transcription/Native/Engine/Features.h b/JammLab/Transcription/Native/Engine/Features.h new file mode 100644 index 0000000..42d793a --- /dev/null +++ b/JammLab/Transcription/Native/Engine/Features.h @@ -0,0 +1,54 @@ +// +// Created by Damien Ronssin on 04.03.23. +// + +#ifndef Features_h +#define Features_h + +#include +#include +#include +#include +#include + +#include "BasicPitchConstants.h" + +/** + * Class to compute the CQT and harmonically stack those. Output of this can be given as input to Basic Pitch cnn. + */ +class Features +{ +public: + explicit Features(const std::filesystem::path& modelPath); + + ~Features() = default; + + /** + * Compute features for full audio signal + * @param inAudio Input audio. Should contain inNumSamples + * @param inNumSamples Number of samples in inAudio + * @param outNumFrames Number of frames that have been computed. + * @return Pointer to features. + */ + const float* computeFeatures(float* inAudio, size_t inNumSamples, size_t& outNumFrames); + +private: + // ONNX Runtime Data + std::vector mInput; + std::vector mOutput; + + std::array mInputShape; + + // Input and output names of model + const char* mInputNames[1] = {"input_1"}; + const char* mOutputNames[1] = {"harmonic_stacking"}; + + // ONNX Runtime + Ort::MemoryInfo mMemoryInfo; + Ort::SessionOptions mSessionOptions; + Ort::Env mEnv; + Ort::Session mSession; + Ort::RunOptions mRunOptions; +}; + +#endif // Features_h diff --git a/JammLab/Transcription/Native/Engine/Notes.cpp b/JammLab/Transcription/Native/Engine/Notes.cpp new file mode 100644 index 0000000..a815c32 --- /dev/null +++ b/JammLab/Transcription/Native/Engine/Notes.cpp @@ -0,0 +1,284 @@ +// +// Created by Tibor Vass on 04.03.23. +// + +#include "Notes.h" + +bool Notes::Event::operator==(const Notes::Event& other) const +{ + return this->startTime == other.startTime && this->endTime == other.endTime && this->startFrame == other.startFrame + && this->endFrame == other.endFrame && this->pitch == other.pitch && this->amplitude == other.amplitude + && this->bends == other.bends; +} + +std::vector Notes::convert(const std::vector>& inNotesPG, + const std::vector>& inOnsetsPG, + const std::vector>& inContoursPG, + const ConvertParams& inParams, + bool inNewAudio) +{ + std::vector events; + events.reserve(1024); + + const auto n_frames = static_cast(inNotesPG.size()); + if (n_frames == 0) { + return events; + } + + const auto n_notes = static_cast(inNotesPG[0].size()); + assert(n_frames == inOnsetsPG.size()); + assert(n_frames == inContoursPG.size()); + assert(n_notes == inOnsetsPG[0].size()); + assert(n_notes == NUM_FREQ_OUT); + + std::vector> inferred_onsets; + auto onsets_ptr = &inOnsetsPG; + if (inParams.inferOnsets) { + inferred_onsets = _inferredOnsets(inOnsetsPG, inNotesPG); + onsets_ptr = &inferred_onsets; + } + auto& onsets = *onsets_ptr; + + if (inNewAudio) { + mRemainingEnergy = inNotesPG; + } else { + // Copy without changing the location of the original data + assert(mRemainingEnergy.size() == n_frames); + for (size_t f = 0; f < n_frames; f++) { + assert(inNotesPG[f].size() == NUM_FREQ_OUT); + assert(mRemainingEnergy[f].size() == NUM_FREQ_OUT); + + std::copy(inNotesPG[f].begin(), inNotesPG[f].end(), mRemainingEnergy[f].begin()); + } + } + + if (inParams.melodiaTrick) { + if (inNewAudio) { + // Fill mRemainingEnergyIndex + mRemainingEnergyIndex.clear(); + mRemainingEnergyIndex.reserve(static_cast(n_frames) * static_cast(NUM_FREQ_OUT)); + + for (int frame_idx = 0; frame_idx < n_frames; frame_idx++) { + for (int freq_idx = 0; freq_idx < NUM_FREQ_OUT; freq_idx++) { + mRemainingEnergyIndex.push_back( + {&mRemainingEnergy[static_cast(frame_idx)][static_cast(freq_idx)], + frame_idx, + freq_idx}); + } + } + + mRemainingEnergyIndex.shrink_to_fit(); + } + } + + const auto frame_threshold = inParams.frameThreshold; + // TODO: infer frame_threshold if < 0, can be merged with inferredOnsets. + + // constrain frequencies + const auto max_note_idx = + inParams.maxFrequency < 0 ? n_notes - 1 : NoteUtils::hzToMidi(inParams.maxFrequency) - MIDI_OFFSET; + const auto min_note_idx = inParams.minFrequency < 0 ? 0 : NoteUtils::hzToMidi(inParams.minFrequency) - MIDI_OFFSET; + + // stop 1 frame early to prevent edge case + // as per https://github.com/spotify/basic-pitch/blob/f85a8e9ade1f297b8adb39b155c483e2312e1aca/basic_pitch/note_creation.py#L399 + const int last_frame = n_frames - 1; + + // Go backwards in time + for (int frame_idx = last_frame - 1; frame_idx >= 0; frame_idx--) { + for (int note_idx = max_note_idx; note_idx >= min_note_idx; note_idx--) { + auto onset = onsets[frame_idx][note_idx]; + + // equivalent to argrelmax logic + auto prev = frame_idx <= 0 ? onset : onsets[frame_idx - 1][note_idx]; + auto next = frame_idx >= last_frame ? onset : onsets[frame_idx + 1][note_idx]; + + if (onset < inParams.onsetThreshold || onset < prev || onset < next) { + continue; + } + + // find time index at this frequency band where the frames drop below an energy threshold + int i = frame_idx + 1; + int k = 0; // number of frames since energy dropped below threshold + while (i < last_frame && k < inParams.energyThreshold) { + if (mRemainingEnergy[i][note_idx] < frame_threshold) { + k++; + } else { + k = 0; + } + i++; + } + + i -= k; // go back to frame above threshold + + // if the note is too short, skip it + if (i - frame_idx <= inParams.minNoteLength) { + continue; + } + + double amplitude = 0.0; + for (int f = frame_idx; f < i; f++) { + amplitude += mRemainingEnergy[f][note_idx]; + mRemainingEnergy[f][note_idx] = 0; + + if (note_idx < MAX_NOTE_IDX) { + mRemainingEnergy[f][note_idx + 1] = 0; + } + if (note_idx > 0) { + mRemainingEnergy[f][note_idx - 1] = 0; + } + } + + amplitude /= (i - frame_idx); + + events.push_back(Event { + _modelFrameToTime(frame_idx) /* startTime */, + _modelFrameToTime(i) /* endTime */, + frame_idx /* startFrame */, + i /* endFrame */, + note_idx + MIDI_OFFSET /* pitch */, + amplitude /* amplitude */, + }); + } + } + + if (inParams.melodiaTrick) { + std::sort(mRemainingEnergyIndex.begin(), + mRemainingEnergyIndex.end(), + [](const _pg_index& a, const _pg_index& b) { return *a.value > *b.value; }); + + // loop through each remaining note probability in descending order + // until reaching frame_threshold. + for (auto& [energy_ptr, frame_idx, note_idx]: mRemainingEnergyIndex) { + auto& energy = *energy_ptr; + + // skip those that have already been zeroed + if (energy == 0.0f) { + continue; + } + + if (energy <= frame_threshold) { + break; + } + energy = 0; + + // this inhibit function zeroes out neighbor notes and keeps track (with k) + // on how many consecutive frames were below frame_threshold. + auto inhibit = [frame_threshold](std::vector>& pg, int frame_i, int note_i, int k) { + if (pg[frame_i][note_i] < frame_threshold) { + k++; + } else { + k = 0; + } + + pg[frame_i][note_i] = 0; + if (note_i < MAX_NOTE_IDX) { + pg[frame_i][note_i + 1] = 0; + } + if (note_i > 0) { + pg[frame_i][note_i - 1] = 0; + } + return k; + }; + + // forward pass + int i = frame_idx + 1; + int k = 0; + while (i < last_frame && k < inParams.energyThreshold) { + k = inhibit(mRemainingEnergy, i, note_idx, k); + i++; + } + + const auto i_end = i - 1 - k; + + // backward pass + i = frame_idx - 1; + k = 0; + while (i > 0 && k < inParams.energyThreshold) { + k = inhibit(mRemainingEnergy, i, note_idx, k); + i--; + } + + const auto i_start = i + 1 + k; + + // if the note is too short, skip it + if (i_end - i_start <= inParams.minNoteLength) { + continue; + } + + double amplitude = 0.0; + for (i = i_start; i < i_end; i++) { + amplitude += inNotesPG[i][note_idx]; + } + amplitude /= (i_end - i_start); + + events.push_back(Event { + _modelFrameToTime(i_start /* startTime */), + _modelFrameToTime(i_end) /* endTime */, + i_start /* startFrame */, + i_end /* endFrame */, + note_idx + MIDI_OFFSET /* pitch */, + amplitude /* amplitude */, + }); + } + } + + sortEvents(events); + + if (inParams.pitchBend != NoPitchBend) { + _addPitchBends(events, inContoursPG); + if (inParams.pitchBend == SinglePitchBend) { + dropOverlappingPitchBends(events); + } + } + + return events; +} + +void Notes::clear() +{ + mRemainingEnergy.clear(); + mRemainingEnergy.shrink_to_fit(); + + mRemainingEnergyIndex.clear(); + mRemainingEnergyIndex.shrink_to_fit(); +} + +void Notes::_addPitchBends(std::vector& inOutEvents, + const std::vector>& inContoursPG, + int inNumBinsTolerance) +{ + for (auto& event: inOutEvents) { + // midi_pitch_to_contour_bin + int note_idx = + CONTOURS_BINS_PER_SEMITONE + * (event.pitch - 69 + 12 * static_cast(std::round(std::log2(440.0f / ANNOTATIONS_BASE_FREQUENCY)))); + + static constexpr int N_FREQ_BINS_CONTOURS = NUM_FREQ_OUT * CONTOURS_BINS_PER_SEMITONE; + int note_start_idx = std::max(note_idx - inNumBinsTolerance, 0); + int note_end_idx = std::min(N_FREQ_BINS_CONTOURS, note_idx + inNumBinsTolerance + 1); + + const auto gauss_start = static_cast(std::max(0, inNumBinsTolerance - note_idx)); + const auto pb_shift = inNumBinsTolerance - std::max(0, inNumBinsTolerance - note_idx); + + for (int i = event.startFrame; i < event.endFrame; i++) { + int bend = 0; + float max = 0; + for (int j = note_start_idx; j < note_end_idx; j++) { + int k = j - note_start_idx; + float x = gauss_start + static_cast(k); + float n = x - static_cast(inNumBinsTolerance); + + static constexpr float std = 5.0f; + + // Gaussian + float w = std::exp(-(n * n) / (2.0f * std * std)) * inContoursPG[i][j]; + + if (w > max) { + bend = k; + max = w; + } + } + event.bends.emplace_back(bend - pb_shift); + } + } +} \ No newline at end of file diff --git a/JammLab/Transcription/Native/Engine/Notes.h b/JammLab/Transcription/Native/Engine/Notes.h new file mode 100644 index 0000000..977091f --- /dev/null +++ b/JammLab/Transcription/Native/Engine/Notes.h @@ -0,0 +1,272 @@ +// +// Created by Tibor Vass on 04.03.23. +// + +#ifndef Notes_h +#define Notes_h + +#include +#include +#include + +#include "BasicPitchConstants.h" + +namespace NoteUtils +{ +static inline int hzToMidi(float hz) +{ + return static_cast(std::round(12.0f * std::log2(hz / 440.0f) + 69.0f)); +} +} // namespace NoteUtils + +enum PitchBendModes { NoPitchBend = 0, SinglePitchBend, MultiPitchBend }; + +/** + * Class to extract note events from posteriorgrams (outputs of basic pitch cnn). + */ +class Notes +{ +public: + typedef struct Event { + double startTime; + double endTime; + int startFrame; + int endFrame; + int pitch; // pitch is not in Hz, but in "MIDI note number" + double amplitude; + std::vector bends; // One vale of pitch bend per frame. Units is 1/3 of semitones. + + bool operator==(const struct Event&) const; + } Event; + + typedef struct ConvertParams { + /* Note segmentation (0.05 - 0.95, Split-Merge Notes) */ + float onsetThreshold = 0.3; + /* Confidence threshold (0.05 to 0.95, More-Less notes) */ + float frameThreshold = 0.5; + /* Minimum note length in number of frames */ + int minNoteLength = 11; + bool inferOnsets = true; + float maxFrequency = -1; // in Hz, -1 means unset + float minFrequency = -1; // in Hz, -1 means unset + bool melodiaTrick = true; + PitchBendModes pitchBend = NoPitchBend; + int energyThreshold = 11; + } ConvertParams; + + /** + * Create note events based on postegriorgram inputs + * @param inNotesPG Note posteriorgrams + * @param inOnsetsPG Onset posteriorgrams + * @param inContoursPG Contour posteriorgrams + * @param inParams input parameters + * @param inNewAudio True: first time calling this function with this audio (these inNotesPG, inOnsetsPG, inContoursPG). + * False if same audio as last time with updated parameters. + * @return + */ + std::vector convert(const std::vector>& inNotesPG, + const std::vector>& inOnsetsPG, + const std::vector>& inContoursPG, + const ConvertParams& inParams, + bool inNewAudio); + + /** + * Release any memory allocated by the class. + */ + void clear(); + + /** + * Inplace sort of note events. + * @param inOutEvents + */ + static inline void sortEvents(std::vector& inOutEvents) + { + std::sort(inOutEvents.begin(), inOutEvents.end(), [](const Event& a, const Event& b) { + return a.startFrame < b.startFrame || (a.startFrame == b.startFrame && a.endFrame < b.endFrame); + }); + } + + /** + * dropOverlappingPitchBends sets bends to an empty array to all the note events that are overlapping in time. + * inOutEvents is expected to be sorted. + * @param inOutEvents + */ + static void dropOverlappingPitchBends(std::vector& inOutEvents) + { + for (int i = 0; i < int(inOutEvents.size()) - 1; i++) { + auto& event = inOutEvents[i]; + // if there is an overlap between events, remove pitch bends + for (int j = i + 1; j < inOutEvents.size(); j++) { + auto& event2 = inOutEvents[j]; + if (event2.startFrame >= event.endFrame) { + break; + } + event.bends = std::vector(); + event2.bends = std::vector(); + } + } + } + + /** + * mergeOverlappingNotes merges note events of same pitch that are overlapping in time. + * inOutEvents is expected to be sorted. + * @param inOutEvents + */ + static void mergeOverlappingNotesWithSamePitch(std::vector& inOutEvents) + { + sortEvents(inOutEvents); + for (int i = 0; i < int(inOutEvents.size()) - 1; i++) { + auto& event = inOutEvents[i]; + for (auto j = i + 1; j < inOutEvents.size(); j++) { + auto& event2 = inOutEvents[j]; + + // If notes don't overlap, break + if (event2.startFrame >= event.endFrame) { + break; + } + + // If notes overlap and have the same pitch: merge them + if (event.pitch == event2.pitch) { + event.endTime = event2.endTime; + event.endFrame = event2.endFrame; + inOutEvents.erase(inOutEvents.begin() + j); + } + } + } + } + +private: + /** + * Add pitch bend vector to note events. + * @param inOutEvents event vector (input and output) + * @param inContoursPG Contour posteriorgram matrix + * @param inNumBinsTolerance + */ + static void _addPitchBends(std::vector& inOutEvents, + const std::vector>& inContoursPG, + int inNumBinsTolerance = 25); + + /** + * Get time in seconds given frame index. + * Different behaviour in test because of weirdness in basic-pitch code + * @param frame Index of frame. + * @return Corresponding time in seconds. + */ + static inline double _modelFrameToTime(int frame) + { + // The following are compile-time computed consts only used here. + // If they need to be used elsewhere, please move to Constants.h + + static constexpr int ANNOTATIONS_FPS = AUDIO_SAMPLE_RATE / FFT_HOP; + // number of frames in the time-frequency representations we compute + static constexpr int ANNOT_N_FRAMES = ANNOTATIONS_FPS * AUDIO_WINDOW_LENGTH; + // number of samples in the (clipped) audio that we use as input to the models + static constexpr int AUDIO_N_SAMPLES = AUDIO_SAMPLE_RATE * AUDIO_WINDOW_LENGTH - FFT_HOP; + // magic from Basic Pitch + static constexpr double WINDOW_OFFSET = + (double) FFT_HOP / AUDIO_SAMPLE_RATE * (ANNOT_N_FRAMES - AUDIO_N_SAMPLES / (double) FFT_HOP) + 0.0018; + + // Weird stuff from Basic Pitch. Use only in test so they can pass. +#if USE_TEST_NOTE_FRAME_TO_TIME + return (frame * FFT_HOP) / (double) (AUDIO_SAMPLE_RATE) -WINDOW_OFFSET * (frame / ANNOT_N_FRAMES); +#else + return (frame * FFT_HOP) / (double) (AUDIO_SAMPLE_RATE); +#endif + } + + /** + * Returns a version of inOnsetsPG augmented by detecting differences in note posteriorgrams + * across frames separated by varying offsets (up to inNumDiffs). + * @tparam T + * @param inOnsetsPG Onset posteriorgrams + * @param inNotesPG Note posteriorgrams + * @param inNumDiffs max varying offset. + * @return + */ + // TODO: change to float + template + static std::vector> _inferredOnsets(const std::vector>& inOnsetsPG, + const std::vector>& inNotesPG, + int inNumDiffs = 2) + { + auto n_frames = inNotesPG.size(); + auto n_notes = inNotesPG[0].size(); + + // The algorithm starts by calculating a diff of note posteriorgrams, hence the name notes_diff. + // This same variable will later morph into the inferred onsets output + // notes_diff needs to be initialized to all 1 to not interfere with minima + // calculations, assuming all values in inNotesPG are probabilities < 1. + auto notes_diff = std::vector>(n_frames, std::vector(n_notes, 1)); + + // max of minima of notes_diff + T max_min_notes_diff = 0; + // max of onsets + T max_onset = 0; + + // for each frame offset + for (int n = 0; n < inNumDiffs; n++) { + auto offset = n + 1; + // for each frame + for (int i = 0; i < n_frames; i++) { + // frame index slided back by offset + auto i_behind = i - offset; + // for each note + for (int j = 0; j < n_notes; j++) { + // calculate the difference in note probabilities between frame i and + // frame i_behind (the frame behind by offset). + auto diff = inNotesPG[i][j] - ((i_behind >= 0) ? inNotesPG[i_behind][j] : 0); + + // Basic Pitch calculates the minimum amongst positive and negative + // diffs instead of ignoring negative diffs (which mean "end of note") + // while we are only looking for "start of note" (aka onset). + // TODO: the zeroing of negative diff should probably happen before + // searching for minimum + auto& min = notes_diff[i][j]; + if (diff < min) { + diff = (diff < 0) ? 0 : diff; + // https://github.com/spotify/basic-pitch/blob/86fc60dab06e3115758eb670c92ead3b62a89b47/basic_pitch/note_creation.py#L298 + min = (i >= inNumDiffs) ? diff : 0; + } + + // if last diff, max_min_notes_diff can be computed + if (offset == inNumDiffs) { + auto onset = inOnsetsPG[i][j]; + if (onset > max_onset) { + max_onset = onset; + } + if (min > max_min_notes_diff) { + max_min_notes_diff = min; + } + } + } + } + } + + // Rescale notes_diff in-place to match scale of original onsets + // and choose the element-wise max between it and the original onsets. + // This is where notes_diff morphs truly into the inferred onsets. + for (int i = 0; i < n_frames; i++) { + for (int j = 0; j < n_notes; j++) { + auto& inferred = notes_diff[i][j]; + inferred = max_onset * inferred / max_min_notes_diff; + auto orig = inOnsetsPG[i][j]; + if (orig > inferred) { + inferred = orig; + } + } + } + + return notes_diff; + } + + struct _pg_index { + float* value; + int frameIdx; + int noteIdx; + }; + + std::vector> mRemainingEnergy; + std::vector<_pg_index> mRemainingEnergyIndex; +}; + +#endif // Notes_h diff --git a/JammLab/Transcription/Native/Engine/Utils.h b/JammLab/Transcription/Native/Engine/Utils.h new file mode 100644 index 0000000..f31eb29 --- /dev/null +++ b/JammLab/Transcription/Native/Engine/Utils.h @@ -0,0 +1,18 @@ +// +// Created by Tibor Vass on 07.03.23. +// + +#ifndef Utils_h +#define Utils_h + +#include +#include + +static int safe_divide(int a, int b) +{ + auto res = std::div(a, b); + assert(res.rem == 0); + return res.quot; +} + +#endif // Utils_h diff --git a/JammLab/Transcription/Native/JMBasicPitchBridge.h b/JammLab/Transcription/Native/JMBasicPitchBridge.h new file mode 100644 index 0000000..a86de86 --- /dev/null +++ b/JammLab/Transcription/Native/JMBasicPitchBridge.h @@ -0,0 +1,63 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +FOUNDATION_EXPORT NSErrorDomain const JMTranscriptionErrorDomain; + +typedef NS_ERROR_ENUM(JMTranscriptionErrorDomain, JMTranscriptionErrorCode) { + JMTranscriptionErrorCodeEmptyInput = 1, + JMTranscriptionErrorCodeUnsupportedSampleRate, + JMTranscriptionErrorCodeAudioReadFailed, + JMTranscriptionErrorCodeModelResourceMissing, + JMTranscriptionErrorCodeModelInitializationFailed, + JMTranscriptionErrorCodeInferenceFailed, + JMTranscriptionErrorCodeInvalidModelOutput, + JMTranscriptionErrorCodeCancelled +}; + +@interface JMTranscriptionConfiguration : NSObject +@property(nonatomic) float noteSensitivity; +@property(nonatomic) float splitSensitivity; +@property(nonatomic) float minimumNoteDurationMilliseconds; +@property(nonatomic) BOOL includePitchBends; +@property(nonatomic) double windowDurationSeconds; +@property(nonatomic) double overlapDurationSeconds; +@end + +@interface JMTranscriptionNote : NSObject +@property(nonatomic, readonly) NSInteger pitch; +@property(nonatomic, readonly) double startTimeSeconds; +@property(nonatomic, readonly) double endTimeSeconds; +@property(nonatomic, readonly) double confidence; +@property(nonatomic, copy, readonly) NSArray *pitchBends; +@end + +@interface JMTranscriptionTimings : NSObject +@property(nonatomic, readonly) double modelLoadSeconds; +@property(nonatomic, readonly) double inferenceSeconds; +@property(nonatomic, readonly) double postProcessingSeconds; +@property(nonatomic, readonly) double totalSeconds; +@end + +@interface JMTranscriptionResult : NSObject +@property(nonatomic, copy, readonly) NSArray *notes; +@property(nonatomic, readonly) double processedDurationSeconds; +@property(nonatomic, copy, readonly) NSArray *warnings; +@property(nonatomic, strong, readonly) JMTranscriptionTimings *timings; +@end + +@interface JMTranscriptionCancellationToken : NSObject +- (void)cancel; +@end + +@interface JMBasicPitchBridge : NSObject +- (nullable JMTranscriptionResult *)transcribePCMFileAtURL:(NSURL *)fileURL + sampleCount:(NSUInteger)sampleCount + sampleRate:(double)sampleRate + configuration:(JMTranscriptionConfiguration *)configuration + cancellationToken:(JMTranscriptionCancellationToken *)cancellationToken + progress:(void (^ _Nullable)(double progress))progress + error:(NSError **)error; +@end + +NS_ASSUME_NONNULL_END diff --git a/JammLab/Transcription/Native/JMBasicPitchBridge.mm b/JammLab/Transcription/Native/JMBasicPitchBridge.mm new file mode 100644 index 0000000..260d0d3 --- /dev/null +++ b/JammLab/Transcription/Native/JMBasicPitchBridge.mm @@ -0,0 +1,305 @@ +#import "JMBasicPitchBridge.h" + +#include "BasicPitchTranscriptionEngine.h" + +#include +#include +#include +#include + +NSErrorDomain const JMTranscriptionErrorDomain = @"com.jammlab.transcription"; + +@implementation JMTranscriptionConfiguration + +- (instancetype)init +{ + self = [super init]; + if (self) { + _noteSensitivity = 0.7f; + _splitSensitivity = 0.5f; + _minimumNoteDurationMilliseconds = 125.0f; + _includePitchBends = NO; + _windowDurationSeconds = 30.0; + _overlapDurationSeconds = 2.0; + } + return self; +} + +@end + +@interface JMTranscriptionNote () +- (instancetype)initWithPitch:(NSInteger)pitch + startTimeSeconds:(double)startTimeSeconds + endTimeSeconds:(double)endTimeSeconds + confidence:(double)confidence + pitchBends:(NSArray *)pitchBends; +@end + +@implementation JMTranscriptionNote + +- (instancetype)initWithPitch:(NSInteger)pitch + startTimeSeconds:(double)startTimeSeconds + endTimeSeconds:(double)endTimeSeconds + confidence:(double)confidence + pitchBends:(NSArray *)pitchBends +{ + self = [super init]; + if (self) { + _pitch = pitch; + _startTimeSeconds = startTimeSeconds; + _endTimeSeconds = endTimeSeconds; + _confidence = confidence; + _pitchBends = [pitchBends copy]; + } + return self; +} + +@end + +@interface JMTranscriptionTimings () +- (instancetype)initWithModelLoadSeconds:(double)modelLoadSeconds + inferenceSeconds:(double)inferenceSeconds + postProcessingSeconds:(double)postProcessingSeconds + totalSeconds:(double)totalSeconds; +@end + +@implementation JMTranscriptionTimings + +- (instancetype)initWithModelLoadSeconds:(double)modelLoadSeconds + inferenceSeconds:(double)inferenceSeconds + postProcessingSeconds:(double)postProcessingSeconds + totalSeconds:(double)totalSeconds +{ + self = [super init]; + if (self) { + _modelLoadSeconds = modelLoadSeconds; + _inferenceSeconds = inferenceSeconds; + _postProcessingSeconds = postProcessingSeconds; + _totalSeconds = totalSeconds; + } + return self; +} + +@end + +@interface JMTranscriptionResult () +- (instancetype)initWithNotes:(NSArray *)notes + processedDurationSeconds:(double)processedDurationSeconds + warnings:(NSArray *)warnings + timings:(JMTranscriptionTimings *)timings; +@end + +@implementation JMTranscriptionResult + +- (instancetype)initWithNotes:(NSArray *)notes + processedDurationSeconds:(double)processedDurationSeconds + warnings:(NSArray *)warnings + timings:(JMTranscriptionTimings *)timings +{ + self = [super init]; + if (self) { + _notes = [notes copy]; + _processedDurationSeconds = processedDurationSeconds; + _warnings = [warnings copy]; + _timings = timings; + } + return self; +} + +@end + +@interface JMTranscriptionCancellationToken () { +@public + std::atomic_bool _cancelled; +} +@end + +@implementation JMTranscriptionCancellationToken + +- (instancetype)init +{ + self = [super init]; + if (self) { + _cancelled.store(false); + } + return self; +} + +- (void)cancel +{ + _cancelled.store(true); +} + +@end + +namespace +{ +JMTranscriptionErrorCode errorCode(jammlab::transcription::ErrorCode code) +{ + using NativeCode = jammlab::transcription::ErrorCode; + switch (code) { + case NativeCode::emptyInput: + return JMTranscriptionErrorCodeEmptyInput; + case NativeCode::unsupportedSampleRate: + return JMTranscriptionErrorCodeUnsupportedSampleRate; + case NativeCode::audioReadFailed: + return JMTranscriptionErrorCodeAudioReadFailed; + case NativeCode::modelResourceMissing: + return JMTranscriptionErrorCodeModelResourceMissing; + case NativeCode::modelInitializationFailed: + return JMTranscriptionErrorCodeModelInitializationFailed; + case NativeCode::inferenceFailed: + return JMTranscriptionErrorCodeInferenceFailed; + case NativeCode::invalidModelOutput: + return JMTranscriptionErrorCodeInvalidModelOutput; + case NativeCode::cancelled: + return JMTranscriptionErrorCodeCancelled; + } +} + +NSArray *pitchBends(const std::vector& nativeBends) +{ + NSMutableArray *values = [NSMutableArray arrayWithCapacity:nativeBends.size()]; + for (const auto bend: nativeBends) { + [values addObject:@(bend)]; + } + return values; +} +} // namespace + +@interface JMBasicPitchBridge () { + std::unique_ptr _engine; + std::mutex _engineMutex; +} +@end + +@implementation JMBasicPitchBridge + +- (nullable JMTranscriptionResult *)transcribePCMFileAtURL:(NSURL *)fileURL + sampleCount:(NSUInteger)sampleCount + sampleRate:(double)sampleRate + configuration:(JMTranscriptionConfiguration *)configuration + cancellationToken:(JMTranscriptionCancellationToken *)cancellationToken + progress:(void (^ _Nullable)(double progress))progress + error:(NSError **)error +{ + std::lock_guard lock(_engineMutex); + + if (cancellationToken->_cancelled.load()) { + if (error != nullptr) { + *error = [NSError errorWithDomain:JMTranscriptionErrorDomain + code:JMTranscriptionErrorCodeCancelled + userInfo:@{NSLocalizedDescriptionKey: @"Transcription was cancelled."}]; + } + return nil; + } + + NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"features_model" + withExtension:@"ort" + subdirectory:@"BasicPitchModel"]; + if (modelURL == nil) { + if (error != nullptr) { + *error = [NSError errorWithDomain:JMTranscriptionErrorDomain + code:JMTranscriptionErrorCodeModelResourceMissing + userInfo:@{NSLocalizedDescriptionKey: @"The built-in Basic Pitch model is missing."}]; + } + return nil; + } + + try { + if (!_engine) { + const auto modelDirectory = std::filesystem::path( + modelURL.URLByDeletingLastPathComponent.fileSystemRepresentation + ); + _engine = std::make_unique(modelDirectory); + } + if (cancellationToken->_cancelled.load()) { + throw jammlab::transcription::Error( + jammlab::transcription::ErrorCode::cancelled, + "Transcription was cancelled" + ); + } + + jammlab::transcription::Configuration nativeConfiguration; + nativeConfiguration.noteSensitivity = configuration.noteSensitivity; + nativeConfiguration.splitSensitivity = configuration.splitSensitivity; + nativeConfiguration.minimumNoteDurationMilliseconds = + configuration.minimumNoteDurationMilliseconds; + nativeConfiguration.includePitchBends = configuration.includePitchBends; + nativeConfiguration.windowDurationSeconds = configuration.windowDurationSeconds; + nativeConfiguration.overlapDurationSeconds = configuration.overlapDurationSeconds; + + bool receivedCancellationProbe = false; + const auto nativeResult = _engine->transcribePCMFile( + std::filesystem::path(fileURL.fileSystemRepresentation), + sampleCount, + sampleRate, + nativeConfiguration, + [&](double value) { + if (cancellationToken->_cancelled.load()) { + return false; + } + // The engine's first callback is a pre-model-load cancellation + // probe. Keep the Swift UI in loadingModel until the next + // callback, which is emitted immediately before inference. + if (receivedCancellationProbe && progress) { + progress(value); + } + receivedCancellationProbe = true; + return !cancellationToken->_cancelled.load(); + } + ); + + NSMutableArray *notes = + [NSMutableArray arrayWithCapacity:nativeResult.notes.size()]; + for (const auto& note: nativeResult.notes) { + [notes addObject:[[JMTranscriptionNote alloc] + initWithPitch:note.pitch + startTimeSeconds:note.startTimeSeconds + endTimeSeconds:note.endTimeSeconds + confidence:note.confidence + pitchBends:pitchBends(note.pitchBends)]]; + } + + NSMutableArray *warnings = + [NSMutableArray arrayWithCapacity:nativeResult.warnings.size()]; + for (const auto& warning: nativeResult.warnings) { + [warnings addObject:[NSString stringWithUTF8String:warning.c_str()]]; + } + + const auto& timings = nativeResult.timings; + JMTranscriptionTimings *objectiveTimings = [[JMTranscriptionTimings alloc] + initWithModelLoadSeconds:timings.modelLoadSeconds + inferenceSeconds:timings.inferenceSeconds + postProcessingSeconds:timings.postProcessingSeconds + totalSeconds:timings.totalSeconds]; + return [[JMTranscriptionResult alloc] + initWithNotes:notes + processedDurationSeconds:nativeResult.processedDurationSeconds + warnings:warnings + timings:objectiveTimings]; + } catch (const jammlab::transcription::Error& exception) { + if (error != nullptr) { + *error = [NSError errorWithDomain:JMTranscriptionErrorDomain + code:errorCode(exception.code()) + userInfo:@{ + NSLocalizedDescriptionKey: + [NSString stringWithUTF8String:exception.what()] + }]; + } + return nil; + } catch (const std::exception& exception) { + if (error != nullptr) { + *error = [NSError errorWithDomain:JMTranscriptionErrorDomain + code:JMTranscriptionErrorCodeInferenceFailed + userInfo:@{ + NSLocalizedDescriptionKey: + [NSString stringWithUTF8String:exception.what()] + }]; + } + return nil; + } + return nil; +} + +@end diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/CMakeLists.txt b/JammLab/Transcription/Native/ThirdParty/RTNeural/CMakeLists.txt new file mode 100755 index 0000000..81c15df --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/CMakeLists.txt @@ -0,0 +1,57 @@ +add_library(RTNeural STATIC + activation/activation.h + activation/activation_eigen.h + activation/activation_xsimd.h + Model.h + Layer.h + conv1d/conv1d.h + conv1d/conv1d.tpp + conv1d_stateless/conv1d_stateless.h + conv1d_stateless/conv1d_stateless.tpp + conv1d_stateless/conv1d_stateless_eigen.h + conv1d_stateless/conv1d_stateless_eigen.h + conv2d/conv2d.h + conv2d/conv2d.tpp + conv2d/conv2d_eigen.h + conv2d/conv2d_eigen.tpp + dense/dense.h + dense/dense_eigen.h + dense/dense_xsimd.h + gru/gru.h + gru/gru.tpp + gru/gru_eigen.h + gru/gru_eigen.tpp + gru/gru_xsimd.h + gru/gru_xsimd.tpp + lstm/lstm.h + lstm/lstm.tpp + lstm/lstm_eigen.h + lstm/lstm_eigen.tpp + lstm/lstm_xsimd.h + lstm/lstm_xsimd.tpp + batchnorm/batchnorm2d.h + batchnorm/batchnorm2d.tpp + batchnorm/batchnorm2d_eigen.h + batchnorm/batchnorm2d_eigen.tpp + model_loader.h + RTNeural.h + RTNeural.cpp +) + +set_property(TARGET RTNeural PROPERTY POSITION_INDEPENDENT_CODE ON) +set_target_properties(RTNeural PROPERTIES LINKER_LANGUAGE CXX) +target_include_directories(RTNeural + PUBLIC + ../modules/json + INTERFACE + .. +) +set(RTNEURAL_NAMESPACE "RTNeural" CACHE STRING "Namespace to use for RTNeural code") +target_compile_definitions(RTNeural + PUBLIC + RTNEURAL_NAMESPACE=${RTNEURAL_NAMESPACE} +) + +if(RTNEURAL_ENABLE_RADSAN) + rtneural_radsan_configure(RTNeural) +endif() diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/Layer.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/Layer.h new file mode 100644 index 0000000..d5dcb74 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/Layer.h @@ -0,0 +1,39 @@ +#ifndef LAYER_H_INCLUDED +#define LAYER_H_INCLUDED + +#include +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** Virtual base class for a generic neural network layer. */ +template +class Layer +{ +public: + /** Constructs a layer with given input and output size. */ + Layer(int in_size, int out_size) + : in_size(in_size) + , out_size(out_size) + { + } + + virtual ~Layer() = default; + + /** Returns the name of this layer. */ + virtual std::string getName() const noexcept { return ""; } + + /** Resets the state of this layer. */ + virtual void reset() { } + + /** Implements the forward propagation step for this layer. */ + virtual void forward(const T* input, T* out) noexcept = 0; + + const int in_size; + const int out_size; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // LAYER_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/Model.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/Model.h new file mode 100644 index 0000000..d2a60a3 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/Model.h @@ -0,0 +1,118 @@ +#ifndef MODEL_H_INCLUDED +#define MODEL_H_INCLUDED + +#include + +#include "Layer.h" +#include "activation/activation.h" +#include "batchnorm/batchnorm.h" +#include "batchnorm/batchnorm.tpp" +#include "batchnorm/batchnorm2d.h" +#include "batchnorm/batchnorm2d.tpp" +#include "config.h" +#include "conv1d/conv1d.h" +#include "conv1d/conv1d.tpp" +#include "conv2d/conv2d.h" +#include "conv2d/conv2d.tpp" +#include "dense/dense.h" +#include "gru/gru.h" +#include "gru/gru.tpp" +#include "lstm/lstm.h" +#include "lstm/lstm.tpp" + +namespace RTNEURAL_NAMESPACE +{ + +/** + * A dynamic sequential neural network model. + * + * Instances of this class should typically be created + * `json_parser::parseJson`. + */ +template +class Model +{ +public: + /** Constructs a sequential model for a given input size. */ + explicit Model(int in_size) + : in_size(in_size) + { + } + + /** Destructor. */ + ~Model() + { + for(auto l : layers) + delete l; + layers.clear(); + + outs.clear(); + } + + /** Returns the model's input size */ + int getInSize() const { return layers.front()->in_size; } + + /** Returns the model's output size */ + int getOutSize() const { return layers.back()->out_size; } + + /** Returns the required input size for the next layer being added to the network. */ + int getNextInSize() const + { + if(layers.empty()) + return in_size; + + return layers.back()->out_size; + } + + /** Adds a new layer to the sequential model. */ + void addLayer(Layer* layer) + { + layers.push_back(layer); + outs.push_back(vec_type(layer->out_size, (T)0)); + } + + /** Resets the state of the network layers. */ + RTNEURAL_REALTIME void reset() + { + for(auto* l : layers) + l->reset(); + } + + /** Performs forward propagation for this model. */ + RTNEURAL_REALTIME inline T forward(const T* input) + { + layers[0]->forward(input, outs[0].data()); + + for(int i = 1; i < (int)layers.size(); ++i) + { + layers[i]->forward(outs[i - 1].data(), outs[i].data()); + } + + return outs.back()[0]; + } + + /** Returns a pointer to the output of the final layer in the network. */ + RTNEURAL_REALTIME inline const T* getOutputs() const noexcept + { + return outs.back().data(); + } + + /** A vector storing the network layers in sequential order. */ + std::vector*> layers; + +private: +#if RTNEURAL_USE_XSIMD + using vec_type = std::vector>; +#elif RTNEURAL_USE_EIGEN + using vec_type = std::vector>; +#else + using vec_type = std::vector; +#endif + + const int in_size; + std::vector outs; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // MODEL_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/ModelT.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/ModelT.h new file mode 100644 index 0000000..745be60 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/ModelT.h @@ -0,0 +1,579 @@ +#pragma once + +#include "model_loader.h" + +namespace RTNEURAL_NAMESPACE +{ + +#ifndef DOXYGEN +/** + * Some utilities for constructing and working + * with variadic templates of layers. + * + * Note that this API may change at any time, + * so probably don't use any of this directly. + */ +namespace modelt_detail +{ + /** utils for making offset index sequences */ + template + struct offset_sequence; + + template + struct offset_sequence> + { + using type = std::index_sequence; + }; + template + using offset_sequence_t = typename offset_sequence::type; + + /** Functions to do a function for each element in the tuple */ + template + constexpr void forEachInTuple(Fn&& fn, Tuple&& tuple, std::index_sequence) noexcept(noexcept(std::initializer_list { (fn(std::get(tuple), std::integral_constant()), 0)... })) + { + (void)std::initializer_list { ((void)fn(std::get(tuple), std::integral_constant()), 0)... }; + } + + template + using TupleIndexSequence = std::make_index_sequence>>::value>; + + template + constexpr void forEachInTuple(Fn&& fn, Tuple&& tuple) noexcept(noexcept(forEachInTuple(std::forward(fn), std::forward(tuple), TupleIndexSequence {}))) + { + forEachInTuple(std::forward(fn), std::forward(tuple), TupleIndexSequence {}); + } + + template + using TupleIndexSequenceRange = offset_sequence_t>; + + template + constexpr void forEachInTupleRange(Fn&& fn, Tuple&& tuple) noexcept(noexcept(forEachInTuple(std::forward(fn), std::forward(tuple), TupleIndexSequenceRange {}))) + { + forEachInTuple(std::forward(fn), std::forward(tuple), TupleIndexSequenceRange {}); + } + + // unrolled loop for forward inferencing + template + struct forward_unroll + { + template + static void call(T& t) + { + std::get(t).forward(std::get(t).outs); + forward_unroll::call(t); + } + }; + + template + struct forward_unroll + { + template + static void call(T&) { } + }; + + template + void loadLayer(LayerType&, int&, const nlohmann::json&, const std::string&, int, bool debug) + { + json_parser::debug_print("Loading a no-op layer!", debug); + } + + template + void loadLayer(DenseT& dense, int& json_stream_idx, const nlohmann::json& l, + const std::string& type, int layerDims, bool debug) + { + using namespace json_parser; + + debug_print("Layer: " + type, debug); + debug_print(" Dims: " + std::to_string(layerDims), debug); + const auto& weights = l["weights"]; + + if(checkDense(dense, type, layerDims, debug)) + loadDense(dense, weights); + + if(!l.contains("activation")) + { + json_stream_idx++; + } + else + { + const auto activationType = l["activation"].get(); + if(activationType.empty()) + json_stream_idx++; + } + } + + template + void loadLayer(Conv1DT& conv, int& json_stream_idx, const nlohmann::json& l, + const std::string& type, int layerDims, bool debug) + { + using namespace json_parser; + + debug_print("Layer: " + type, debug); + debug_print(" Dims: " + std::to_string(layerDims), debug); + const auto& l_weights = l["weights"]; + const auto l_kernel = l["kernel_size"].back().get(); + const auto l_dilation = l["dilation"].back().get(); + const auto l_groups = l.value("groups", 1); + + if(checkConv1D(conv, type, layerDims, l_kernel, l_dilation, l_groups, debug)) + loadConv1D(conv, l_kernel, l_dilation, l_weights); + + if(!l.contains("activation")) + { + json_stream_idx++; + } + else + { + const auto activationType = l["activation"].get(); + if(activationType.empty()) + json_stream_idx++; + } + } + template + void loadLayer(Conv2DT& conv, + int& json_stream_idx, const nlohmann::json& l, + const std::string& type, int layerDims, bool debug) + { + using namespace json_parser; + + debug_print("Layer: " + type, debug); + debug_print(" Dims: " + std::to_string(layerDims), debug); + const auto& weights = l["weights"]; + const auto kernel_time = l["kernel_size_time"].back().get(); + const auto kernel_feature = l["kernel_size_feature"].back().get(); + + const auto dilation = l["dilation"].back().get(); + const auto strides = l["strides"].back().get(); + const bool valid_pad = l["padding"].get() == "valid"; + + if(checkConv2D(conv, type, layerDims, kernel_time, kernel_feature, dilation, strides, valid_pad, debug)) + loadConv2D(conv, weights); + + if(!l.contains("activation")) + { + json_stream_idx++; + } + else + { + const auto activationType = l["activation"].get(); + if(activationType.empty()) + json_stream_idx++; + } + } + + template + void loadLayer(GRULayerT& gru, int& json_stream_idx, const nlohmann::json& l, + const std::string& type, int layerDims, bool debug) + { + using namespace json_parser; + + debug_print("Layer: " + type, debug); + debug_print(" Dims: " + std::to_string(layerDims), debug); + const auto& weights = l["weights"]; + + if(checkGRU(gru, type, layerDims, debug)) + loadGRU(gru, weights); + + json_stream_idx++; + } + + template + void loadLayer(LSTMLayerT& lstm, int& json_stream_idx, const nlohmann::json& l, + const std::string& type, int layerDims, bool debug) + { + using namespace json_parser; + + debug_print("Layer: " + type, debug); + debug_print(" Dims: " + std::to_string(layerDims), debug); + const auto& weights = l["weights"]; + + if(checkLSTM(lstm, type, layerDims, debug)) + loadLSTM(lstm, weights); + + json_stream_idx++; + } + + template + void loadLayer(PReLUActivationT& prelu, int& json_stream_idx, const nlohmann::json& l, + const std::string& type, int layerDims, bool debug) + { + using namespace json_parser; + + debug_print("Layer: " + type, debug); + debug_print(" Dims: " + std::to_string(layerDims), debug); + const auto& weights = l["weights"]; + + if(checkPReLU(prelu, type, layerDims, debug)) + loadPReLU(prelu, weights); + + json_stream_idx++; + } + + template + void loadLayer(BatchNorm1DT& batch_norm, int& json_stream_idx, const nlohmann::json& l, + const std::string& type, int layerDims, bool debug) + { + using namespace json_parser; + + debug_print("Layer: " + type, debug); + debug_print(" Dims: " + std::to_string(layerDims), debug); + const auto& weights = l["weights"]; + + if(checkBatchNorm(batch_norm, type, layerDims, weights, debug)) + { + loadBatchNorm(batch_norm, weights); + batch_norm.setEpsilon(l["epsilon"].get()); + } + + json_stream_idx++; + } + + template + void loadLayer(BatchNorm2DT& batch_norm, int& json_stream_idx, const nlohmann::json& l, + const std::string& type, int layerDims, bool debug) + { + using namespace json_parser; + + debug_print("Layer: " + type, debug); + debug_print(" Dims: " + std::to_string(layerDims), debug); + const auto& weights = l["weights"]; + + if(checkBatchNorm2D(batch_norm, type, layerDims, weights, debug)) + { + loadBatchNorm(batch_norm, weights); + batch_norm.setEpsilon(l["epsilon"].get()); + } + + json_stream_idx++; + } + + template + void parseJson(const nlohmann::json& parent, std::tuple& layers, const bool debug = false, std::initializer_list custom_layers = {}) + { + using namespace json_parser; + + auto shape = parent["in_shape"]; + auto json_layers = parent["layers"]; + + if(!shape.is_array() || !json_layers.is_array()) + return; + + // If 4D: nDims is num_features * num_channels + const int nDims = shape.size() == 4 ? shape[2].get() * shape[3].get() : shape.back().get(); + + debug_print("# dimensions: " + std::to_string(nDims), debug); + + if(nDims != in_size) + { + debug_print("Incorrect input size!", debug); + return; + } + + int json_stream_idx = 0; + modelt_detail::forEachInTuple([&](auto& layer, size_t) + { + if(json_stream_idx >= (int)json_layers.size()) + { + debug_print("Too many layers!", debug); + return; + } + + const auto l = json_layers.at(json_stream_idx); + const auto type = l["type"].get(); + const auto layerShape = l["shape"]; + + // If 4D: layerDims is num_features * num_channels + const int layerDims = layerShape.size() == 4 ? layerShape[2].get() * layerShape[3].get() : layerShape.back().get(); + + if(layer.isActivation()) // activation layers don't need initialisation + { + if(!l.contains("activation")) + { + debug_print("No activation layer expected!", debug); + return; + } + + const auto activationType = l["activation"].get(); + if(!activationType.empty()) + { + debug_print(" activation: " + activationType, debug); + checkActivation(layer, activationType, layerDims, debug); + } + + json_stream_idx++; + return; + } + + if(std::find(custom_layers.begin(), custom_layers.end(), type) != custom_layers.end()) + { + debug_print ("Skipping loading weights for custom layer: " + type, debug); + json_stream_idx++; + return; + } + + modelt_detail::loadLayer(layer, json_stream_idx, l, type, layerDims, debug); }, + layers); + } +} // namespace modelt_detail +#endif // DOXYGEN + +/** + * A static sequential neural network model. + * + * To use this class, you must define the layers at compile-time: + * ``` + * ModelT, + * TanhActivationT, + * DenseT + * > model; + * ``` + */ +template +class ModelT +{ +public: + static constexpr auto input_size = in_size; + static constexpr auto output_size = out_size; + + ModelT() + { +#if RTNEURAL_USE_XSIMD + for(int i = 0; i < v_in_size; ++i) + v_ins[i] = v_type((T)0); +#elif RTNEURAL_USE_EIGEN + auto& layer_outs = get().outs; + new(&layer_outs) Eigen::Map, RTNeuralEigenAlignment>(outs); +#endif + } + + /** Get a reference to the layer at index `Index`. */ + template + RTNEURAL_REALTIME auto& get() noexcept + { + return std::get(layers); + } + + /** Get a reference to the layer at index `Index`. */ + template + RTNEURAL_REALTIME const auto& get() const noexcept + { + return std::get(layers); + } + + /** Resets the state of the network layers. */ + RTNEURAL_REALTIME void reset() + { + modelt_detail::forEachInTuple([&](auto& layer, size_t) + { layer.reset(); }, + layers); + } + + /** Performs forward propagation for this model. */ + template + RTNEURAL_REALTIME inline typename std::enable_if<(N > 1), T>::type + forward(const T* input) + { +#if RTNEURAL_USE_XSIMD + for(int i = 0; i < v_in_size; ++i) + v_ins[i] = xsimd::load_aligned(input + i * v_size); +#elif RTNEURAL_USE_EIGEN + auto v_ins = Eigen::Map(input); +#else // RTNEURAL_USE_STL + std::copy(input, input + in_size, v_ins); +#endif + std::get<0>(layers).forward(v_ins); + modelt_detail::forward_unroll<1, n_layers - 1>::call(layers); + +#if RTNEURAL_USE_XSIMD + for(int i = 0; i < v_out_size; ++i) + xsimd::store_aligned(outs + i * v_size, get().outs[i]); +#elif RTNEURAL_USE_EIGEN +#else // RTNEURAL_USE_STL + auto& layer_outs = get().outs; + std::copy(layer_outs, layer_outs + out_size, outs); +#endif + return outs[0]; + } + + /** Performs forward propagation for this model. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T* input) + { +#if RTNEURAL_USE_XSIMD + v_ins[0] = (v_type)input[0]; +#elif RTNEURAL_USE_EIGEN + const auto v_ins = vec_type::Constant(input[0]); +#else // RTNEURAL_USE_STL + v_ins[0] = input[0]; +#endif + + std::get<0>(layers).forward(v_ins); + modelt_detail::forward_unroll<1, n_layers - 1>::call(layers); + +#if RTNEURAL_USE_XSIMD + for(int i = 0; i < v_out_size; ++i) + xsimd::store_aligned(outs + i * v_size, get().outs[i]); +#elif RTNEURAL_USE_EIGEN +#else // RTNEURAL_USE_STL + auto& layer_outs = get().outs; + std::copy(layer_outs, layer_outs + out_size, outs); +#endif + return outs[0]; + } + + /** Returns a pointer to the output of the final layer in the network. */ + RTNEURAL_REALTIME inline const T* getOutputs() const noexcept + { + return outs; + } + + /** Loads neural network model weights from a json stream. */ + void parseJson(const nlohmann::json& parent, const bool debug = false, std::initializer_list custom_layers = {}) + { + modelt_detail::parseJson(parent, layers, debug, custom_layers); + } + + /** Loads neural network model weights from a json stream. */ + void parseJson(std::ifstream& jsonStream, const bool debug = false, std::initializer_list custom_layers = {}) + { + nlohmann::json parent; + jsonStream >> parent; + return parseJson(parent, debug, custom_layers); + } + +private: +#if RTNEURAL_USE_XSIMD + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_in_size = ceil_div(in_size, v_size); + static constexpr auto v_out_size = ceil_div(out_size, v_size); + v_type v_ins[v_in_size]; +#elif RTNEURAL_USE_EIGEN + using vec_type = Eigen::Matrix; +#else // RTNEURAL_USE_STL + T v_ins alignas(RTNEURAL_DEFAULT_ALIGNMENT)[in_size]; +#endif + +#if RTNEURAL_USE_XSIMD + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[v_out_size * v_size]; +#else + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; +#endif + + std::tuple layers; + static constexpr size_t n_layers = sizeof...(Layers); +}; + +#if RTNEURAL_USE_EIGEN || !RTNEURAL_USE_XSIMD +/** A static sequential 2D neural network model. */ +template +using ModelT2D = ModelT; +#else +/** + * A static sequential 2D neural network model. + * + * This API is still somewhat unstable, so maybe hold off on using it for now, + * unless you're in the mood to help with debugging. + */ +template +class ModelT2D +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_num_filters_in = ceil_div(num_filters_in, v_size); + static constexpr auto v_num_filters_out = ceil_div(num_filters_out, v_size); + static constexpr auto v_in_size = v_num_filters_in * num_features_in; + static constexpr auto v_out_size = v_num_filters_out * num_features_out; + +public: + static constexpr auto input_size = num_filters_in * num_features_in; + static constexpr auto output_size = num_filters_out * num_features_out; + static constexpr auto input_size_padded = v_in_size * v_size; + static constexpr auto output_size_padded = v_out_size * v_size; + + ModelT2D() + { + for(int i = 0; i < v_in_size; ++i) + v_ins[i] = v_type((T)0); + } + + /** Get a reference to the layer at index `Index`. */ + template + auto& get() noexcept + { + return std::get(layers); + } + + /** Get a reference to the layer at index `Index`. */ + template + const auto& get() const noexcept + { + return std::get(layers); + } + + /** Resets the state of the network layers. */ + void reset() + { + modelt_detail::forEachInTuple([&](auto& layer, size_t) + { layer.reset(); }, + layers); + } + + /** Performs forward propagation for this model. */ + inline T forward(const T* input) + { + for(int feature_index = 0; feature_index < num_features_in; ++feature_index) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T load_arr[v_size * v_num_filters_in] {}; + std::copy(input + feature_index * num_filters_in, input + feature_index * num_filters_in + num_filters_in, std::begin(load_arr)); + for(int i = 0; i < v_num_filters_in; ++i) + v_ins[feature_index * num_filters_in + i] = xsimd::load_aligned(load_arr + i * v_size); + } + std::get<0>(layers).forward(v_ins); + modelt_detail::forward_unroll<1, n_layers - 1>::call(layers); + + for(int feature_index = 0; feature_index < num_features_out; ++feature_index) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T store_arr[v_size * v_num_filters_out] {}; + for(int i = 0; i < v_num_filters_out; ++i) + xsimd::store_aligned(store_arr + i * v_size, get().outs[feature_index * num_filters_out + i]); + std::copy(std::begin(store_arr), std::begin(store_arr) + num_filters_out, outs + feature_index * num_filters_out); + } + + return outs[0]; + } + + /** Returns a pointer to the output of the final layer in the network. */ + inline const T* getOutputs() const noexcept + { + return outs; + } + + /** Loads neural network model weights from a json stream. */ + void parseJson(const nlohmann::json& parent, const bool debug = false, std::initializer_list custom_layers = {}) + { + modelt_detail::parseJson(parent, layers, debug, custom_layers); + } + + /** Loads neural network model weights from a json stream. */ + void parseJson(std::ifstream& jsonStream, const bool debug = false, std::initializer_list custom_layers = {}) + { + nlohmann::json parent; + jsonStream >> parent; + return parseJson(parent, debug, custom_layers); + } + +private: + v_type v_ins[v_in_size] {}; + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[output_size] {}; + + std::tuple layers; + static constexpr size_t n_layers = sizeof...(Layers); +}; +#endif // RTNEURAL_USE_XSIMD +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/RTNeural.cpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/RTNeural.cpp new file mode 100644 index 0000000..1ce85cd --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/RTNeural.cpp @@ -0,0 +1,7 @@ +#include "RTNeural.h" + +// forward declare some template classes +template class RTNEURAL_NAMESPACE::Model; +template class RTNEURAL_NAMESPACE::Model; +template class RTNEURAL_NAMESPACE::Layer; +template class RTNEURAL_NAMESPACE::Layer; diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/RTNeural.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/RTNeural.h new file mode 100644 index 0000000..48926ea --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/RTNeural.h @@ -0,0 +1,14 @@ +#pragma once + +// global include file for the RTNeural library! + +// C++ STL includes +#include + +// RTNeural includes: +#include "config.h" + +#include "Model.h" +#include "ModelT.h" +#include "model_loader.h" +#include "torch_helpers.h" diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/activation/activation.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/activation/activation.h new file mode 100644 index 0000000..6f80bbb --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/activation/activation.h @@ -0,0 +1,432 @@ +#ifndef ACTIVATION_H_INCLUDED +#define ACTIVATION_H_INCLUDED + +#include "../Layer.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** Base class for activation layers. */ +template +class Activation : public Layer +{ +public: + /** Constructs an activation layers for a given size and function. */ + Activation(int size, std::function func, const std::string& name) + : Layer(size, size) + , name(name) + , func(func) + { + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return name; } + + /** Implements the forward propagation step for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + for(int i = 0; i < Layer::out_size; ++i) + out[i] = func(input[i]); + } + +private: + const std::string name; + const std::function func; +}; + +} // namespace RTNEURAL_NAMESPACE + +#if RTNEURAL_USE_EIGEN +#include "activation_eigen.h" + +#elif RTNEURAL_USE_XSIMD +#include "activation_xsimd.h" + +#else +#include "../common.h" +#include "../maths/maths_stl.h" +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** Dynamic implementation of a tanh activation layer. */ +template +class TanhActivation final : public Activation +{ +public: + /** Constructs a tanh activation layer for a given size. */ + explicit TanhActivation(int size) + : Activation( + size, [](T x) + { return MathsProvider::tanh(x); }, + "tanh") + { + } + + TanhActivation(std::initializer_list sizes) + : TanhActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for tanh activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + for(int i = 0; i < Layer::out_size; ++i) + out[i] = MathsProvider::tanh(input[i]); + } +}; + +/** Static implementation of a tanh activation layer. */ +template +class TanhActivationT +{ +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + TanhActivationT() = default; + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "tanh"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for tanh activation. */ + RTNEURAL_REALTIME inline void forward(const T (&ins)[size]) noexcept + { + for(int i = 0; i < size; ++i) + outs[i] = MathsProvider::tanh(ins[i]); + } + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[size]; +}; + +/** Dynamic implementation of a ReLU activation layer. */ +template +class ReLuActivation final : public Activation +{ +public: + /** Constructs a ReLU activation layer for a given size. */ + explicit ReLuActivation(int size) + : Activation( + size, [](T x) + { return std::max((T)0, x); }, + "relu") + { + } + + ReLuActivation(std::initializer_list sizes) + : ReLuActivation(*sizes.begin()) + { + } +}; + +/** Static implementation of a ReLU activation layer. */ +template +class ReLuActivationT +{ +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + ReLuActivationT() = default; + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "relu"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for ReLU activation. */ + RTNEURAL_REALTIME inline void forward(const T (&ins)[size]) noexcept + { + for(int i = 0; i < size; ++i) + outs[i] = std::max((T)0, ins[i]); + } + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[size]; +}; + +/** Dynamic implementation of a sigmoid activation layer. */ +template +class SigmoidActivation final : public Activation +{ +public: + /** Constructs a sigmoid activation layer for a given size. */ + explicit SigmoidActivation(int size) + : Activation( + size, [](T x) + { return MathsProvider::sigmoid(x); }, + "sigmoid") + { + } + + SigmoidActivation(std::initializer_list sizes) + : SigmoidActivation(*sizes.begin()) + { + } +}; + +/** Static implementation of a sigmoid activation layer. */ +template +class SigmoidActivationT +{ +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + SigmoidActivationT() = default; + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "sigmoid"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for sigmoid activation. */ + RTNEURAL_REALTIME inline void forward(const T (&ins)[size]) noexcept + { + for(int i = 0; i < size; ++i) + outs[i] = MathsProvider::sigmoid(ins[i]); + } + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[size]; +}; + +/** Dynamic implementation of a softmax activation layer. */ +template +class SoftmaxActivation final : public Activation +{ +public: + /** Constructs a softmax activation layer for a given size. */ + explicit SoftmaxActivation(int size) + : Activation( + size, [](T x) + { return (T)0; }, + "softmax") + { + } + + SoftmaxActivation(std::initializer_list sizes) + : SoftmaxActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for softmax activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + T exp_sum = 0; + for(int i = 0; i < Layer::out_size; ++i) + { + out[i] = MathsProvider::exp(input[i]); + exp_sum += out[i]; + } + + const auto exp_sum_recip = (T)1 / exp_sum; + for(int i = 0; i < Layer::out_size; ++i) + { + out[i] *= exp_sum_recip; + } + } +}; + +/** Static implementation of a softmax activation layer. */ +template +class SoftmaxActivationT +{ +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + SoftmaxActivationT() = default; + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "softmax"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for softmax activation. */ + RTNEURAL_REALTIME inline void forward(const T (&ins)[size]) noexcept + { + T exp_sum = 0; + for(int i = 0; i < size; ++i) + { + outs[i] = MathsProvider::exp(ins[i]); + exp_sum += outs[i]; + } + + const auto exp_sum_recip = (T)1 / exp_sum; + for(int i = 0; i < size; ++i) + { + outs[i] *= exp_sum_recip; + } + } + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[size]; +}; + +/** Dynamic implementation of a elu activation layer. */ +template +class ELuActivation final : public Activation +{ +public: + /** Constructs a softmax activation layer for a given size. */ + explicit ELuActivation(int size) + : Activation( + size, [this](T x) + { return x > (T)0 ? x : (alpha * (MathsProvider::exp(x) - (T)1)); }, + "elu") + { + } + + ELuActivation(std::initializer_list sizes) + : ELuActivation(*sizes.begin()) + { + } + + /** Sets a custom value for the layer's "alpha" parameter. */ + RTNEURAL_REALTIME void set_alpha(T newAlpha) { alpha = newAlpha; } + +private: + T alpha = (T)1; +}; + +/** Static implementation of a elu activation layer. */ +template +class ELuActivationT +{ +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + ELuActivationT() = default; + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "elu"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for elu activation. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&ins)[size]) noexcept + { + for(int i = 0; i < size; ++i) + outs[i] = ins[i] > (T)0 ? ins[i] : (MathsProvider::exp(ins[i]) - (T)1); + } + + /** Performs forward propagation for elu activation (with custom alpha parameter). */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&ins)[size]) noexcept + { + static constexpr T alpha = (T)AlphaNumerator / (T)AlphaDenominator; + for(int i = 0; i < size; ++i) + outs[i] = ins[i] > (T)0 ? ins[i] : (alpha * (MathsProvider::exp(ins[i]) - (T)1)); + } + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[size]; +}; + +/** Dynamic implementation of a PReLU activation layer. */ +template +class PReLUActivation final : public Activation +{ +public: + explicit PReLUActivation(int size) + : Activation(size, {}, "prelu") + , alpha(size, {}) + { + } + + /** Performs forward propagation for prelu activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + for(auto i = 0; i < Layer::in_size; ++i) + out[i] = input[i] >= (T)0 ? input[i] : (input[i] * alpha[i]); + } + + RTNEURAL_REALTIME void setAlphaVals(const std::vector& alphaVals) + { + if(alphaVals.size() == 1) + { + std::fill(alpha.begin(), alpha.end(), alphaVals[0]); + } + else + { + std::copy(alphaVals.begin(), alphaVals.end(), alpha.begin()); + } + } + + std::vector alpha; +}; + +/** Static implementation of a PReLU activation layer. */ +template +class PReLUActivationT +{ +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + PReLUActivationT() + { + for(int i = 0; i < size; ++i) + { + outs[i] = (T)0; + alpha[i] = (T)0; + } + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "prelu"; } + + /** Returns false since this layer has weights even though it is an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for prelu activation. */ + RTNEURAL_REALTIME inline void forward(const T (&ins)[size]) noexcept + { + for(auto i = 0; i < size; ++i) + outs[i] = ins[i] >= (T)0 ? ins[i] : (ins[i] * alpha[i]); + } + + RTNEURAL_REALTIME void setAlphaVals(const std::vector& alphaVals) + { + if(alphaVals.size() == 1) + { + std::fill(std::begin(alpha), std::end(alpha), alphaVals[0]); + } + else + { + for(size_t i = 0; i < size; i += alphaVals.size()) + std::copy(alphaVals.begin(), alphaVals.end(), std::begin(alpha) + i); + } + } + + T outs[size]; + T alpha[size]; +}; +} // namespace RTNEURAL_NAMESPACE + +#endif // RTNEURAL_USE_EIGEN + +#endif // ACTIVATION_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/activation/activation_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/activation/activation_eigen.h new file mode 100644 index 0000000..cdfecb0 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/activation/activation_eigen.h @@ -0,0 +1,469 @@ +#ifndef ACTIVATIONEIGEN_H_INCLUDED +#define ACTIVATIONEIGEN_H_INCLUDED + +#include "../common.h" +#include "../config.h" +#include "../maths/maths_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ + +/** Dynamic implementation of a tanh activation layer. */ +template +class TanhActivation : public Activation +{ +public: + /** Constructs a tanh activation layer for a given size. */ + explicit TanhActivation(int size) + : Activation(size, {}, "tanh") + { + inVec = Eigen::Matrix::Zero(size, 1); + outVec = Eigen::Matrix::Zero(size, 1); + } + + TanhActivation(std::initializer_list sizes) + : TanhActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for tanh activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + inVec = Eigen::Map, RTNeuralEigenAlignment>( + input, Layer::in_size, 1); + outVec = MathsProvider::tanh(inVec); + + std::copy(outVec.data(), outVec.data() + Layer::in_size, out); + } + + Eigen::Matrix inVec; + Eigen::Matrix outVec; +}; + +/** Static implementation of a tanh activation layer. */ +template +class TanhActivationT +{ + using v_type = Eigen::Matrix; + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + TanhActivationT() + : outs(outs_internal) + { + outs = v_type::Zero(); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "tanh"; } + + /** Returns true if this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for tanh activation. */ + RTNEURAL_REALTIME inline void forward(const v_type& ins) noexcept + { + outs = MathsProvider::tanh(ins); + } + + Eigen::Map outs; + +private: + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; +}; + +/** Dynamic implementation of a ReLU activation layer. */ +template +class ReLuActivation : public Activation +{ +public: + /** Constructs a ReLU activation layer for a given size. */ + explicit ReLuActivation(int size) + : Activation(size, {}, "relu") + { + inVec = Eigen::Matrix::Zero(size, 1); + outVec = Eigen::Matrix::Zero(size, 1); + } + + ReLuActivation(std::initializer_list sizes) + : ReLuActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for ReLU activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + inVec = Eigen::Map, RTNeuralEigenAlignment>( + input, Layer::in_size, 1); + outVec = inVec.array().max((T)0); + + std::copy(outVec.data(), outVec.data() + Layer::in_size, out); + } + + Eigen::Matrix inVec; + Eigen::Matrix outVec; +}; + +/** Static implementation of a ReLU activation layer. */ +template +class ReLuActivationT +{ + using v_type = Eigen::Matrix; + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + ReLuActivationT() + : outs(outs_internal) + { + outs = v_type::Zero(); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "relu"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for ReLU activation. */ + RTNEURAL_REALTIME inline void forward(const v_type& ins) noexcept + { + outs = ins.array().max((T)0); + } + + Eigen::Map outs; + +private: + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; +}; + +/** Dynamic implementation of a sigmoid activation layer. */ + +template +class SigmoidActivation : public Activation +{ +public: + /** Constructs a sigmoid activation layer for a given size. */ + explicit SigmoidActivation(int size) + : Activation(size, {}, "sigmoid") + { + inVec = Eigen::Matrix::Zero(size, 1); + outVec = Eigen::Matrix::Zero(size, 1); + } + + SigmoidActivation(std::initializer_list sizes) + : SigmoidActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for sigmoid activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + inVec = Eigen::Map, RTNeuralEigenAlignment>( + input, Layer::in_size, 1); + outVec = MathsProvider::sigmoid(inVec); + + std::copy(outVec.data(), outVec.data() + Layer::in_size, out); + } + + Eigen::Matrix inVec; + Eigen::Matrix outVec; +}; + +/** Static implementation of a sigmoid activation layer. */ +template +class SigmoidActivationT +{ + using v_type = Eigen::Matrix; + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + SigmoidActivationT() + : outs(outs_internal) + { + outs = v_type::Zero(); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "sigmoid"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for sigmoid activation. */ + RTNEURAL_REALTIME inline void forward(const v_type& ins) noexcept + { + outs = MathsProvider::sigmoid(ins); + } + + Eigen::Map outs; + +private: + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; +}; + +/** Dynamic implementation of a softmax activation layer. */ +template +class SoftmaxActivation : public Activation +{ +public: + /** Constructs a softmax activation layer for a given size. */ + explicit SoftmaxActivation(int size) + : Activation(size, {}, "softmax") + { + inVec = Eigen::Matrix::Zero(size, 1); + outVec = Eigen::Matrix::Zero(size, 1); + } + + SoftmaxActivation(std::initializer_list sizes) + : SoftmaxActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for softmax activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + inVec = Eigen::Map, RTNeuralEigenAlignment>( + input, Layer::in_size, 1); + outVec = MathsProvider::exp(inVec); + outVec = outVec / outVec.sum(); + + std::copy(outVec.data(), outVec.data() + Layer::in_size, out); + } + + Eigen::Matrix inVec; + Eigen::Matrix outVec; +}; + +/** Static implementation of a softmax activation layer. */ +template +class SoftmaxActivationT +{ + using v_type = Eigen::Matrix; + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + SoftmaxActivationT() + : outs(outs_internal) + { + outs = v_type::Zero(); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "softmax"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for softmax activation. */ + RTNEURAL_REALTIME inline void forward(const v_type& ins) noexcept + { + outs = MathsProvider::exp(ins); + outs = outs / outs.sum(); + } + + Eigen::Map outs; + +private: + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; +}; + +/** Dynamic implementation of a elu activation layer. */ +template +class ELuActivation : public Activation +{ +public: + /** Constructs a elu activation layer for a given size. */ + explicit ELuActivation(int size) + : Activation(size, {}, "elu") + , ones(Eigen::Matrix::Ones(size, 1)) + { + inVec = Eigen::Matrix::Zero(size, 1); + outVec = Eigen::Matrix::Zero(size, 1); + } + + ELuActivation(std::initializer_list sizes) + : ELuActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for softmax activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + inVec = Eigen::Map, RTNeuralEigenAlignment>( + input, Layer::in_size, 1); + + outVec = (inVec.array() > (T)0).select(inVec, alpha * (MathsProvider::exp(inVec) - ones.array())); + std::copy(outVec.data(), outVec.data() + Layer::in_size, out); + } + + Eigen::Matrix inVec; + Eigen::Matrix outVec; + + /** Sets a custom value for the layer's "alpha" parameter. */ + RTNEURAL_REALTIME void set_alpha(T newAlpha) { alpha = newAlpha; } + +private: + const Eigen::Matrix ones; + T alpha = (T)1; +}; + +/** Static implementation of a elu activation layer. */ +template +class ELuActivationT +{ + using v_type = Eigen::Matrix; + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + ELuActivationT() + : outs(outs_internal) + { + outs = v_type::Zero(); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "elu"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for elu activation. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type& ins) noexcept + { + outs = (ins.array() > (T)0).select(ins, MathsProvider::exp(ins) - ones.array()); + } + + /** Performs forward propagation for elu activation (with custom alpha parameter). */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type& ins) noexcept + { + static constexpr T alpha = (T)AlphaNumerator / (T)AlphaDenominator; + outs = (ins.array() > (T)0).select(ins, alpha * (MathsProvider::exp(ins) - ones.array())); + } + + Eigen::Map outs; + +private: + const v_type ones = v_type::Ones(); + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; +}; + +/** Dynamic implementation of a PReLU activation layer. */ +template +class PReLUActivation final : public Activation +{ +public: + explicit PReLUActivation(int size) + : Activation(size, {}, "prelu") + { + alpha = Eigen::Matrix::Zero(size, 1); + inVec = Eigen::Matrix::Zero(size, 1); + outVec = Eigen::Matrix::Zero(size, 1); + } + + /** Performs forward propagation for prelu activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + inVec = Eigen::Map, RTNeuralEigenAlignment>( + input, Layer::in_size, 1); + + outVec = (inVec.array() >= (T)0).select(inVec, alpha.cwiseProduct(inVec)); + std::copy(outVec.data(), outVec.data() + Layer::in_size, out); + } + + RTNEURAL_REALTIME void setAlphaVals(const std::vector& alphaVals) + { + if(alphaVals.size() == 1) + { + std::fill(alpha.begin(), alpha.end(), alphaVals[0]); + } + else + { + std::copy(alphaVals.begin(), alphaVals.end(), alpha.begin()); + } + } + + Eigen::Matrix inVec; + Eigen::Matrix outVec; + +private: + Eigen::Matrix alpha; +}; + +/** Static implementation of a PReLU activation layer. */ +template +class PReLUActivationT +{ + using v_type = Eigen::Matrix; + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + PReLUActivationT() + : outs(outs_internal) + { + outs = v_type::Zero(); + alpha = v_type::Zero(); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "prelu"; } + + /** Returns false since this layer has weights even though it is an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for prelu activation. */ + RTNEURAL_REALTIME inline void forward(const v_type& ins) noexcept + { + outs = (ins.array() >= (T)0).select(ins, alpha.cwiseProduct(ins)); + } + + RTNEURAL_REALTIME void setAlphaVals(const std::vector& alphaVals) + { + if(alphaVals.size() == 1) + { + std::fill(std::begin(alpha), std::end(alpha), alphaVals[0]); + } + else + { + for(size_t i = 0; i < (size_t)alpha.size(); i += alphaVals.size()) + std::copy(alphaVals.begin(), alphaVals.end(), std::begin(alpha) + i); + } + } + + Eigen::Map outs; + +private: + const v_type ones = v_type::Ones(); + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + v_type alpha; +}; +} // namespace RTNEURAL_NAMESPACE + +#endif // ACTIVATIONEIGEN_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/activation/activation_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/activation/activation_xsimd.h new file mode 100644 index 0000000..c903f9b --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/activation/activation_xsimd.h @@ -0,0 +1,436 @@ +#ifndef ACTIVATIONXSIMD_H_INCLUDED +#define ACTIVATIONXSIMD_H_INCLUDED + +#include "../common.h" +#include "../config.h" +#include "../maths/maths_xsimd.h" + +namespace RTNEURAL_NAMESPACE +{ + +/** Dynamic implementation of a tanh activation layer. */ +template +class TanhActivation : public Activation +{ +public: + /** Constructs a tanh activation layer for a given size. */ + explicit TanhActivation(int size) + : Activation(size, {}, "tanh") + { + } + + TanhActivation(std::initializer_list sizes) + : TanhActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for tanh activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + tanh(input, out, Layer::in_size); + } +}; + +/** Static implementation of a tanh activation layer. */ +template +class TanhActivationT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_io_size = ceil_div(size, v_size); + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + TanhActivationT() + { + for(int i = 0; i < v_io_size; ++i) + outs[i] = v_type((T)0); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "tanh"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for tanh activation. */ + RTNEURAL_REALTIME inline void forward(const v_type (&ins)[v_io_size]) noexcept + { + for(int i = 0; i < v_io_size; ++i) + outs[i] = MathsProvider::tanh(ins[i]); + } + + v_type outs[v_io_size]; +}; + +/** Dynamic implementation of a ReLU activation layer. */ +template +class ReLuActivation : public Activation +{ +public: + /** Constructs a ReLU activation layer for a given size. */ + explicit ReLuActivation(int size) + : Activation(size, {}, "relu") + { + zeros.resize(size, (T)0); + } + + ReLuActivation(std::initializer_list sizes) + : ReLuActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for ReLU activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + xsimd::transform( + input, &input[Layer::in_size], zeros.begin(), out, + [](auto const& a, auto const& b) + { return xsimd::max(a, b); }); + } + + std::vector> zeros; +}; + +/** Static implementation of a ReLU activation layer. */ +template +class ReLuActivationT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_io_size = ceil_div(size, v_size); + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + ReLuActivationT() + { + for(int i = 0; i < v_io_size; ++i) + outs[i] = v_type((T)0); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "relu"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for ReLU activation. */ + RTNEURAL_REALTIME inline void forward(const v_type (&ins)[v_io_size]) noexcept + { + for(int i = 0; i < v_io_size; ++i) + outs[i] = xsimd::max(ins[i], v_type((T)0)); + } + + v_type outs[v_io_size]; +}; + +/** Dynamic implementation of a sigmoid activation layer. */ +template +class SigmoidActivation : public Activation +{ +public: + /** Constructs a sigmoid activation layer for a given size. */ + explicit SigmoidActivation(int size) + : Activation(size, {}, "sigmoid") + { + } + + SigmoidActivation(std::initializer_list sizes) + : SigmoidActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for sigmoid activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + sigmoid(input, out, Layer::in_size); + } +}; + +/** Static implementation of a sigmoid activation layer. */ +template +class SigmoidActivationT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_io_size = ceil_div(size, v_size); + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + SigmoidActivationT() + { + for(int i = 0; i < v_io_size; ++i) + outs[i] = v_type((T)0); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "sigmoid"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for sigmoid activation. */ + RTNEURAL_REALTIME inline void forward(const v_type (&ins)[v_io_size]) noexcept + { + for(int i = 0; i < v_io_size; ++i) + outs[i] = MathsProvider::sigmoid(ins[i]); + } + + v_type outs[v_io_size]; +}; + +/** Dynamic implementation of a softmax activation layer. */ +template +class SoftmaxActivation : public Activation +{ +public: + /** Constructs a softmax activation layer for a given size. */ + explicit SoftmaxActivation(int size) + : Activation(size, {}, "softmax") + { + } + + SoftmaxActivation(std::initializer_list sizes) + : SoftmaxActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for softmax activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + softmax(input, out, Layer::in_size); + } +}; + +/** Static implementation of a softmax activation layer. */ +template +class SoftmaxActivationT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_io_size = ceil_div(size, v_size); + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + SoftmaxActivationT() + { + for(int i = 0; i < v_io_size; ++i) + outs[i] = v_type((T)0); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "softmax"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for softmax activation. */ + RTNEURAL_REALTIME inline void forward(const v_type (&ins)[v_io_size]) noexcept + { + v_type exp_sum {}; + for(int i = 0; i < v_io_size; ++i) + { + outs[i] = MathsProvider::exp(ins[i]); + exp_sum += outs[i]; + } + + const auto exp_sum_recip = v_type((T)1 / xsimd::reduce_add(exp_sum)); + for(int i = 0; i < v_io_size; ++i) + outs[i] *= exp_sum_recip; + } + + v_type outs[v_io_size]; +}; + +/** Dynamic implementation of a elu activation layer. */ +template +class ELuActivation final : public Activation +{ +public: + /** Constructs a elu activation layer for a given size. */ + explicit ELuActivation(int size) + : Activation(size, {}, "elu") + { + } + + ELuActivation(std::initializer_list sizes) + : ELuActivation(*sizes.begin()) + { + } + + /** Performs forward propagation for softmax activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + elu(input, out, Layer::in_size, alpha); + } + + /** Sets a custom value for the layer's "alpha" parameter. */ + RTNEURAL_REALTIME void set_alpha(T newAlpha) { alpha = newAlpha; } + +private: + T alpha = (T)1; +}; + +/** Static implementation of a elu activation layer. */ +template +class ELuActivationT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_io_size = ceil_div(size, v_size); + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + ELuActivationT() = default; + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "elu"; } + + /** Returns true since this layer is an activation layer. */ + constexpr bool isActivation() const noexcept { return true; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for elu activation. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&ins)[v_io_size]) noexcept + { + for(int i = 0; i < v_io_size; ++i) + outs[i] = xsimd::select(ins[i] > (T)0, ins[i], MathsProvider::exp(ins[i]) - (T)1); + } + + /** Performs forward propagation for elu activation (with custom alpha parameter). */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&ins)[v_io_size]) noexcept + { + static constexpr T alpha = (T)AlphaNumerator / (T)AlphaDenominator; + for(int i = 0; i < v_io_size; ++i) + outs[i] = xsimd::select(ins[i] > (T)0, ins[i], alpha * (MathsProvider::exp(ins[i]) - (T)1)); + } + + v_type outs[v_io_size]; +}; + +/** Dynamic implementation of a PReLU activation layer. */ +template +class PReLUActivation final : public Activation +{ +public: + explicit PReLUActivation(int size) + : Activation(size, {}, "prelu") + , alpha(size, {}) + { + } + + /** Performs forward propagation for prelu activation. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + using b_type = xsimd::simd_type; + constexpr auto inc = (int)b_type::size; + + // size for which the vectorization is possible + auto vec_size = Layer::in_size - Layer::in_size % inc; + for(int i = 0; i < vec_size; i += inc) + { + b_type x_vec = xsimd::load_aligned(&input[i]); + b_type a_vec = xsimd::load_aligned(&alpha[i]); + b_type y_vec = xsimd::select(x_vec >= (T)0, x_vec, x_vec * a_vec); + xsimd::store_aligned(&out[i], y_vec); + } + + // Remaining part that cannot be vectorized + for(auto i = vec_size; i < Layer::in_size; ++i) + out[i] = input[i] >= (T)0 ? input[i] : (input[i] * alpha[i]); + } + + RTNEURAL_REALTIME void setAlphaVals(const std::vector& alphaVals) + { + if(alphaVals.size() == 1) + { + std::fill(alpha.begin(), alpha.end(), alphaVals[0]); + } + else + { + std::copy(alphaVals.begin(), alphaVals.end(), alpha.begin()); + } + } + + std::vector> alpha; +}; + +/** Static implementation of a PReLU activation layer. */ +template +class PReLUActivationT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_io_size = ceil_div(size, v_size); + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + + PReLUActivationT() + { + for(int i = 0; i < v_io_size; ++i) + { + outs[i] = v_type((T)0); + alpha[i] = v_type((T)0); + } + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "prelu"; } + + /** Returns false since this layer has weights even though it is an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for prelu activation. */ + RTNEURAL_REALTIME inline void forward(const v_type (&ins)[v_io_size]) noexcept + { + for(int i = 0; i < v_io_size; ++i) + outs[i] = xsimd::select(ins[i] >= (T)0, ins[i], ins[i] * alpha[i]); + } + + RTNEURAL_REALTIME void setAlphaVals(const std::vector& alphaVals) + { + if(alphaVals.size() == 1) + { + for(int i = 0; i < v_io_size; ++i) + alpha[i] = alphaVals[0]; + } + else + { + for(int i = 0; i < out_size; ++i) + alpha[i / v_size] = set_value(alpha[i / v_size], i % v_size, alphaVals[i]); + } + } + + v_type outs[v_io_size]; + v_type alpha[v_io_size]; +}; +} // namespace RTNEURAL_NAMESPACE + +#endif // ACTIVATIONXSIMD_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm.h new file mode 100644 index 0000000..3cb1a94 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm.h @@ -0,0 +1,146 @@ +#ifndef BATCHNORM_H_INCLUDED +#define BATCHNORM_H_INCLUDED + +#if RTNEURAL_USE_EIGEN +#include "batchnorm_eigen.h" +#include "batchnorm_eigen.tpp" +#elif RTNEURAL_USE_XSIMD +#include "batchnorm_xsimd.h" +#include "batchnorm_xsimd.tpp" +#else +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ +/** Dynamic batch normalization layer. */ +template +class BatchNorm1DLayer final : public Layer +{ +public: + explicit BatchNorm1DLayer(int size); + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "batchnorm"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + for(int i = 0; i < Layer::out_size; ++i) + out[i] = multiplier[i] * (input[i] - running_mean[i]) + beta[i]; + } + + /** Sets the layer "gamma" values. */ + RTNEURAL_REALTIME void setGamma(const std::vector& gammaVals); + + /** Sets the layer "beta" values. */ + RTNEURAL_REALTIME void setBeta(const std::vector& betaVals); + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + +private: + void updateMultiplier(); + + std::vector gamma; + std::vector beta; + + std::vector running_mean; + std::vector running_var; + + std::vector multiplier; + + T epsilon = (T)0; +}; + +/** Static batch normalization layer. */ +template +class BatchNorm1DT +{ +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + static constexpr bool is_affine = affine; + + BatchNorm1DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "batchnorm"; } + + /** Returns false since batch-norm is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&ins)[in_size]) noexcept + { + for(int i = 0; i < size; ++i) + outs[i] = multiplier[i] * (ins[i] - running_mean[i]) + beta[i]; + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&ins)[in_size]) noexcept + { + for(int i = 0; i < size; ++i) + outs[i] = multiplier[i] * (ins[i] - running_mean[i]); + } + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector& gammaVals); + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector&) { } + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector& betaVals); + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector&) { } + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + +private: + void updateMultiplier(); + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T gamma[out_size]; + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T beta[out_size]; + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T running_mean[out_size]; + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T running_var[out_size]; + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T multiplier[out_size]; + + T epsilon = (T)0; +}; +} + +#endif // RTNEURAL_STL + +#endif // BATCHNORM_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm.tpp new file mode 100644 index 0000000..7382849 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm.tpp @@ -0,0 +1,113 @@ +#include "batchnorm.h" + +namespace RTNEURAL_NAMESPACE +{ +#if !RTNEURAL_USE_EIGEN && !RTNEURAL_USE_XSIMD + +template +BatchNorm1DLayer::BatchNorm1DLayer(int size) + : Layer(size, size) + , gamma(size, (T)1) + , beta(size, (T)0) + , running_mean(size, (T)0) + , running_var(size, (T)1) + , multiplier(size, (T)1) +{ +} + +template +void BatchNorm1DLayer::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), gamma.begin()); + updateMultiplier(); +} + +template +void BatchNorm1DLayer::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), beta.begin()); +} + +template +void BatchNorm1DLayer::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), running_mean.begin()); +} + +template +void BatchNorm1DLayer::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), running_var.begin()); + updateMultiplier(); +} + +template +void BatchNorm1DLayer::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm1DLayer::updateMultiplier() +{ + for(int i = 0; i < Layer::out_size; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} + +//============================================================ +template +BatchNorm1DT::BatchNorm1DT() +{ + std::fill(std::begin(outs), std::end(outs), (T)0); + + std::fill(std::begin(gamma), std::end(gamma), (T)1); + std::fill(std::begin(beta), std::end(beta), (T)0); + std::fill(std::begin(running_mean), std::end(running_mean), (T)0); + std::fill(std::begin(running_var), std::end(running_var), (T)1); + std::fill(std::begin(multiplier), std::end(multiplier), (T)1); +} + +template +template +typename std::enable_if::type BatchNorm1DT::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), std::begin(gamma)); + updateMultiplier(); +} + +template +template +typename std::enable_if::type BatchNorm1DT::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), std::begin(beta)); +} + +template +void BatchNorm1DT::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), std::begin(running_mean)); +} + +template +void BatchNorm1DT::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), std::begin(running_var)); + updateMultiplier(); +} + +template +void BatchNorm1DT::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm1DT::updateMultiplier() +{ + for(int i = 0; i < out_size; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} +#endif +} \ No newline at end of file diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d.h new file mode 100644 index 0000000..c9e8db7 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d.h @@ -0,0 +1,164 @@ +#ifndef BATCHNORM2D_H_INCLUDED +#define BATCHNORM2D_H_INCLUDED + +#if RTNEURAL_USE_EIGEN +#include "batchnorm2d_eigen.h" +#include "batchnorm2d_eigen.tpp" +#elif RTNEURAL_USE_XSIMD +#include "batchnorm2d_xsimd.h" +#include "batchnorm2d_xsimd.tpp" +#else +#include "../Layer.h" +#include "../config.h" + +namespace RTNEURAL_NAMESPACE +{ +/** Dynamic batch normalization layer. */ +template +class BatchNorm2DLayer final : public Layer +{ +public: + BatchNorm2DLayer(int num_filters, int num_features); + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "batchnorm2d"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + for(int i = 0; i < num_features; i++) + { + for(int j = 0; j < num_filters; ++j) + { + out[i * num_filters + j] = (input[i * num_filters + j] - running_mean[j]) * multiplier[j] + beta[j]; + } + } + } + + /** Sets the layer "gamma" values. */ + RTNEURAL_REALTIME void setGamma(const std::vector& gammaVals); + + /** Sets the layer "beta" values. */ + RTNEURAL_REALTIME void setBeta(const std::vector& betaVals); + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + +private: + void updateMultiplier(); + + const int num_filters; + const int num_features; + + std::vector gamma; + std::vector beta; + + std::vector running_mean; + std::vector running_var; + + std::vector multiplier; + + T epsilon = (T)0; +}; + +/** Static batch normalization layer. */ +template +class BatchNorm2DT +{ +public: + static constexpr auto in_size = num_filters_t * num_features_t; + static constexpr auto out_size = num_filters_t * num_features_t; + static constexpr auto num_filters = num_filters_t; + static constexpr auto num_features = num_features_t; + static constexpr bool is_affine = affine; + + BatchNorm2DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "batchnorm2d"; } + + /** Returns false since batch-norm is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&ins)[in_size]) noexcept + { + for(int i = 0; i < num_features; i++) + { + for(int j = 0; j < num_filters; ++j) + { + outs[i * num_filters + j] = (ins[i * num_filters + j] - running_mean[j]) * multiplier[j] + beta[j]; + } + } + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&ins)[in_size]) noexcept + { + for(int i = 0; i < num_features; i++) + { + for(int j = 0; j < num_filters; ++j) + { + outs[i * num_filters + j] = (ins[i * num_filters + j] - running_mean[j]) * multiplier[j]; + } + } + } + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector& gammaVals); + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector&) { } + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector& betaVals); + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector&) { } + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + +private: + void updateMultiplier(); + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T gamma[num_filters_t]; + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T beta[num_filters_t]; + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T running_mean[num_filters_t]; + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T running_var[num_filters_t]; + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T multiplier[num_filters_t]; + + T epsilon = (T)0; +}; +} + +#endif // RTNEURAL_USE_STL + +#endif // BATCHNORM2D_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d.tpp new file mode 100644 index 0000000..12699e3 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d.tpp @@ -0,0 +1,116 @@ +#include "batchnorm2d.h" + +#if !RTNEURAL_USE_EIGEN && !RTNEURAL_USE_XSIMD + +namespace RTNEURAL_NAMESPACE +{ +template +BatchNorm2DLayer::BatchNorm2DLayer(int in_num_filters, int in_num_features) + : Layer(in_num_filters * in_num_features, in_num_filters * in_num_features) + , num_filters(in_num_filters) + , num_features(in_num_features) + , gamma(num_filters, (T)1) + , beta(num_filters, (T)0) + , running_mean(num_filters, (T)0) + , running_var(num_filters, (T)1) + , multiplier(num_filters, (T)1) +{ +} + +template +void BatchNorm2DLayer::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), gamma.begin()); + updateMultiplier(); +} + +template +void BatchNorm2DLayer::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), beta.begin()); +} + +template +void BatchNorm2DLayer::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), running_mean.begin()); +} + +template +void BatchNorm2DLayer::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), running_var.begin()); + updateMultiplier(); +} + +template +void BatchNorm2DLayer::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm2DLayer::updateMultiplier() +{ + for(int i = 0; i < num_filters; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} + +//============================================================ +template +BatchNorm2DT::BatchNorm2DT() +{ + std::fill(std::begin(outs), std::end(outs), (T)0); + + std::fill(std::begin(gamma), std::end(gamma), (T)1); + std::fill(std::begin(beta), std::end(beta), (T)0); + std::fill(std::begin(running_mean), std::end(running_mean), (T)0); + std::fill(std::begin(running_var), std::end(running_var), (T)1); + std::fill(std::begin(multiplier), std::end(multiplier), (T)1); +} + +template +template +typename std::enable_if::type BatchNorm2DT::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), std::begin(gamma)); + updateMultiplier(); +} + +template +template +typename std::enable_if::type BatchNorm2DT::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), std::begin(beta)); +} + +template +void BatchNorm2DT::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), std::begin(running_mean)); +} + +template +void BatchNorm2DT::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), std::begin(running_var)); + updateMultiplier(); +} + +template +void BatchNorm2DT::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm2DT::updateMultiplier() +{ + for(int i = 0; i < num_filters_t; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} +} + +#endif // RTNEURAL_USE_STL diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_eigen.h new file mode 100644 index 0000000..6d17723 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_eigen.h @@ -0,0 +1,162 @@ +#ifndef BATCHNORM2DEIGEN_H_INCLUDED +#define BATCHNORM2DEIGEN_H_INCLUDED + +#include "../Layer.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ +/** Dynamic batch normalization layer. */ +template +class BatchNorm2DLayer final : public Layer +{ +public: + BatchNorm2DLayer(int num_filters, int num_features); + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "batchnorm2d"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + auto inMat = Eigen::Map, RTNeuralEigenAlignment>( + input, num_filters, num_features); + + auto outMat = Eigen::Map, RTNeuralEigenAlignment>( + out, num_filters, num_features); + + // TODO: Should be possible to do it in one line with .colwise() but did not manage to do it yet. + for(int i = 0; i < num_features; i++) + { + outMat.col(i) = (inMat.col(i) - running_mean).cwiseProduct(multiplier) + beta; + } + } + + /** Sets the layer "gamma" values. */ + RTNEURAL_REALTIME void setGamma(const std::vector& gammaVals); + + /** Sets the layer "beta" values. */ + RTNEURAL_REALTIME void setBeta(const std::vector& betaVals); + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + +private: + void updateMultiplier(); + + const int num_filters; + const int num_features; + + Eigen::Vector gamma; + Eigen::Vector beta; + + Eigen::Vector running_mean; + Eigen::Vector running_var; + + Eigen::Vector multiplier; + + T epsilon = (T)0; +}; + +/** Static batch normalization layer. */ +template +class BatchNorm2DT +{ +public: + static constexpr auto in_size = num_filters_t * num_features_t; + static constexpr auto out_size = num_filters_t * num_features_t; + static constexpr auto num_filters = num_filters_t; + static constexpr auto num_features = num_features_t; + static constexpr bool is_affine = affine; + + BatchNorm2DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "batchnorm2d"; } + + /** Returns false since batch-norm is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const Eigen::Vector& ins) noexcept + { + auto inMat = Eigen::Map, RTNeuralEigenAlignment>(ins.data()); + auto outMat = Eigen::Map, RTNeuralEigenAlignment>(outs.data()); + + for(int i = 0; i < num_features; i++) + { + outMat.col(i) = (inMat.col(i) - running_mean).cwiseProduct(multiplier) + beta; + } + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const Eigen::Vector& ins) noexcept + { + auto inMat = Eigen::Map, RTNeuralEigenAlignment>(ins.data()); + auto outMat = Eigen::Map, RTNeuralEigenAlignment>(outs.data()); + + for(int i = 0; i < num_features; i++) + { + outMat.col(i) = (inMat.col(i) - running_mean).cwiseProduct(multiplier); + } + } + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector& gammaVals); + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector&) { } + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector& betaVals); + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector&) { } + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + + Eigen::Map, RTNeuralEigenAlignment> outs; + +private: + void updateMultiplier(); + + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + Eigen::Vector gamma; + Eigen::Vector beta; + + Eigen::Vector running_mean; + Eigen::Vector running_var; + + Eigen::Vector multiplier; + + T epsilon = (T)0; +}; +} + +#endif // BATCHNORM2DEIGEN_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_eigen.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_eigen.tpp new file mode 100644 index 0000000..2e41a4a --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_eigen.tpp @@ -0,0 +1,111 @@ +#include "batchnorm2d_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ +template +BatchNorm2DLayer::BatchNorm2DLayer(int in_num_filters, int in_num_features) + : Layer(in_num_filters * in_num_features, in_num_filters * in_num_features) + , num_filters(in_num_filters) + , num_features(in_num_features) +{ + gamma = Eigen::Vector::Ones(num_filters); + beta = Eigen::Vector::Zero(num_filters); + running_mean = Eigen::Vector::Zero(num_filters); + running_var = Eigen::Vector::Ones(num_filters); + multiplier = Eigen::Vector::Ones(num_filters); +} + +template +void BatchNorm2DLayer::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), gamma.begin()); + updateMultiplier(); +} + +template +void BatchNorm2DLayer::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), beta.begin()); +} + +template +void BatchNorm2DLayer::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), running_mean.begin()); +} + +template +void BatchNorm2DLayer::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), running_var.begin()); + updateMultiplier(); +} + +template +void BatchNorm2DLayer::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm2DLayer::updateMultiplier() +{ + for(int i = 0; i < num_filters; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} + +//============================================================ +template +BatchNorm2DT::BatchNorm2DT() + : outs(outs_internal) +{ + gamma = Eigen::Vector::Ones(num_filters_t); + beta = Eigen::Vector::Zero(num_filters_t); + running_mean = Eigen::Vector::Zero(num_filters_t); + running_var = Eigen::Vector::Ones(num_filters_t); + multiplier = Eigen::Vector::Ones(num_filters_t); +} + +template +template +typename std::enable_if::type BatchNorm2DT::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), std::begin(gamma)); + updateMultiplier(); +} + +template +template +typename std::enable_if::type BatchNorm2DT::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), std::begin(beta)); +} + +template +void BatchNorm2DT::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), std::begin(running_mean)); +} + +template +void BatchNorm2DT::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), std::begin(running_var)); + updateMultiplier(); +} + +template +void BatchNorm2DT::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm2DT::updateMultiplier() +{ + for(int i = 0; i < num_filters_t; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} +} diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_xsimd.h new file mode 100644 index 0000000..5613e71 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_xsimd.h @@ -0,0 +1,170 @@ +#ifndef RTNEURAL_BATCHNORM2D_XSIMD_H +#define RTNEURAL_BATCHNORM2D_XSIMD_H + +#include "../Layer.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ +/** Dynamic batch normalization layer. */ +template +class BatchNorm2DLayer final : public Layer +{ +public: + BatchNorm2DLayer(int num_filters, int num_features); + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "batchnorm2d"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + for(int i = 0; i < num_features; i++) + { + const auto* inCol = input + i * num_filters; + auto* outCol = out + i * num_filters; + xsimd::transform(inCol, inCol + num_filters, running_mean.begin(), outCol, + [](auto const& a, auto const& b) + { return a - b; }); + xsimd::transform(outCol, outCol + num_filters, multiplier.begin(), outCol, + [](auto const& a, auto const& b) + { return a * b; }); + xsimd::transform(outCol, outCol + num_filters, beta.begin(), outCol, + [](auto const& a, auto const& b) + { return a + b; }); + } + } + + /** Sets the layer "gamma" values. */ + RTNEURAL_REALTIME void setGamma(const std::vector& gammaVals); + + /** Sets the layer "beta" values. */ + RTNEURAL_REALTIME void setBeta(const std::vector& betaVals); + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + +private: + void updateMultiplier(); + + const int num_filters; + const int num_features; + + using vec_type = std::vector>; + + vec_type gamma; + vec_type beta; + + vec_type running_mean; + vec_type running_var; + + vec_type multiplier; + + T epsilon = (T)0; +}; + +/** Static batch normalization layer. */ +template +class BatchNorm2DT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_num_filters = ceil_div(num_filters_t, v_size); + static constexpr auto v_io_size = v_num_filters * num_features_t; + +public: + static constexpr auto in_size = num_filters_t * num_features_t; + static constexpr auto out_size = num_filters_t * num_features_t; + static constexpr auto num_filters = num_filters_t; + static constexpr auto num_features = num_features_t; + static constexpr bool is_affine = affine; + + BatchNorm2DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "batchnorm2d"; } + + /** Returns false since batch-norm is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&ins)[v_io_size]) noexcept + { + for(int i = 0; i < num_features; i++) + { + for(int j = 0; j < v_num_filters; ++j) + { + outs[i * v_num_filters + j] = (ins[i * v_num_filters + j] - running_mean[j]) * multiplier[j] + beta[j]; + } + } + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&ins)[v_io_size]) noexcept + { + for(int i = 0; i < num_features; i++) + { + for(int j = 0; j < v_num_filters; ++j) + { + outs[i * v_num_filters + j] = (ins[i * v_num_filters + j] - running_mean[j]) * multiplier[j]; + } + } + } + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector& gammaVals); + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector&) { } + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector& betaVals); + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector&) { } + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + + v_type outs[v_io_size]; + +private: + void updateMultiplier(); + + v_type gamma[v_num_filters]; + v_type beta[v_num_filters]; + + v_type running_mean[v_num_filters]; + v_type running_var[v_num_filters]; + + v_type multiplier[v_num_filters]; + + T epsilon = (T)0; +}; +} + +#endif // RTNEURAL_BATCHNORM2D_XSIMD_H diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_xsimd.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_xsimd.tpp new file mode 100644 index 0000000..ca17b5f --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm2d_xsimd.tpp @@ -0,0 +1,112 @@ +#include "batchnorm2d_xsimd.h" + +namespace RTNEURAL_NAMESPACE +{ +template +BatchNorm2DLayer::BatchNorm2DLayer(int in_num_filters, int in_num_features) + : Layer(in_num_filters * in_num_features, in_num_filters * in_num_features) + , num_filters(in_num_filters) + , num_features(in_num_features) + , gamma(num_filters, (T)1) + , beta(num_filters, (T)0) + , running_mean(num_filters, (T)0) + , running_var(num_filters, (T)1) + , multiplier(num_filters, (T)1) +{ +} + +template +void BatchNorm2DLayer::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), gamma.begin()); + updateMultiplier(); +} + +template +void BatchNorm2DLayer::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), beta.begin()); +} + +template +void BatchNorm2DLayer::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), running_mean.begin()); +} + +template +void BatchNorm2DLayer::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), running_var.begin()); + updateMultiplier(); +} + +template +void BatchNorm2DLayer::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm2DLayer::updateMultiplier() +{ + for(int i = 0; i < num_filters; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} + +//============================================================ +template +BatchNorm2DT::BatchNorm2DT() +{ + std::fill(std::begin(outs), std::end(outs), (T)0); + + std::fill(std::begin(gamma), std::end(gamma), (T)1); + std::fill(std::begin(beta), std::end(beta), (T)0); + std::fill(std::begin(running_mean), std::end(running_mean), (T)0); + std::fill(std::begin(running_var), std::end(running_var), (T)1); + std::fill(std::begin(multiplier), std::end(multiplier), (T)1); +} + +template +template +typename std::enable_if::type BatchNorm2DT::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), reinterpret_cast(std::begin(gamma))); + updateMultiplier(); +} + +template +template +typename std::enable_if::type BatchNorm2DT::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), reinterpret_cast(std::begin(beta))); +} + +template +void BatchNorm2DT::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), reinterpret_cast(std::begin(running_mean))); +} + +template +void BatchNorm2DT::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), reinterpret_cast(std::begin(running_var))); + updateMultiplier(); +} + +template +void BatchNorm2DT::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm2DT::updateMultiplier() +{ + for(int i = 0; i < v_num_filters; ++i) + multiplier[i] = gamma[i] / xsimd::sqrt(running_var[i] + epsilon); +} +} diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_eigen.h new file mode 100644 index 0000000..a8d42ec --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_eigen.h @@ -0,0 +1,141 @@ +#ifndef BATCHNORMEIGEN_H_INCLUDED +#define BATCHNORMEIGEN_H_INCLUDED + +#include "../Layer.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ +/** Dynamic batch normalization layer. */ +template +class BatchNorm1DLayer final : public Layer +{ +public: + explicit BatchNorm1DLayer(int size); + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "batchnorm"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + auto inVec = Eigen::Map, RTNeuralEigenAlignment>( + input, Layer::in_size, 1); + + auto outVec = Eigen::Map, RTNeuralEigenAlignment>( + out, Layer::in_size, 1); + + outVec = multiplier.cwiseProduct(inVec - running_mean) + beta; + } + + /** Sets the layer "gamma" values. */ + RTNEURAL_REALTIME void setGamma(const std::vector& gammaVals); + + /** Sets the layer "beta" values. */ + RTNEURAL_REALTIME void setBeta(const std::vector& betaVals); + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + +private: + void updateMultiplier(); + + Eigen::Vector gamma; + Eigen::Vector beta; + + Eigen::Vector running_mean; + Eigen::Vector running_var; + + Eigen::Vector multiplier; + + T epsilon = (T)0; +}; + +/** Static batch normalization layer. */ +template +class BatchNorm1DT +{ +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + static constexpr bool is_affine = affine; + + BatchNorm1DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "batchnorm"; } + + /** Returns false since batch-norm is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const Eigen::Matrix& ins) noexcept + { + outs = multiplier.cwiseProduct(ins - running_mean) + beta; + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const Eigen::Matrix& ins) noexcept + { + outs = multiplier.cwiseProduct(ins - running_mean); + } + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector& gammaVals); + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector&) { } + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector& betaVals); + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector&) { } + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + + Eigen::Map, RTNeuralEigenAlignment> outs; + +private: + void updateMultiplier(); + + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + Eigen::Vector gamma; + Eigen::Vector beta; + + Eigen::Vector running_mean; + Eigen::Vector running_var; + + Eigen::Vector multiplier; + + T epsilon = (T)0; +}; +} + +#endif // BATCHNORMEIGEN_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_eigen.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_eigen.tpp new file mode 100644 index 0000000..b2657f6 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_eigen.tpp @@ -0,0 +1,109 @@ +#include "batchnorm_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ +template +BatchNorm1DLayer::BatchNorm1DLayer(int size) + : Layer(size, size) +{ + gamma = Eigen::Vector::Ones(size); + beta = Eigen::Vector::Zero(size); + running_mean = Eigen::Vector::Zero(size); + running_var = Eigen::Vector::Ones(size); + multiplier = Eigen::Vector::Ones(size); +} + +template +void BatchNorm1DLayer::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), gamma.begin()); + updateMultiplier(); +} + +template +void BatchNorm1DLayer::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), beta.begin()); +} + +template +void BatchNorm1DLayer::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), running_mean.begin()); +} + +template +void BatchNorm1DLayer::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), running_var.begin()); + updateMultiplier(); +} + +template +void BatchNorm1DLayer::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm1DLayer::updateMultiplier() +{ + for(int i = 0; i < Layer::out_size; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} + +//============================================================ +template +BatchNorm1DT::BatchNorm1DT() + : outs(outs_internal) +{ + gamma = Eigen::Vector::Ones(size); + beta = Eigen::Vector::Zero(size); + running_mean = Eigen::Vector::Zero(size); + running_var = Eigen::Vector::Ones(size); + multiplier = Eigen::Vector::Ones(size); +} + +template +template +typename std::enable_if::type BatchNorm1DT::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), std::begin(gamma)); + updateMultiplier(); +} + +template +template +typename std::enable_if::type BatchNorm1DT::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), std::begin(beta)); +} + +template +void BatchNorm1DT::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), std::begin(running_mean)); +} + +template +void BatchNorm1DT::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), std::begin(running_var)); + updateMultiplier(); +} + +template +void BatchNorm1DT::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm1DT::updateMultiplier() +{ + for(int i = 0; i < out_size; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} +} diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_xsimd.h new file mode 100644 index 0000000..cd20737 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_xsimd.h @@ -0,0 +1,149 @@ +#ifndef BATCHNORMXSIMD_H_INCLUDED +#define BATCHNORMXSIMD_H_INCLUDED + +#include "../Layer.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ +/** Dynamic batch normalization layer. */ +template +class BatchNorm1DLayer final : public Layer +{ +public: + explicit BatchNorm1DLayer(int size); + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "batchnorm"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + xsimd::transform(input, input + Layer::in_size, running_mean.begin(), out, + [](auto const& a, auto const& b) + { return a - b; }); + xsimd::transform(out, out + Layer::in_size, multiplier.begin(), out, + [](auto const& a, auto const& b) + { return a * b; }); + xsimd::transform(out, out + Layer::in_size, beta.begin(), out, + [](auto const& a, auto const& b) + { return a + b; }); + } + + /** Sets the layer "gamma" values. */ + RTNEURAL_REALTIME void setGamma(const std::vector& gammaVals); + + /** Sets the layer "beta" values. */ + RTNEURAL_REALTIME void setBeta(const std::vector& betaVals); + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + +private: + void updateMultiplier(); + + using vec_type = std::vector>; + + vec_type gamma; + vec_type beta; + + vec_type running_mean; + vec_type running_var; + + vec_type multiplier; + + T epsilon = (T)0; +}; + +/** Static batch normalization layer. */ +template +class BatchNorm1DT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_out_size = ceil_div(size, v_size); + +public: + static constexpr auto in_size = size; + static constexpr auto out_size = size; + static constexpr bool is_affine = affine; + + BatchNorm1DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "batchnorm"; } + + /** Returns false since batch-norm is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&ins)[v_out_size]) noexcept + { + for(int k = 0; k < v_out_size; ++k) + outs[k] = multiplier[k] * (ins[k] - running_mean[k]) + beta[k]; + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&ins)[v_out_size]) noexcept + { + for(int k = 0; k < v_out_size; ++k) + outs[k] = multiplier[k] * (ins[k] - running_mean[k]); + } + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector& gammaVals); + + /** Sets the layer "gamma" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setGamma(const std::vector&) { } + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector& betaVals); + + /** Sets the layer "beta" values. */ + template + RTNEURAL_REALTIME typename std::enable_if::type setBeta(const std::vector&) { } + + /** Sets the layer's trained running mean. */ + RTNEURAL_REALTIME void setRunningMean(const std::vector& runningMean); + + /** Set's the layer's trained running variance. */ + RTNEURAL_REALTIME void setRunningVariance(const std::vector& runningVar); + + /** Set's the layer "epsilon" value. */ + RTNEURAL_REALTIME void setEpsilon(T epsilon); + + v_type outs[v_out_size]; + +private: + void updateMultiplier(); + + v_type gamma[v_out_size]; + v_type beta[v_out_size]; + + v_type running_mean[v_out_size]; + v_type running_var[v_out_size]; + + v_type multiplier[v_out_size]; + + T epsilon = (T)0; +}; +} + +#endif // BATCHNORMXSIMD_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_xsimd.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_xsimd.tpp new file mode 100644 index 0000000..3946af3 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/batchnorm/batchnorm_xsimd.tpp @@ -0,0 +1,110 @@ +#include "batchnorm_xsimd.h" + +namespace RTNEURAL_NAMESPACE +{ +template +BatchNorm1DLayer::BatchNorm1DLayer(int size) + : Layer(size, size) + , gamma(size, (T)1) + , beta(size, (T)0) + , running_mean(size, (T)0) + , running_var(size, (T)1) + , multiplier(size, (T)1) +{ +} + +template +void BatchNorm1DLayer::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), gamma.begin()); + updateMultiplier(); +} + +template +void BatchNorm1DLayer::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), beta.begin()); +} + +template +void BatchNorm1DLayer::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), running_mean.begin()); +} + +template +void BatchNorm1DLayer::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), running_var.begin()); + updateMultiplier(); +} + +template +void BatchNorm1DLayer::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm1DLayer::updateMultiplier() +{ + for(int i = 0; i < Layer::out_size; ++i) + multiplier[i] = gamma[i] / std::sqrt(running_var[i] + epsilon); +} + +//============================================================ +template +BatchNorm1DT::BatchNorm1DT() +{ + std::fill(std::begin(outs), std::end(outs), (T)0); + + std::fill(std::begin(gamma), std::end(gamma), (T)1); + std::fill(std::begin(beta), std::end(beta), (T)0); + std::fill(std::begin(running_mean), std::end(running_mean), (T)0); + std::fill(std::begin(running_var), std::end(running_var), (T)1); + std::fill(std::begin(multiplier), std::end(multiplier), (T)1); +} + +template +template +typename std::enable_if::type BatchNorm1DT::setGamma(const std::vector& gammaVals) +{ + std::copy(gammaVals.begin(), gammaVals.end(), reinterpret_cast(std::begin(gamma))); + updateMultiplier(); +} + +template +template +typename std::enable_if::type BatchNorm1DT::setBeta(const std::vector& betaVals) +{ + std::copy(betaVals.begin(), betaVals.end(), reinterpret_cast(std::begin(beta))); +} + +template +void BatchNorm1DT::setRunningMean(const std::vector& runningMean) +{ + std::copy(runningMean.begin(), runningMean.end(), reinterpret_cast(std::begin(running_mean))); +} + +template +void BatchNorm1DT::setRunningVariance(const std::vector& runningVar) +{ + std::copy(runningVar.begin(), runningVar.end(), reinterpret_cast(std::begin(running_var))); + updateMultiplier(); +} + +template +void BatchNorm1DT::setEpsilon(T newEpsilon) +{ + epsilon = newEpsilon; + updateMultiplier(); +} + +template +void BatchNorm1DT::updateMultiplier() +{ + for(int i = 0; i < v_out_size; ++i) + multiplier[i] = gamma[i] / xsimd::sqrt(running_var[i] + epsilon); +} +} diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/common.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/common.h new file mode 100644 index 0000000..29750e9 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/common.h @@ -0,0 +1,259 @@ +#pragma once + +namespace RTNEURAL_NAMESPACE +{ + +/** + * For templated recurrent layers (e.g. LSTMLayerT, GRULayerT), + * this class can be used as a template argument to allow the + * recurrent layer to perform real-time sample-rate correction. + * + * For example, if you have a GRU network that was trained at 48 kHz + * and want to process data at 96 kHz, you could enable sample-rate + * correction for that layer, and prepare it to use a 2-sample delay, + * instead of the standard 1-sample delay (since the target sample rate + * is 2x the training sample rate). Note that sample-rate correction + * does not support delay lengths less than 1-sample, so the target sample + * rate must always be greater than or equal to the training sample rate. + */ +enum class SampleRateCorrectionMode +{ + None, // no sample rate correction + NoInterp, // sample rate correction with no interpolation (only appropriate for integer delay lengths) + LinInterp, // sample rate correction with linear interpolation (can be used with non-integer delay lengths) +}; + +/** Divides two numbers and rounds up if there is a remainder. */ +template +constexpr T ceil_div(T num, T den) +{ + return (num + den - 1) / den; +} +} // namespace RTNEURAL_NAMESPACE + +#if RTNEURAL_USE_EIGEN +#include + +namespace RTNEURAL_NAMESPACE +{ +#if RTNEURAL_DEFAULT_ALIGNMENT == 32 +constexpr auto RTNeuralEigenAlignment = Eigen::Aligned32; +#elif RTNEURAL_DEFAULT_ALIGNMENT == 16 +constexpr auto RTNeuralEigenAlignment = Eigen::Aligned16; +#elif RTNEURAL_DEFAULT_ALIGNMENT == 8 +constexpr auto RTNeuralEigenAlignment = Eigen::Aligned8; +#else +#error "Unsupported alignment" +#endif +} // namespace RTNEURAL_NAMESPACE + +#elif RTNEURAL_USE_XSIMD +#include + +#include "xsimd-legacy/algorithms/algorithms.hpp" + +namespace RTNEURAL_NAMESPACE +{ + +template +static inline xsimd::simd_type set_value(xsimd::simd_type x, int idx, T value) noexcept +{ + union UnionType + { + xsimd::simd_type v; + T s[xsimd::simd_type::size]; + }; + UnionType u { x }; + + u.s[idx] = value; + return u.v; +} + +template +static inline T get_value(xsimd::simd_type x, int idx) noexcept +{ + union UnionType + { + xsimd::simd_type v; + T s[xsimd::simd_type::size]; + }; + UnionType u { x }; + + return u.s[idx]; +} + +template +static inline T vMult(const T* arg1, const T* arg2, T* prod, + int dim) noexcept +{ + xsimd::transform(arg1, &arg1[dim], arg2, prod, + [](auto const& a, auto const& b) + { return a * b; }); + + return xsimd::reduce(prod, &prod[dim], (T)0); +} + +template +static inline void vAdd(const T* in1, const T* in2, T* out, + int dim) noexcept +{ + xsimd::transform(in1, &in1[dim], in2, out, + [](auto const& a, auto const& b) + { return a + b; }); +} + +template +static inline void vSub(const T* in1, const T* in2, T* out, + int dim) noexcept +{ + xsimd::transform(in1, &in1[dim], in2, out, + [](auto const& a, auto const& b) + { return a - b; }); +} + +template +static inline void vProd(const T* in1, const T* in2, T* out, + int dim) noexcept +{ + xsimd::transform(in1, &in1[dim], in2, out, + [](auto const& a, auto const& b) + { return a * b; }); +} + +template +static inline void vCopy(const T* in, T* out, int dim) noexcept +{ + using b_type = xsimd::simd_type; + constexpr auto inc = (int)b_type::size; + + // size for which the vectorization is possible + auto vec_size = dim - dim % inc; + for(int i = 0; i < vec_size; i += inc) + { + b_type vec = xsimd::load_aligned(&in[i]); + xsimd::store_aligned(&out[i], vec); + } + + // Remaining part that cannot be vectorize + for(auto i = vec_size; i < dim; ++i) + out[i] = in[i]; +} + +template +static inline void sigmoid(const T* in, T* out, int dim) noexcept +{ + using b_type = xsimd::simd_type; + constexpr auto inc = (int)b_type::size; + + // size for which the vectorization is possible + auto vec_size = dim - dim % inc; + for(int i = 0; i < vec_size; i += inc) + { + b_type x_vec = xsimd::load_aligned(&in[i]); + b_type y_vec = MathsProvider::sigmoid(x_vec); + xsimd::store_aligned(&out[i], y_vec); + } + + // Remaining part that cannot be vectorize + for(auto i = vec_size; i < dim; ++i) + out[i] = MathsProvider::sigmoid(in[i]); +} + +template +static inline void softmax(const T* in, T* out, int dim) noexcept +{ + using b_type = xsimd::simd_type; + constexpr auto inc = (int)b_type::size; + + b_type exp_sum_vec {}; + + // size for which the vectorization is possible + auto vec_size = dim - dim % inc; + for(int i = 0; i < vec_size; i += inc) + { + b_type x_vec = xsimd::load_aligned(&in[i]); + b_type y_vec = MathsProvider::exp(x_vec); + exp_sum_vec += y_vec; + xsimd::store_aligned(&out[i], y_vec); + } + + T exp_sum = xsimd::reduce_add(exp_sum_vec); + + // Remaining part that cannot be vectorize + for(auto i = vec_size; i < dim; ++i) + { + out[i] = MathsProvider::exp(in[i]); + exp_sum += out[i]; + } + + const auto exp_sum_recip = (T)1 / exp_sum; + for(int i = 0; i < vec_size; i += inc) + { + b_type x_vec = xsimd::load_aligned(&out[i]); + b_type y_vec = x_vec * exp_sum_recip; + xsimd::store_aligned(&out[i], y_vec); + } + + // Remaining part that cannot be vectorize + for(auto i = vec_size; i < dim; ++i) + { + out[i] *= exp_sum_recip; + } +} + +template +static inline void tanh(const T* in, T* out, int dim) noexcept +{ + using b_type = xsimd::simd_type; + constexpr auto inc = (int)b_type::size; + + // size for which the vectorization is possible + auto vec_size = dim - dim % inc; + for(int i = 0; i < vec_size; i += inc) + { + b_type x_vec = xsimd::load_aligned(&in[i]); + b_type y_vec = MathsProvider::tanh(x_vec); + xsimd::store_aligned(&out[i], y_vec); + } + + // Remaining part that cannot be vectorize + for(auto i = vec_size; i < dim; ++i) + out[i] = MathsProvider::tanh(in[i]); +} + +template +static inline void elu(const T* in, T* out, int dim, T alpha) noexcept +{ + using b_type = xsimd::simd_type; + constexpr auto inc = (int)b_type::size; + + // size for which the vectorization is possible + auto vec_size = dim - dim % inc; + for(int i = 0; i < vec_size; i += inc) + { + b_type x_vec = xsimd::load_aligned(&in[i]); + b_type y_vec = xsimd::select(x_vec > (T)0, x_vec, alpha * (MathsProvider::exp(x_vec) - (T)1)); + xsimd::store_aligned(&out[i], y_vec); + } + + // Remaining part that cannot be vectorized + for(auto i = vec_size; i < dim; ++i) + out[i] = in[i] > (T)0 ? in[i] : (alpha * (MathsProvider::exp(in[i]) - (T)1)); +} +} // namespace RTNEURAL_NAMESPACE + +#else // STL backend +#include +#include +#include + +namespace RTNEURAL_NAMESPACE +{ +template +static inline T vMult(const T* arg1, const T* arg2, int dim) noexcept +{ + return std::inner_product(arg1, arg1 + dim, arg2, (T)0); +} +} // namespace RTNEURAL_NAMESPACE + +#endif diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/config.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/config.h new file mode 100644 index 0000000..ac85f37 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/config.h @@ -0,0 +1,37 @@ +#pragma once + +#ifndef RTNEURAL_NAMESPACE +#define RTNEURAL_NAMESPACE RTNeural +#endif + +#ifndef RTNEURAL_DEFAULT_ALIGNMENT +#if _MSC_VER +#pragma message("RTNEURAL_DEFAULT_ALIGNMENT was not defined! Using default alignment = 16.") +#else +#warning "RTNEURAL_DEFAULT_ALIGNMENT was not defined! Using default alignment = 16." +#endif +#define RTNEURAL_DEFAULT_ALIGNMENT 16 +#endif + +/** + Facilitate testing real-time safety with RealtimeSanitizer (RADSan) + + For more information, see https://github.com/realtime-sanitizer/radsan. + The `[[clang::realtime]]` attribute is unique to a RADSan-modified + version of clang, and its appearance will result in an error for other + compilers. Here, we make its presence configurable. RealtimeSanitizer is + very early stage, and this configuration may change. + + This real-time safety checking is designed to function mostly in CI. If you + wish to test it locally on your dev machine, you'll need to either: + + i) use the RADSan clang Docker image (recommended), or + ii) get the RADSan clang compiler, + + for which instructions may be found in the RADSan repository above. +*/ +#ifdef RTNEURAL_RADSAN_ENABLED +#define RTNEURAL_REALTIME [[clang::realtime]] +#else +#define RTNEURAL_REALTIME +#endif diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d.h new file mode 100644 index 0000000..e161c31 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d.h @@ -0,0 +1,324 @@ +#ifndef CONV1D_H_INCLUDED +#define CONV1D_H_INCLUDED + +#if RTNEURAL_USE_EIGEN +#include "conv1d_eigen.h" +#include "conv1d_eigen.tpp" +#elif RTNEURAL_USE_XSIMD +#include "conv1d_xsimd.h" +#include "conv1d_xsimd.tpp" +#else +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a 1-dimensional convolution layer + * with no activation. + * + * This implementation was designed to be used for "temporal + * convolution", so the layer has a "state" made up of past inputs + * to the layer. To ensure that the state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + */ +template +class Conv1D final : public Layer +{ +public: + /** + * Constructs a convolution layer for the given dimensions. + * + * @param in_size: the input size for the layer + * @param out_size: the output size for the layer + * @param kernel_size: the size of the convolution kernel + * @param dilation: the dilation rate to use for dilated convolution + */ + Conv1D(int in_size, int out_size, int kernel_size, int dilation, int groups = 1); + Conv1D(std::initializer_list sizes); + Conv1D(const Conv1D& other); + Conv1D& operator=(const Conv1D& other); + virtual ~Conv1D(); + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() override; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "conv1d"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* h) noexcept override + { + // insert input into a circular buffer + std::copy(input, input + Layer::in_size, state[state_ptr]); + + // set state pointers to particular columns of the buffer + setStatePointers(); + + if(groups == 1) + { + // copy selected columns to a helper variable + for(int k = 0; k < kernel_size; ++k) + { + const auto& col = state[state_ptrs[k]]; + std::copy(col, col + Layer::in_size, state_cols[k]); + } + + // perform multi-channel convolution + for(int i = 0; i < Layer::out_size; ++i) + { + h[i] = bias[i]; + for(int k = 0; k < kernel_size; ++k) + h[i] = std::inner_product( + weights[i][k], + weights[i][k] + filters_per_group, + state_cols[k], + h[i]); + } + } + else + { + // perform multi-channel convolution + for(int i = 0; i < Layer::out_size; ++i) + { + h[i] = bias[i]; + const auto ii = ((i / channels_per_group) * filters_per_group); + for(int k = 0; k < kernel_size; ++k) + { + // copy selected columns to a helper variable + const auto& column = state[state_ptrs[k]]; + + const auto column_begin = column + ii; + const auto column_end = column_begin + filters_per_group; + std::copy(column_begin, column_end, state_cols[k]); + + h[i] = std::inner_product( + weights[i][k], + weights[i][k] + filters_per_group, + state_cols[k], + h[i]); + } + } + } + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[out_size][in_size][kernel_size * dilation] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& weights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const std::vector& biasVals); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size; } + + /** Returns the convolution dilation rate. */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate; } + + /** Returns the number of "groups" in the convolution. */ + int getGroups() const noexcept { return groups; } + +private: + const int dilation_rate; + const int kernel_size; + const int state_size; + const int groups; + const int filters_per_group; + const int channels_per_group; + + T*** weights; + T* bias; + + T** state; + T** state_cols; + + int* state_ptrs; + int state_ptr = 0; + + /** Sets pointers to state array columns. */ + inline void setStatePointers() + { + for(int k = 0; k < kernel_size; ++k) + state_ptrs[k] = (state_ptr + state_size - k * dilation_rate) % state_size; + } +}; + +//==================================================== +/** + * Static implementation of a 1-dimensional convolution layer + * with no activation. + * + * This implementation was designed to be used for "temporal + * convolution", so the layer has a "state" made up of past inputs + * to the layer. To ensure that the state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * @param in_sizet: the input size for the layer + * @param out_sizet: the output size for the layer + * @param kernel_size: the size of the convolution kernel + * @param dilation_rate: the dilation rate to use for dilated convolution + * @param dynamic_state: use dynamically allocated layer state + * @param groups: controls connections between inputs and outputs + */ +template +class Conv1DT +{ + static_assert((in_sizet % groups == 0) && (out_sizet % groups == 0), "in_size and out_size must be divisible by groups!"); + + static constexpr auto state_size = (kernel_size - 1) * dilation_rate + 1; + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + static constexpr auto filters_per_group = in_size / groups; + static constexpr auto channels_per_group = out_size / groups; + + Conv1DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "conv1d"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset(); + + template = true> + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T (&ins)[in_size]) noexcept + { + // insert input into a circular buffer + std::copy(std::begin(ins), std::end(ins), state[state_ptr].begin()); + + // set state pointers to particular columns of the buffer + setStatePointers(); + + // copy selected columns to a helper variable + for(int k = 0; k < kernel_size; ++k) + { + const auto& col = state[state_ptrs[k]]; + std::copy(col.begin(), col.end(), state_cols[k].begin()); + } + + // perform multi-channel convolution + for(int i = 0; i < out_size; ++i) + { + outs[i] = bias[i]; + for(int k = 0; k < kernel_size; ++k) + outs[i] = std::inner_product( + weights[i][k].begin(), + weights[i][k].end(), + state_cols[k].begin(), + outs[i]); + } + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + template = true> + /** Performs forward propagation for this layer. */ + inline void forward(const T (&ins)[in_size]) noexcept + { + // insert input into a circular buffer + std::copy(std::begin(ins), std::end(ins), state[state_ptr].begin()); + + // set state pointers to particular columns of the buffer + setStatePointers(); + + // perform multi-channel convolution + for(int i = 0; i < out_size; ++i) + { + outs[i] = bias[i]; + + const auto ii = ((i / channels_per_group) * filters_per_group); + for(int k = 0; k < kernel_size; ++k) + { + // copy selected columns to a helper variable + const auto& column = state[state_ptrs[k]]; + const auto column_begin = column.begin() + ii; + const auto column_end = column_begin + filters_per_group; + std::copy(column_begin, column_end, state_cols[k].begin()); + + outs[i] = std::inner_product( + weights[i][k].begin(), + weights[i][k].end(), + state_cols[k].begin(), + outs[i]); + } + } + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[out_size][group_count][kernel_size * dilation] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& weights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const std::vector& biasVals); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size; } + + /** Returns the convolution dilation rate. */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate; } + + /** Returns the number of "groups" in the convolution. */ + int getGroups() const noexcept { return groups; } + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + +private: + template + typename std::enable_if::type resize_state() + { + state.resize(state_size, {}); + } + + template + typename std::enable_if::type resize_state() { } + + using state_type = typename std::conditional>, std::array, state_size>>::type; + using weights_type = std::array, kernel_size>; + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) state_type state; + alignas(RTNEURAL_DEFAULT_ALIGNMENT) weights_type state_cols; + + int state_ptr = 0; + std::array state_ptrs; + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) weights_type weights[out_size]; + alignas(RTNEURAL_DEFAULT_ALIGNMENT) std::array bias; + + /** Sets pointers to state array columns. */ + inline void setStatePointers() + { + for(int k = 0; k < kernel_size; ++k) + state_ptrs[k] = (state_ptr + state_size - k * dilation_rate) % state_size; + } +}; +} // namespace RTNEURAL_NAMESPACE +#endif +#endif // CONV1D_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d.tpp new file mode 100644 index 0000000..a454d3b --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d.tpp @@ -0,0 +1,172 @@ +#include "conv1d.h" + +namespace RTNEURAL_NAMESPACE +{ + +#if !RTNEURAL_USE_EIGEN && !RTNEURAL_USE_XSIMD + +template +Conv1D::Conv1D(int in_size, int out_size, int kernel_size, int dilation, int num_groups) + : Layer(in_size, out_size) + , dilation_rate(dilation) + , kernel_size(kernel_size) + , state_size((kernel_size - 1) * dilation + 1) + , groups(num_groups) + , filters_per_group(in_size / groups) + , channels_per_group(out_size / groups) +{ + weights = new T**[out_size]; + for(int i = 0; i < out_size; ++i) + { + weights[i] = new T*[kernel_size]; + for(int k = 0; k < kernel_size; ++k) + { + weights[i][k] = new T[filters_per_group]; + std::fill(weights[i][k], weights[i][k] + filters_per_group, (T)0); + } + } + + bias = new T[out_size]; + + state = new T*[state_size]; + for(int k = 0; k < state_size; ++k) + state[k] = new T[in_size]; + + state_cols = new T*[kernel_size]; + for(int k = 0; k < kernel_size; ++k) + state_cols[k] = new T[filters_per_group]; + + state_ptrs = new int[kernel_size]; +} + +template +Conv1D::Conv1D(std::initializer_list sizes) + : Conv1D(*sizes.begin(), *(sizes.begin() + 1), *(sizes.begin() + 2), *(sizes.begin() + 3)) +{ +} + +template +Conv1D::Conv1D(const Conv1D& other) + : Conv1D(other.in_size, other.out_size, other.kernel_size, other.dilation_rate) +{ +} + +template +Conv1D& Conv1D::operator=(const Conv1D& other) +{ + if(&other != this) + *this = Conv1D(other); + + return *this; +} + +template +Conv1D::~Conv1D() +{ + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < kernel_size; ++k) + delete[] weights[i][k]; + + delete[] weights[i]; + } + + delete[] weights; + delete[] bias; + + for(int k = 0; k < state_size; ++k) + delete[] state[k]; + delete[] state; + + for(int k = 0; k < kernel_size; ++k) + delete[] state_cols[k]; + delete[] state_cols; + + delete[] state_ptrs; +} + +template +void Conv1D::reset() +{ + for(int k = 0; k < state_size; ++k) + std::fill(state[k], state[k] + Layer::in_size, (T)0); + + for(int k = 0; k < kernel_size; ++k) + std::fill(state_cols[k], state_cols[k] + filters_per_group, (T)0); + + for(int k = 0; k < kernel_size; ++k) + state_ptrs[k] = 0; + + state_ptr = 0; +} + +template +void Conv1D::setWeights(const std::vector>>& ws) +{ + for(int i = 0; i < Layer::out_size; ++i) + for(int k = 0; k < filters_per_group; ++k) + for(int j = 0; j < kernel_size; ++j) + weights[i][j][k] = ws[i][k][j]; +} + +template +void Conv1D::setBias(const std::vector& biasVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + bias[i] = biasVals[i]; +} + +//==================================================== +template +Conv1DT::Conv1DT() +{ + for(int i = 0; i < out_size; ++i) + for(int j = 0; j < kernel_size; ++j) + for(int k = 0; k < filters_per_group; ++k) + weights[i][j][k] = (T)0.0; + + for(int i = 0; i < out_size; ++i) + bias[i] = (T)0.0; + + for(int i = 0; i < out_size; ++i) + outs[i] = (T)0.0; + + resize_state(); + reset(); +} + +template +void Conv1DT::reset() +{ + for(int i = 0; i < state_size; ++i) + for(int k = 0; k < in_size; ++k) + state[i][k] = (T)0.0; + + for(int i = 0; i < kernel_size; ++i) + for(int k = 0; k < filters_per_group; ++k) + state_cols[i][k] = (T)0.0; + + state_ptr = 0; + for(int i = 0; i < kernel_size; ++i) + state_ptrs[i] = 0; +} + +template +void Conv1DT::setWeights(const std::vector>>& ws) +{ + for(int i = 0; i < out_size; ++i) + for(int k = 0; k < filters_per_group; ++k) + for(int j = 0; j < kernel_size; ++j) + weights[i][j][k] = ws[i][k][j]; +} + +template +void Conv1DT::setBias(const std::vector& biasVals) +{ + for(int i = 0; i < out_size; ++i) + bias[i] = biasVals[i]; +} + +#endif + +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_eigen.h new file mode 100644 index 0000000..582d819 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_eigen.h @@ -0,0 +1,274 @@ +#ifndef CONV1DEIGEN_H_INCLUDED +#define CONV1DEIGEN_H_INCLUDED + +#include "../Layer.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a 1-dimensional convolution layer + * with no activation. + * + * This implementation was designed to be used for "temporal + * convolution", so the layer has a "state" made up of past inputs + * to the layer. To ensure that the state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + */ +template +class Conv1D : public Layer +{ +public: + /** + * Constructs a convolution layer for the given dimensions. + * + * @param in_size: the input size for the layer + * @param out_size: the output size for the layer + * @param kernel_size: the size of the convolution kernel + * @param dilation: the dilation rate to use for dilated convolution + */ + Conv1D(int in_size, int out_size, int kernel_size, int dilation, int groups = 1); + Conv1D(std::initializer_list sizes); + Conv1D(const Conv1D& other); + Conv1D& operator=(const Conv1D& other); + virtual ~Conv1D(); + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() override; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "conv1d"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* h) noexcept override + { + // insert input into a circular buffer + state.col(state_ptr) = Eigen::Map, + RTNeuralEigenAlignment>(input, Layer::in_size); + + // set state pointers to the particular columns of the buffer + setStatePointers(); + + if(groups == 1) + { + // copy selected columns to a helper variable + for(int k = 0; k < kernel_size; ++k) + state_cols.col(k) = state.col(state_ptrs(k)); + + // perform a multichannel convolution + for(int i = 0; i < Layer::out_size; ++i) + h[i] = state_cols.cwiseProduct(kernelWeights[i]).sum() + bias(i); + } + else + { + // perform a multichannel convolution + for(int i = 0; i < Layer::out_size; ++i) + { + // copy selected columns to a helper variable + const auto ii = ((i / channels_per_group) * filters_per_group); + for(int k = 0; k < kernel_size; ++k) + state_cols.col(k) = state.col(state_ptrs(k))(Eigen::seqN(ii, filters_per_group)); + + h[i] = state_cols.cwiseProduct(kernelWeights[i]).sum() + bias(i); + } + } + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[out_size][in_size][kernel_size * dilation] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& weights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const std::vector& biasVals); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size; } + + /** Returns the convolution dilation rate. */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate; } + + /** Returns the number of "groups" in the convolution. */ + int getGroups() const noexcept { return groups; } + +private: + const int dilation_rate; + const int kernel_size; + const int state_size; + const int groups; + const int filters_per_group; + const int channels_per_group; + + std::vector> kernelWeights; + Eigen::Vector bias; + + Eigen::Matrix state; + Eigen::Matrix state_cols; + Eigen::VectorXi state_ptrs; + int state_ptr = 0; + + /** Sets pointers to state array columns. */ + inline void setStatePointers() + { + for(int k = 0; k < kernel_size; ++k) + state_ptrs[k] = (state_ptr + state_size - k * dilation_rate) % state_size; + } +}; + +//==================================================== +/** + * Static implementation of a 1-dimensional convolution layer + * with no activation. + * + * This implementation was designed to be used for "temporal + * convolution", so the layer has a "state" made up of past inputs + * to the layer. To ensure that the state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * @param in_sizet: the input size for the layer + * @param out_sizet: the output size for the layer + * @param kernel_size: the size of the convolution kernel + * @param dilation_rate: the dilation rate to use for dilated convolution + * @param dynamic_state: use dynamically allocated layer state + */ +template +class Conv1DT +{ + using vec_type = Eigen::Vector; + + static_assert((in_sizet % groups == 0) && (out_sizet % groups == 0), "in_sizet and out_sizet must be divisible by groups!"); + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + static constexpr auto dilation = dilation_rate; + static constexpr auto kernel_length = kernel_size; + static constexpr auto filters_per_group = in_size / groups; + static constexpr auto channels_per_group = out_size / groups; + + static constexpr auto state_size = (kernel_size - 1) * dilation_rate + 1; + using state_type = Eigen::Matrix; + using weights_type = Eigen::Matrix; + using state_ptrs_type = Eigen::Vector; + + Conv1DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "conv1d"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset(); + + /** Performs forward propagation for this layer. */ + template = true> + RTNEURAL_REALTIME inline void forward(const Eigen::Matrix& ins) noexcept + { + // insert input into a circular buffer + state.col(state_ptr) = ins; + + // set state pointers to particular columns of the buffer + setStatePointers(); + + // copy selected columns to a helper variable + for(int k = 0; k < kernel_length; ++k) + state_cols.col(k) = state.col(state_ptrs(k)); + + // perform a multichannel convolution + for(int i = 0; i < out_size; ++i) + outs(i) = state_cols.cwiseProduct(weights[i]).sum() + bias(i); + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + /** Performs forward propagation for this layer (groups > 1). */ + template = true> + RTNEURAL_REALTIME inline void forward(const Eigen::Matrix& ins) noexcept + { + // insert input into a circular buffer + state.col(state_ptr) = ins; + + // set state pointers to particular columns of the buffer + setStatePointers(); + + // perform a multichannel convolution + for(int i = 0; i < out_size; ++i) + { + // copy selected columns to a helper variable + const auto ii = ((i / channels_per_group) * filters_per_group); + for(int k = 0; k < kernel_length; ++k) + state_cols.col(k) = state.col(state_ptrs(k))(Eigen::seqN(ii, filters_per_group)); + + outs(i) = state_cols.cwiseProduct(weights[i]).sum() + bias(i); + } + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[out_size][in_size][kernel_size * dilation] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& weights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const std::vector& biasVals); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size; } + + /** Returns the convolution dilation rate. */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate; } + + /** Returns the number of "groups" in the convolution. */ + int getGroups() const noexcept { return groups; } + + Eigen::Map outs; + +private: + void resize_state() + { + state.resize(in_sizet, state_size); + } + + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + state_type state; + weights_type state_cols; + + int state_ptr = 0; + state_ptrs_type state_ptrs; + + weights_type weights[out_size]; + vec_type bias; + + /** Sets pointers to state array columns. */ + inline void setStatePointers() + { + for(int k = 0; k < kernel_size; ++k) + state_ptrs[k] = (state_ptr + state_size - k * dilation_rate) % state_size; + } +}; + +} // RTNEURAL_NAMESPACE + +#endif // CONV1DEIGEN_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_eigen.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_eigen.tpp new file mode 100644 index 0000000..fc9073a --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_eigen.tpp @@ -0,0 +1,111 @@ +#include "conv1d_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ + +template +Conv1D::Conv1D(int in_size, int out_size, int kernel_size, int dilation, int num_groups) + : Layer(in_size, out_size) + , dilation_rate(dilation) + , kernel_size(kernel_size) + , state_size((kernel_size - 1) * dilation + 1) + , groups(num_groups) + , filters_per_group(in_size / groups) + , channels_per_group(out_size / groups) +{ + kernelWeights.resize(out_size); + for(int i = 0; i < out_size; ++i) + kernelWeights[i] = Eigen::Matrix::Zero(filters_per_group, kernel_size); + + bias = Eigen::Vector::Zero(out_size); + state = Eigen::Matrix::Zero(in_size, state_size); + state_cols = Eigen::Matrix::Zero(filters_per_group, kernel_size); + state_ptrs = Eigen::Vector::Zero(kernel_size); +} + +template +Conv1D::Conv1D(std::initializer_list sizes) + : Conv1D(*sizes.begin(), *(sizes.begin() + 1), *(sizes.begin() + 2), *(sizes.begin() + 3)) +{ +} + +template +Conv1D::Conv1D(const Conv1D& other) + : Conv1D(other.in_size, other.out_size, other.kernel_size, other.dilation_rate) +{ +} + +template +Conv1D& Conv1D::operator=(const Conv1D& other) +{ + return *this = Conv1D(other); +} + +template +Conv1D::~Conv1D() = default; + +template +void Conv1D::reset() +{ + state_ptr = 0; + state_ptrs.setZero(); + state_cols.setZero(); + state.setZero(); +} + +template +void Conv1D::setWeights(const std::vector>>& weights) +{ + for(int i = 0; i < Layer::out_size; ++i) + for(int k = 0; k < filters_per_group; ++k) + for(int j = 0; j < kernel_size; ++j) + kernelWeights[i](k, j) = weights[i][k][j]; +} + +template +void Conv1D::setBias(const std::vector& biasVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + bias(i) = biasVals[i]; +} + +//==================================================== +template +Conv1DT::Conv1DT() + : outs(outs_internal) +{ + for(int k = 0; k < out_size; ++k) + weights[k] = weights_type::Zero(); + + bias = vec_type::Zero(); + + resize_state(); + reset(); +} + +template +void Conv1DT::reset() +{ + state.setZero(); + state_cols = weights_type::Zero(); + state_ptrs = state_ptrs_type::Zero(); + state_ptr = 0; +} + +template +void Conv1DT::setWeights(const std::vector>>& ws) +{ + for(int i = 0; i < out_size; ++i) + for(int k = 0; k < filters_per_group; ++k) + for(int j = 0; j < kernel_size; ++j) + weights[i](k, j) = ws[i][k][j]; +} + +template +void Conv1DT::setBias(const std::vector& biasVals) +{ + for(int i = 0; i < out_size; ++i) + bias(i) = biasVals[i]; +} + +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_xsimd.h new file mode 100644 index 0000000..780f666 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_xsimd.h @@ -0,0 +1,402 @@ +#ifndef CONV1DXSIMD_H_INCLUDED +#define CONV1DXSIMD_H_INCLUDED + +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include +#include +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a 1-dimensional convolution layer + * with no activation. + * + * This implementation was designed to be used for "temporal + * convolution", so the layer has a "state" made up of past inputs + * to the layer. To ensure that the state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + */ +template +class Conv1D : public Layer +{ +public: + /** + * Constructs a convolution layer for the given dimensions. + * + * @param in_size: the input size for the layer + * @param out_size: the output size for the layer + * @param kernel_size: the size of the convolution kernel + * @param dilation: the dilation rate to use for dilated convolution + */ + Conv1D(int in_size, int out_size, int kernel_size, int dilation, int groups = 1); + Conv1D(std::initializer_list sizes); + Conv1D(const Conv1D& other); + Conv1D& operator=(const Conv1D& other); + virtual ~Conv1D(); + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() override; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "conv1d"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* h) noexcept override + { + // insert input into a circular buffer + vCopy(input, state[state_ptr].data(), Layer::in_size); + + // set state pointers to particular columns of the buffer + setStatePointers(); + + if(groups == 1) + { + // copy selected columns to a helper variable + for(int k = 0; k < kernel_size; ++k) + { + const auto& col = state[state_ptrs[k]]; + vCopy(col.data(), state_cols[k].data(), Layer::in_size); + } + + // perform multi-channel convolution + vCopy(bias.data(), h, Layer::out_size); + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < kernel_size; ++k) + h[i] += vMult(weights[i][k].data(), state_cols[k].data(), prod_state.data(), Layer::in_size); + } + } + else + { + // perform multi-channel convolution + vCopy(bias.data(), h, Layer::out_size); + for(int i = 0; i < Layer::out_size; ++i) + { + const auto ii = ((i / channels_per_group) * filters_per_group); + for(int k = 0; k < kernel_size; ++k) + { + // copy selected columns to a helper variable + const auto& column = state[state_ptrs[k]]; + const auto column_begin = column.begin() + ii; + const auto column_end = column_begin + filters_per_group; + std::copy(column_begin, column_end, state_cols[k].begin()); + + h[i] += vMult(weights[i][k].data(), state_cols[k].data(), prod_state.data(), filters_per_group); + } + } + } + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[out_size][in_size][kernel_size * dilation] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& weights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const std::vector& biasVals); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size; } + + /** Returns the convolution dilation rate. */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate; } + + /** Returns the number of "groups" in the convolution. */ + int getGroups() const noexcept { return groups; } + +private: + using vec_type = std::vector>; + using vec2_type = std::vector; + using vec3_type = std::vector; + + const int dilation_rate; + const int kernel_size; + const int state_size; + const int groups; + const int filters_per_group; + const int channels_per_group; + + vec3_type weights; + vec_type bias; + + vec2_type state; + vec2_type state_cols; + + int state_ptr = 0; + std::vector state_ptrs; + + vec_type prod_state; + + /** Sets pointers to state array columns. */ + inline void setStatePointers() + { + for(int k = 0; k < kernel_size; ++k) + state_ptrs[k] = (state_ptr + state_size - k * dilation_rate) % state_size; + } +}; + +//==================================================== +/** + * Static implementation of a 1-dimensional convolution layer + * with no activation. + * + * This implementation was designed to be used for "temporal + * convolution", so the layer has a "state" made up of past inputs + * to the layer. To ensure that the state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * @param in_sizet: the input size for the layer + * @param out_sizet: the output size for the layer + * @param kernel_size: the size of the convolution kernel + * @param dilation_rate: the dilation rate to use for dilated convolution + * @param dynamic_state: use dynamically allocated layer state + */ +template +class Conv1DT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto state_size = (kernel_size - 1) * dilation_rate + 1; + static constexpr auto v_in_size = ceil_div(in_sizet, v_size); + static constexpr auto v_out_size = ceil_div(out_sizet, v_size); + + static_assert((in_sizet % groups == 0) && (out_sizet % groups == 0), "in_size and out_size must be divisible by groups!"); + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + static constexpr auto filters_per_group = in_size / groups; + static constexpr auto channels_per_group = out_size / groups; + static constexpr auto v_filters_per_group = ceil_div(filters_per_group, v_size); + + Conv1DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "conv1d"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset(); + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if<(G > 1), void>::type + forward(const v_type (&ins)[v_in_size]) noexcept + { + // insert input into a circular buffer + std::copy(std::begin(ins), std::end(ins), state[state_ptr].begin()); + + // set state pointers to particular columns of the buffer + setStatePointers(); + + // perform multi-channel convolution + for(int i = 0; i < v_out_size; ++i) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T out_sum[v_size] {}; + for(int k = 0; k < v_size && (i * v_size + k) < out_size; ++k) + { + assert(i * v_size + k < out_size); + const auto& subWeights = weights[i * v_size + k]; + v_type accum {}; + + const auto ii = (((i * v_size + k) / channels_per_group) * filters_per_group); + for(int j = 0; j < kernel_size; ++j) + { + // copy selected columns to a helper variable + // @TODO: I'm not sure the reinterpret_casts are 100% safe here, but they seem to work in testing! + const auto& column = reinterpret_cast&>(state[state_ptrs[j]]); + const auto column_begin = column.begin() + ii; + const auto column_end = column_begin + filters_per_group; + std::copy(column_begin, column_end, reinterpret_cast&>(state_cols[j]).begin()); + + accum += std::inner_product( + subWeights[j].begin(), + subWeights[j].end(), + state_cols[j].begin(), + v_type {}); + } + out_sum[k] = xsimd::reduce_add(accum); + } + + outs[i] = xsimd::load_aligned(out_sum) + bias[i]; + } + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if<(DR > 1 && G == 1), void>::type + forward(const v_type (&ins)[v_in_size]) noexcept + { + // insert input into a circular buffer + std::copy(std::begin(ins), std::end(ins), state[state_ptr].begin()); + + // set state pointers to particular columns of the buffer + setStatePointers(); + + // copy selected columns to a helper variable + for(int k = 0; k < kernel_size; ++k) + { + const auto& col = state[state_ptrs[k]]; + std::copy(col.begin(), col.end(), state_cols[k].begin()); + } + + // perform multi-channel convolution + for(int i = 0; i < v_out_size; ++i) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T out_sum[v_size] {}; + for(int k = 0; k < v_size && (i * v_size + k) < out_size; ++k) + { + assert(i * v_size + k < out_size); + const auto& subWeights = weights[i * v_size + k]; + v_type accum {}; + for(int j = 0; j < kernel_size; ++j) + { + accum += std::inner_product( + subWeights[j].begin(), + subWeights[j].end(), + state_cols[j].begin(), + v_type {}); + } + out_sum[k] = xsimd::reduce_add(accum); + } + + outs[i] = xsimd::load_aligned(out_sum) + bias[i]; + } + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if<(DR == 1 && KS > 1 && G == 1), void>::type + forward(const v_type (&ins)[v_in_size]) noexcept + { + // insert input into a circular buffer + std::copy(std::begin(ins), std::end(ins), state[state_ptr].begin()); + + // set state pointers to particular columns of the buffer + setStatePointers(); + + // perform multi-channel convolution + for(int i = 0; i < v_out_size; ++i) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T out_sum[v_size] {}; + for(int k = 0; k < v_size && (i * v_size + k) < out_size; ++k) + { + const auto& subWeights = weights[i * v_size + k]; + v_type accum {}; + for(int j = 0; j < kernel_size; ++j) + { + accum += std::inner_product( + subWeights[j].begin(), + subWeights[j].end(), + state[(state_ptr + state_size - j) % state_size].begin(), + v_type {}); + } + out_sum[k] = xsimd::reduce_add(accum); + } + + outs[i] = xsimd::load_aligned(out_sum) + bias[i]; + } + + state_ptr = (state_ptr == state_size - 1 ? 0 : state_ptr + 1); // iterate state pointer forwards + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&ins)[v_in_size]) noexcept + { + for(int i = 0; i < v_out_size; ++i) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T out_sum[v_size] {}; + for(int k = 0; k < v_size && (i * v_size + k) < out_size; ++k) + { + const auto& subWeights = weights[i * v_size + k][0]; + + v_type accum {}; + for(int j = 0; j < v_in_size; ++j) + accum += subWeights[j] * ins[j]; + out_sum[k] = xsimd::reduce_add(accum); + } + + outs[i] = xsimd::load_aligned(out_sum) + bias[i]; + } + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[out_size][in_size][kernel_size * dilation] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& weights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const std::vector& biasVals); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size; } + + /** Returns the convolution dilation rate. */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate; } + + /** Returns the number of "groups" in the convolution. */ + int getGroups() const noexcept { return groups; } + + v_type outs[v_out_size]; + +private: + template + typename std::enable_if::type resize_state() + { + state.resize(state_size, {}); + } + + template + typename std::enable_if::type resize_state() { } + + using state_col_type = std::array; + using state_type = typename std::conditional>, std::array>::type; + using weights_type = std::array, kernel_size>; + + state_type state {}; + weights_type state_cols {}; + + int state_ptr = 0; + std::array state_ptrs {}; + + weights_type weights[out_size] {}; + v_type bias[v_out_size] {}; + + /** Sets pointers to state array columns. */ + inline void setStatePointers() + { + for(int k = 0; k < kernel_size; ++k) + state_ptrs[k] = (state_ptr + state_size - k * dilation_rate) % state_size; + } +}; +} // namespace RTNEURAL_NAMESPACE + +#endif // CONV1DXSIMD_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_xsimd.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_xsimd.tpp new file mode 100644 index 0000000..4ec335e --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d/conv1d_xsimd.tpp @@ -0,0 +1,132 @@ +#include "conv1d_xsimd.h" + +namespace RTNEURAL_NAMESPACE +{ + +template +Conv1D::Conv1D(int in_size, int out_size, int kernel_size, int dilation, int num_groups) + : Layer(in_size, out_size) + , dilation_rate(dilation) + , kernel_size(kernel_size) + , state_size((kernel_size - 1) * dilation + 1) + , groups(num_groups) + , filters_per_group(in_size / groups) + , channels_per_group(out_size / groups) +{ + weights = vec3_type(out_size, vec2_type(kernel_size, vec_type(filters_per_group, (T)0))); + bias.resize(out_size, (T)0); + state = vec2_type(state_size, vec_type(in_size, (T)0)); + state_cols = vec2_type(kernel_size, vec_type(filters_per_group, (T)0)); + state_ptrs.resize(kernel_size); + prod_state.resize(filters_per_group); +} + +template +Conv1D::Conv1D(std::initializer_list sizes) + : Conv1D(*sizes.begin(), *(sizes.begin() + 1), *(sizes.begin() + 2), *(sizes.begin() + 3)) +{ +} + +template +Conv1D::Conv1D(const Conv1D& other) + : Conv1D(other.in_size, other.out_size, other.kernel_size, other.dilation_rate) +{ +} + +template +Conv1D& Conv1D::operator=(const Conv1D& other) +{ + return *this = Conv1D(other); +} + +template +Conv1D::~Conv1D() = default; + +template +void Conv1D::reset() +{ + for(int k = 0; k < state_size; ++k) + std::fill(state[k].begin(), state[k].end(), (T)0); + + for(int k = 0; k < kernel_size; ++k) + std::fill(state_cols[k].begin(), state_cols[k].end(), (T)0); + + std::fill(state_ptrs.begin(), state_ptrs.end(), 0); + state_ptr = 0; +} + +template +void Conv1D::setWeights(const std::vector>>& ws) +{ + for(int i = 0; i < Layer::out_size; ++i) + for(int k = 0; k < filters_per_group; ++k) + for(int j = 0; j < kernel_size; ++j) + weights[i][j][k] = ws[i][k][j]; +} + +template +void Conv1D::setBias(const std::vector& biasVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + bias[i] = biasVals[i]; +} + +//==================================================== +template +Conv1DT::Conv1DT() +{ + for(int i = 0; i < out_size; ++i) + for(int j = 0; j < kernel_size; ++j) + for(int k = 0; k < v_filters_per_group; ++k) + weights[i][j][k] = v_type((T)0.0); + + for(int i = 0; i < v_out_size; ++i) + bias[i] = v_type((T)0.0); + + for(int i = 0; i < v_out_size; ++i) + outs[i] = v_type((T)0.0); + + resize_state(); + reset(); +} + +template +void Conv1DT::reset() +{ + for(int i = 0; i < state_size; ++i) + for(int k = 0; k < v_in_size; ++k) + state[i][k] = v_type((T)0.0); + + for(int i = 0; i < kernel_size; ++i) + for(int k = 0; k < v_filters_per_group; ++k) + state_cols[i][k] = v_type((T)0.0); + + state_ptr = 0; + for(int i = 0; i < kernel_size; ++i) + state_ptrs[i] = 0; +} + +template +void Conv1DT::setWeights(const std::vector>>& ws) +{ + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < filters_per_group; ++k) + { + for(int j = 0; j < kernel_size; ++j) + { + auto& w = weights[i][j][k / v_size]; + w = set_value(w, k % v_size, ws[i][k][j]); + } + } + } +} + +template +void Conv1DT::setBias(const std::vector& biasVals) +{ + for(int i = 0; i < out_size; ++i) + bias[i / v_size] = set_value(bias[i / v_size], i % v_size, biasVals[i]); +} + +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless.h new file mode 100644 index 0000000..9252852 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless.h @@ -0,0 +1,310 @@ +#ifndef CONV1D_STATELESS_H_INCLUDED +#define CONV1D_STATELESS_H_INCLUDED + +#if RTNEURAL_USE_EIGEN +#include "conv1d_stateless_eigen.h" +#include "conv1d_stateless_eigen.tpp" +#elif RTNEURAL_USE_XSIMD +#include "conv1d_stateless_xsimd.h" +#include "conv1d_stateless_xsimd.tpp" +#else +#include "../Layer.h" +#include "../config.h" + +namespace RTNEURAL_NAMESPACE +{ +/** + * Dynamic implementation of a 1-dimensional stateless convolution layer with no activation. + * This implementation was designed to be used for a single frame of features, fully available at each forward call. + * So the layer has a NO internal "state" + * + * @tparam T Type of the layer (float, double, int ...) + */ +template +class Conv1DStateless : public Layer +{ +public: + Conv1DStateless(int in_num_filters_in, int in_num_features_in, int in_num_filters_out, int in_kernel_size, int in_stride, bool in_valid_pad); + Conv1DStateless(std::initializer_list sizes); + Conv1DStateless(const Conv1DStateless& other); + Conv1DStateless& operator=(const Conv1DStateless& other); + virtual ~Conv1DStateless() = default; + + static constexpr int computeNumFeaturesOut(int num_features_in, int kernel_size, int stride, int valid_pad) + { + // Based on tensorflow docs: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2 + // Custom implementation of ceil since std::ceil is not constexpr. + + if(valid_pad) + { + float f = static_cast(num_features_in - kernel_size + 1) / static_cast(stride); + int i = static_cast(f); + return f > static_cast(i) ? i + 1 : i; + } + + float f = static_cast(num_features_in) / static_cast(stride); + int i = static_cast(f); + return f > static_cast(i) ? i + 1 : i; + } + + static constexpr int computePadLeft(int num_features_in, int kernel_size, int stride, bool valid_pad) + { + // Based on tensorflow: Based on tensorflow: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2ow: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2 + return valid_pad ? 0 : std::max(num_features_in % stride == 0 ? kernel_size - stride : kernel_size - num_features_in % stride, 0) / 2; + } + + static constexpr int computePadRight(int num_features_in, int kernel_size, int stride, bool valid_pad) + { + // Based on tensorflow: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2 + if(!valid_pad) + { + int total_pad = std::max(num_features_in % stride == 0 ? kernel_size - stride : kernel_size - num_features_in % stride, 0); + return total_pad - total_pad / 2; + } + + return 0; + } + + /** Resets the layer state. */ + void reset() override {}; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "conv1d_stateless"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* output) noexcept override + { + if(valid_pad) + { + for(int out_row_idx = 0; out_row_idx < num_filters_out; ++out_row_idx) + { + for(int out_col_idx = 0; out_col_idx < num_features_out; ++out_col_idx) + { + T sum {}; + for(int in_col_idx = out_col_idx * stride; in_col_idx < out_col_idx * stride + kernel_size; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - out_col_idx * stride; + for(int in_row_idx = 0; in_row_idx < num_filters_in; ++in_row_idx) + sum += kernelWeights[out_row_idx][in_row_idx][kernel_col_idx] * (input[in_col_idx * num_filters_in + in_row_idx]); + } + output[out_col_idx * num_filters_out + out_row_idx] += sum; + } + } + } + else + { + for(int out_row_idx = 0; out_row_idx < num_filters_out; ++out_row_idx) + { + int out_col_idx = 0; + + for(; out_col_idx * stride < pad_left; ++out_col_idx) + { + T sum {}; + const int eff_kernel_size = kernel_size - pad_left + out_col_idx * stride; + for(int in_col_idx = 0; in_col_idx < eff_kernel_size; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx + (kernel_size - eff_kernel_size); + for(int in_row_idx = 0; in_row_idx < num_filters_in; ++in_row_idx) + sum += kernelWeights[out_row_idx][in_row_idx][kernel_col_idx] * (input[in_col_idx * num_filters_in + in_row_idx]); + } + output[out_col_idx * num_filters_out + out_row_idx] += sum; + } + + for(; out_col_idx * stride - pad_left + kernel_size < num_features_in; ++out_col_idx) + { + T sum {}; + for(int in_col_idx = out_col_idx * stride - pad_left; in_col_idx < out_col_idx * stride - pad_left + kernel_size; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - (out_col_idx * stride - pad_left); + for(int in_row_idx = 0; in_row_idx < num_filters_in; ++in_row_idx) + sum += kernelWeights[out_row_idx][in_row_idx][kernel_col_idx] * (input[in_col_idx * num_filters_in + in_row_idx]); + } + output[out_col_idx * num_filters_out + out_row_idx] += sum; + } + + for(; out_col_idx * stride - pad_left + kernel_size <= num_features_in + pad_right; ++out_col_idx) + { + T sum {}; + const int eff_kernel_size = num_features_in - (out_col_idx * stride - pad_left); + for(int in_col_idx = (num_features_in - eff_kernel_size); in_col_idx < num_features_in; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - (num_features_in - eff_kernel_size); + for(int in_row_idx = 0; in_row_idx < num_filters_in; ++in_row_idx) + sum += kernelWeights[out_row_idx][in_row_idx][kernel_col_idx] * (input[in_col_idx * num_filters_in + in_row_idx]); + } + output[out_col_idx * num_filters_out + out_row_idx] += sum; + } + } + } + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[num_filters_out][num_filters_in][kernel_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& inWeights); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size; } + + /** Returns the stride. */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride; } + +private: + const int num_filters_in; + const int num_features_in; + const int num_filters_out; + const int kernel_size; + const int stride; + const int num_features_out; + const bool valid_pad; + const int pad_left; + const int pad_right; + + using Matrix = std::vector>; + std::vector kernelWeights; +}; + +//==================================================== + +/** + * Static implementation of a 1-dimensional stateless convolution layer with no activation. + * This implementation was designed to be used for a single frame of features, fully available at each forward call. + * So the layer has a NO internal "state" + * + * @tparam T Type of the layer (float, double, int ...) + * @tparam num_filters_in_t number of input filters + * @tparam num_features_in_t number of input features + * @tparam num_filters_out_t number of output filters + * @tparam kernel_size_t size of the convolution kernel + * @tparam stride_t convolution stride + * @tparam valid_pad_t if true: pad is "valid", if false: pad is "same" + */ +template +class Conv1DStatelessT +{ + static constexpr int num_features_out = Conv1DStateless::computeNumFeaturesOut(num_features_in_t, kernel_size_t, stride_t, valid_pad_t); + static constexpr int pad_left = Conv1DStateless::computePadLeft(num_features_in_t, kernel_size_t, stride_t, valid_pad_t); + static constexpr int pad_right = Conv1DStateless::computePadRight(num_features_in_t, kernel_size_t, stride_t, valid_pad_t); + + using weights_type = std::array, num_filters_in_t>; + +public: + Conv1DStatelessT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "conv1d_stateless"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Empty function, this layer has no state */ + RTNEURAL_REALTIME void reset() {}; + + /** Performs forward propagation for this layer if pad is "valid". */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&inMatrix)[num_features_in_t * num_filters_in_t]) noexcept + { + for(int out_row_idx = 0; out_row_idx < num_filters_out_t; ++out_row_idx) + { + for(int out_col_idx = 0; out_col_idx < num_features_out; ++out_col_idx) + { + T sum {}; + for(int in_col_idx = out_col_idx * stride_t; in_col_idx < out_col_idx * stride_t + kernel_size_t; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - out_col_idx * stride_t; + for(int in_row_idx = 0; in_row_idx < num_filters_in_t; ++in_row_idx) + sum += kernelWeights[out_row_idx][in_row_idx][kernel_col_idx] * (inMatrix[in_col_idx * num_filters_in_t + in_row_idx]); + } + outs[out_col_idx * num_filters_out_t + out_row_idx] += sum; + } + } + } + + /** Performs forward propagation for this layer if pad is "same" */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&inMatrix)[num_features_in_t * num_filters_in_t]) noexcept + { + for(int out_row_idx = 0; out_row_idx < num_filters_out_t; ++out_row_idx) + { + int out_col_idx = 0; + + for(; out_col_idx * stride_t < pad_left; ++out_col_idx) + { + T sum {}; + const int eff_kernel_size = kernel_size_t - pad_left + out_col_idx * stride_t; + for(int in_col_idx = 0; in_col_idx < eff_kernel_size; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx + (kernel_size_t - eff_kernel_size); + for(int in_row_idx = 0; in_row_idx < num_filters_in_t; ++in_row_idx) + sum += kernelWeights[out_row_idx][in_row_idx][kernel_col_idx] * (inMatrix[in_col_idx * num_filters_in_t + in_row_idx]); + } + outs[out_col_idx * num_filters_out_t + out_row_idx] = sum; + } + + for(; out_col_idx * stride_t - pad_left + kernel_size_t < num_features_in_t; ++out_col_idx) + { + T sum {}; + for(int in_col_idx = out_col_idx * stride_t - pad_left; in_col_idx < out_col_idx * stride_t - pad_left + kernel_size_t; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - (out_col_idx * stride_t - pad_left); + for(int in_row_idx = 0; in_row_idx < num_filters_in_t; ++in_row_idx) + sum += kernelWeights[out_row_idx][in_row_idx][kernel_col_idx] * (inMatrix[in_col_idx * num_filters_in_t + in_row_idx]); + } + outs[out_col_idx * num_filters_out_t + out_row_idx] = sum; + } + + for(; out_col_idx * stride_t - pad_left + kernel_size_t <= num_features_in_t + pad_right; ++out_col_idx) + { + T sum {}; + const int eff_kernel_size = num_features_in_t - (out_col_idx * stride_t - pad_left); + for(int in_col_idx = (num_features_in_t - eff_kernel_size); in_col_idx < num_features_in_t; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - (num_features_in_t - eff_kernel_size); + for(int in_row_idx = 0; in_row_idx < num_filters_in_t; ++in_row_idx) + sum += kernelWeights[out_row_idx][in_row_idx][kernel_col_idx] * (inMatrix[in_col_idx * num_filters_in_t + in_row_idx]); + } + outs[out_col_idx * num_filters_out_t + out_row_idx] = sum; + } + } + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[num_filters_out][num_filters_in][kernel_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& inWeights); + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[kernel_size][num_filters_in][num_filters_out] + */ + RTNEURAL_REALTIME void setWeightsTransposed(const std::vector>>& inWeights); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size_t; } + + /** Returns the convolution dilation rate. */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride_t; } + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[num_filters_out_t * num_features_out] {}; + +private: + weights_type kernelWeights[num_filters_out_t]; +}; + +} // RTNEURAL + +#include "conv1d_stateless.tpp" + +#endif // RTNEURAL_USE_STL +#endif // CONV1D_STATELESS_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless.tpp new file mode 100644 index 0000000..2431143 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless.tpp @@ -0,0 +1,81 @@ +#include "conv1d_stateless.h" + +namespace RTNEURAL_NAMESPACE +{ +template +Conv1DStateless::Conv1DStateless(int in_num_filters_in, int in_num_features_in, int in_num_filters_out, int in_kernel_size, int in_stride, bool in_valid_pad) + : num_filters_in(in_num_filters_in) + , num_features_in(in_num_features_in) + , num_filters_out(in_num_filters_out) + , kernel_size(in_kernel_size) + , stride(in_stride) + , valid_pad(in_valid_pad) + , num_features_out(computeNumFeaturesOut(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) + , pad_left(computePadLeft(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) + , pad_right(computePadRight(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) + , Layer(in_num_filters_in * in_num_features_in, in_num_filters_out * computeNumFeaturesOut(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) +{ + kernelWeights.resize(num_filters_out); + for(auto& kw : kernelWeights) + { + kw.resize(num_filters_in); + for(auto& col : kw) + col.resize(kernel_size, (T)0); + } +} + +template +Conv1DStateless::Conv1DStateless(std::initializer_list sizes) + : Conv1DStateless(*sizes.begin(), *(sizes.begin() + 1), *(sizes.begin() + 2), *(sizes.begin() + 3), *(sizes.begin() + 4), *(sizes.begin() + 5)) +{ +} + +template +Conv1DStateless::Conv1DStateless(const Conv1DStateless& other) + : Conv1DStateless(other.num_filters_in, other.num_features_in, other.num_filters_out, other.kernel_size, other.stride, other.valid_pad) +{ +} + +template +Conv1DStateless& Conv1DStateless::operator=(const Conv1DStateless& other) +{ + return *this = Conv1DStateless(other); +} + +template +void Conv1DStateless::setWeights(const std::vector>>& inWeights) +{ + for(int i = 0; i < num_filters_out; ++i) + for(int k = 0; k < num_filters_in; ++k) + for(int j = 0; j < kernel_size; ++j) + kernelWeights[i][k][j] = inWeights.at(i).at(k).at(j); +} + +//==================================================== + +template +Conv1DStatelessT::Conv1DStatelessT() +{ + for(int i = 0; i < num_filters_out_t; ++i) + for(int k = 0; k < num_filters_in_t; ++k) + std::fill(std::begin(kernelWeights[i][k]), std::end(kernelWeights[i][k]), (T)0); +} + +template +void Conv1DStatelessT::setWeights(const std::vector>>& inWeights) +{ + for(int i = 0; i < num_filters_out_t; ++i) + for(int k = 0; k < num_filters_in_t; ++k) + for(int j = 0; j < kernel_size_t; ++j) + kernelWeights[i][k][j] = inWeights.at(i).at(k).at(j); +} + +template +void Conv1DStatelessT::setWeightsTransposed(const std::vector>>& inWeights) +{ + for(int i = 0; i < num_filters_out_t; ++i) + for(int k = 0; k < num_filters_in_t; ++k) + for(int j = 0; j < kernel_size_t; ++j) + kernelWeights[i][k][j] = inWeights.at(j).at(k).at(i); +} +} // RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_eigen.h new file mode 100644 index 0000000..db2929f --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_eigen.h @@ -0,0 +1,251 @@ +#ifndef CONV1D_STATELESS_EIGEN_H_INCLUDED +#define CONV1D_STATELESS_EIGEN_H_INCLUDED + +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ +/** + * Dynamic implementation of a 1-dimensional stateless convolution layer with no activation. + * This implementation was designed to be used for a single frame of features, fully available at each forward call. + * So the layer has a NO internal "state" + * + * @tparam T Type of the layer (float, double, int ...) + */ +template +class Conv1DStateless : public Layer +{ +public: + Conv1DStateless(int in_num_filters_in, int in_num_features_in, int in_num_filters_out, int in_kernel_size, int in_stride, bool in_valid_pad); + Conv1DStateless(std::initializer_list sizes); + Conv1DStateless(const Conv1DStateless& other); + Conv1DStateless& operator=(const Conv1DStateless& other); + virtual ~Conv1DStateless() = default; + + static constexpr int computeNumFeaturesOut(int num_features_in, int kernel_size, int stride, int valid_pad) + { + // Based on tensorflow docs: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2 + // Custom implementation of ceil since std::ceil is not constexpr. + + if(valid_pad) + { + float f = static_cast(num_features_in - kernel_size + 1) / static_cast(stride); + int i = static_cast(f); + return f > static_cast(i) ? i + 1 : i; + } + + float f = static_cast(num_features_in) / static_cast(stride); + int i = static_cast(f); + return f > static_cast(i) ? i + 1 : i; + } + + static constexpr int computePadLeft(int num_features_in, int kernel_size, int stride, bool valid_pad) + { + // Based on tensorflow: Based on tensorflow: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2ow: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2 + return valid_pad ? 0 : std::max(num_features_in % stride == 0 ? kernel_size - stride : kernel_size - num_features_in % stride, 0) / 2; + } + + static constexpr int computePadRight(int num_features_in, int kernel_size, int stride, bool valid_pad) + { + // Based on tensorflow: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2 + if(!valid_pad) + { + int total_pad = std::max(num_features_in % stride == 0 ? kernel_size - stride : kernel_size - num_features_in % stride, 0); + return total_pad - total_pad / 2; + } + + return 0; + } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() override {}; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "conv1d_stateless"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* output) noexcept override + { + auto inMatrix = Eigen::Map, + RTNeuralEigenAlignment>(input, num_filters_in, num_features_in); + + auto outMatrix = Eigen::Map, + RTNeuralEigenAlignment>(output, num_filters_out, num_features_out); + + if(valid_pad) + { + for(int i = 0; i < num_filters_out; i++) + for(int j = 0; j < num_features_out; j++) + outMatrix(i, j) += kernelWeights[i].cwiseProduct(inMatrix.middleCols(j * stride, kernel_size)).sum(); + } + else + { + for(int i = 0; i < num_filters_out; i++) + { + int j = 0; + + for(; j * stride < pad_left; j++) + { + const int eff_kernel_size = kernel_size - pad_left + j * stride; + outMatrix(i, j) += kernelWeights[i].rightCols(eff_kernel_size).cwiseProduct(inMatrix.leftCols(eff_kernel_size)).sum(); + } + + for(; j * stride - pad_left + kernel_size < num_features_in; j++) + outMatrix(i, j) += kernelWeights[i].cwiseProduct(inMatrix.middleCols(j * stride - pad_left, kernel_size)).sum(); + + for(; j * stride - pad_left + kernel_size <= num_features_in + pad_right; j++) + { + const int eff_kernel_size = num_features_in - (j * stride - pad_left); + outMatrix(i, j) += kernelWeights[i].leftCols(eff_kernel_size).cwiseProduct(inMatrix.rightCols(eff_kernel_size)).sum(); + } + } + } + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[num_filters_out][num_filters_in][kernel_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& inWeights); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size; } + + /** Returns the stride. */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride; } + +private: + const int num_filters_in; + const int num_features_in; + const int num_filters_out; + const int kernel_size; + const int stride; + const int num_features_out; + const bool valid_pad; + const int pad_left; + const int pad_right; + + std::vector> kernelWeights; +}; + +//==================================================== + +/** + * Static implementation of a 1-dimensional stateless convolution layer with no activation. + * This implementation was designed to be used for a single frame of features, fully available at each forward call. + * So the layer has a NO internal "state" + * + * @tparam T Type of the layer (float, double, int ...) + * @tparam num_filters_in_t number of input filters + * @tparam num_features_in_t number of input features + * @tparam num_filters_out_t number of output filters + * @tparam kernel_size_t size of the convolution kernel + * @tparam stride_t convolution stride + * @tparam valid_pad_t if true: pad is "valid", if false: pad is "same" + */ +template +class Conv1DStatelessT +{ + static constexpr int num_features_out = Conv1DStateless::computeNumFeaturesOut(num_features_in_t, kernel_size_t, stride_t, valid_pad_t); + static constexpr int pad_left = Conv1DStateless::computePadLeft(num_features_in_t, kernel_size_t, stride_t, valid_pad_t); + static constexpr int pad_right = Conv1DStateless::computePadRight(num_features_in_t, kernel_size_t, stride_t, valid_pad_t); + + using weights_type = Eigen::Matrix; + using input_type = Eigen::Matrix; + using output_type = Eigen::Matrix; + +public: + Conv1DStatelessT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "conv1d_stateless"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Empty function, this layer has no state */ + RTNEURAL_REALTIME void reset() {}; + + /** Performs forward propagation for this layer if pad is "valid". */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const input_type& inMatrix) noexcept + { + // perform a multichannel convolution + for(int i = 0; i < num_filters_out_t; i++) + { + for(int j = 0; j < num_features_out; j++) + { + // TODO: manage to use middleCols(j*stride) + outs(i, j) = kernelWeights[i].cwiseProduct(inMatrix.middleCols(j * stride_t, kernel_size_t)).sum(); + } + } + } + + /** Performs forward propagation for this layer if pad is "same" */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const input_type& inMatrix) noexcept + { + // perform a multichannel convolution + for(int i = 0; i < num_filters_out_t; i++) + { + int j = 0; + + for(; j * stride_t < pad_left; j++) + { + const int eff_kernel_size = kernel_size_t - pad_left + j * stride_t; + outs(i, j) = kernelWeights[i].rightCols(eff_kernel_size).cwiseProduct(inMatrix.leftCols(eff_kernel_size)).sum(); + } + + for(; j * stride_t - pad_left + kernel_size_t < num_features_in_t; j++) + // TODO: manage to use middleCols(j*stride) + outs(i, j) = kernelWeights[i].cwiseProduct(inMatrix.middleCols(j * stride_t - pad_left, kernel_size_t)).sum(); + + for(; j * stride_t - pad_left + kernel_size_t <= num_features_in_t + pad_right; j++) + { + const int eff_kernel_size = num_features_in_t - (j * stride_t - pad_left); + outs(i, j) = kernelWeights[i].leftCols(eff_kernel_size).cwiseProduct(inMatrix.rightCols(eff_kernel_size)).sum(); + } + } + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[num_filters_out][num_filters_in][kernel_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& inWeights); + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[kernel_size][num_filters_in][num_filters_out] + */ + RTNEURAL_REALTIME void setWeightsTransposed(const std::vector>>& inWeights); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size_t; } + + /** Returns the convolution dilation rate. */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride_t; } + + Eigen::Map outs; + +private: + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[num_filters_out_t * num_features_out]; + + weights_type kernelWeights[num_filters_out_t]; +}; + +} // RTNEURAL + +#endif // CONV1D_STATELESS_EIGEN_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_eigen.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_eigen.tpp new file mode 100644 index 0000000..f86ca00 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_eigen.tpp @@ -0,0 +1,75 @@ +#include "conv1d_stateless_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ +template +Conv1DStateless::Conv1DStateless(int in_num_filters_in, int in_num_features_in, int in_num_filters_out, int in_kernel_size, int in_stride, bool in_valid_pad) + : num_filters_in(in_num_filters_in) + , num_features_in(in_num_features_in) + , num_filters_out(in_num_filters_out) + , kernel_size(in_kernel_size) + , stride(in_stride) + , valid_pad(in_valid_pad) + , num_features_out(computeNumFeaturesOut(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) + , pad_left(computePadLeft(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) + , pad_right(computePadRight(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) + , Layer(in_num_filters_in * in_num_features_in, in_num_filters_out * computeNumFeaturesOut(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) +{ + kernelWeights.resize(num_filters_out, Eigen::Matrix::Zero(num_filters_in, kernel_size)); +} + +template +Conv1DStateless::Conv1DStateless(std::initializer_list sizes) + : Conv1DStateless(*sizes.begin(), *(sizes.begin() + 1), *(sizes.begin() + 2), *(sizes.begin() + 3), *(sizes.begin() + 4), *(sizes.begin() + 5)) +{ +} + +template +Conv1DStateless::Conv1DStateless(const Conv1DStateless& other) + : Conv1DStateless(other.num_filters_in, other.num_features_in, other.num_filters_out, other.kernel_size, other.stride, other.valid_pad) +{ +} + +template +Conv1DStateless& Conv1DStateless::operator=(const Conv1DStateless& other) +{ + return *this = Conv1DStateless(other); +} + +template +void Conv1DStateless::setWeights(const std::vector>>& inWeights) +{ + for(int i = 0; i < num_filters_out; ++i) + for(int k = 0; k < num_filters_in; ++k) + for(int j = 0; j < kernel_size; ++j) + kernelWeights[i](k, j) = inWeights.at(i).at(k).at(j); +} + +//==================================================== + +template +Conv1DStatelessT::Conv1DStatelessT() + : outs(outs_internal) +{ + for(int k = 0; k < num_filters_out_t; ++k) + kernelWeights[k] = weights_type::Zero(); +} + +template +void Conv1DStatelessT::setWeights(const std::vector>>& inWeights) +{ + for(int i = 0; i < num_filters_out_t; ++i) + for(int k = 0; k < num_filters_in_t; ++k) + for(int j = 0; j < kernel_size_t; ++j) + kernelWeights[i](k, j) = inWeights.at(i).at(k).at(j); +} + +template +void Conv1DStatelessT::setWeightsTransposed(const std::vector>>& inWeights) +{ + for(int i = 0; i < num_filters_out_t; ++i) + for(int k = 0; k < num_filters_in_t; ++k) + for(int j = 0; j < kernel_size_t; ++j) + kernelWeights[i](k, j) = inWeights.at(j).at(k).at(i); +} +} // RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_xsimd.h new file mode 100644 index 0000000..d43ab7a --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_xsimd.h @@ -0,0 +1,350 @@ +#ifndef RTNEURAL_CONV1D_STATELESS_XSIMD_H +#define RTNEURAL_CONV1D_STATELESS_XSIMD_H + +#include "../Layer.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ +/** + * Dynamic implementation of a 1-dimensional stateless convolution layer with no activation. + * This implementation was designed to be used for a single frame of features, fully available at each forward call. + * So the layer has a NO internal "state" + * + * @tparam T Type of the layer (float, double, int ...) + */ +template +class Conv1DStateless : public Layer +{ +public: + Conv1DStateless(int in_num_filters_in, int in_num_features_in, int in_num_filters_out, int in_kernel_size, int in_stride, bool in_valid_pad); + Conv1DStateless(std::initializer_list sizes); + Conv1DStateless(const Conv1DStateless& other); + Conv1DStateless& operator=(const Conv1DStateless& other); + virtual ~Conv1DStateless() = default; + + static constexpr int computeNumFeaturesOut(int num_features_in, int kernel_size, int stride, int valid_pad) + { + // Based on tensorflow docs: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2 + // Custom implementation of ceil since std::ceil is not constexpr. + + if(valid_pad) + { + float f = static_cast(num_features_in - kernel_size + 1) / static_cast(stride); + int i = static_cast(f); + return f > static_cast(i) ? i + 1 : i; + } + + float f = static_cast(num_features_in) / static_cast(stride); + int i = static_cast(f); + return f > static_cast(i) ? i + 1 : i; + } + + static constexpr int computePadLeft(int num_features_in, int kernel_size, int stride, bool valid_pad) + { + // Based on tensorflow: Based on tensorflow: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2ow: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2 + return valid_pad ? 0 : std::max(num_features_in % stride == 0 ? kernel_size - stride : kernel_size - num_features_in % stride, 0) / 2; + } + + static constexpr int computePadRight(int num_features_in, int kernel_size, int stride, bool valid_pad) + { + // Based on tensorflow: https://www.tensorflow.org/api_docs/python/tf/nn#notes_on_padding_2 + if(!valid_pad) + { + int total_pad = std::max(num_features_in % stride == 0 ? kernel_size - stride : kernel_size - num_features_in % stride, 0); + return total_pad - total_pad / 2; + } + + return 0; + } + + /** Resets the layer state. */ + RTNEURAL_REALTIME void reset() override { } + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "conv1d_stateless"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* output) noexcept override + { + if(valid_pad) + { + for(int out_row_idx = 0; out_row_idx < num_filters_out; ++out_row_idx) + { + for(int out_col_idx = 0; out_col_idx < num_features_out; ++out_col_idx) + { + T sum {}; + for(int in_col_idx = out_col_idx * stride; in_col_idx < out_col_idx * stride + kernel_size; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - out_col_idx * stride; + xsimd::transform(kernelWeights[out_row_idx][kernel_col_idx].begin(), + kernelWeights[out_row_idx][kernel_col_idx].end(), + input + in_col_idx * num_filters_in, + scratch.begin(), + [](auto a, auto b) + { return a * b; }); + sum += xsimd::reduce(scratch.begin(), scratch.end(), T {}); + } + output[out_col_idx * num_filters_out + out_row_idx] += sum; + } + } + } + else + { + for(int out_row_idx = 0; out_row_idx < num_filters_out; ++out_row_idx) + { + int out_col_idx = 0; + + for(; out_col_idx * stride < pad_left; ++out_col_idx) + { + T sum {}; + const int eff_kernel_size = kernel_size - pad_left + out_col_idx * stride; + for(int in_col_idx = 0; in_col_idx < eff_kernel_size; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx + (kernel_size - eff_kernel_size); + xsimd::transform(kernelWeights[out_row_idx][kernel_col_idx].begin(), + kernelWeights[out_row_idx][kernel_col_idx].end(), + input + in_col_idx * num_filters_in, + scratch.begin(), + [](auto a, auto b) + { return a * b; }); + sum += xsimd::reduce(scratch.begin(), scratch.end(), T {}); + } + output[out_col_idx * num_filters_out + out_row_idx] += sum; + } + + for(; out_col_idx * stride - pad_left + kernel_size < num_features_in; ++out_col_idx) + { + T sum {}; + for(int in_col_idx = out_col_idx * stride - pad_left; in_col_idx < out_col_idx * stride - pad_left + kernel_size; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - (out_col_idx * stride - pad_left); + xsimd::transform(kernelWeights[out_row_idx][kernel_col_idx].begin(), + kernelWeights[out_row_idx][kernel_col_idx].end(), + input + in_col_idx * num_filters_in, + scratch.begin(), + [](auto a, auto b) + { return a * b; }); + sum += xsimd::reduce(scratch.begin(), scratch.end(), T {}); + } + output[out_col_idx * num_filters_out + out_row_idx] += sum; + } + + for(; out_col_idx * stride - pad_left + kernel_size <= num_features_in + pad_right; ++out_col_idx) + { + T sum {}; + const int eff_kernel_size = num_features_in - (out_col_idx * stride - pad_left); + for(int in_col_idx = (num_features_in - eff_kernel_size); in_col_idx < num_features_in; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - (num_features_in - eff_kernel_size); + xsimd::transform(kernelWeights[out_row_idx][kernel_col_idx].begin(), + kernelWeights[out_row_idx][kernel_col_idx].end(), + input + in_col_idx * num_filters_in, + scratch.begin(), + [](auto a, auto b) + { return a * b; }); + sum += xsimd::reduce(scratch.begin(), scratch.end(), T {}); + } + output[out_col_idx * num_filters_out + out_row_idx] += sum; + } + } + } + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[num_filters_out][num_filters_in][kernel_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& inWeights); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size; } + + /** Returns the stride. */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride; } + +private: + const int num_filters_in; + const int num_features_in; + const int num_filters_out; + const int kernel_size; + const int stride; + const int num_features_out; + const bool valid_pad; + const int pad_left; + const int pad_right; + + using Matrix = std::vector>>; + std::vector kernelWeights; + + std::vector> scratch; +}; + +//==================================================== + +/** + * Static implementation of a 1-dimensional stateless convolution layer with no activation. + * This implementation was designed to be used for a single frame of features, fully available at each forward call. + * So the layer has a NO internal "state" + * + * @tparam T Type of the layer (float, double, int ...) + * @tparam num_filters_in_t number of input filters + * @tparam num_features_in_t number of input features + * @tparam num_filters_out_t number of output filters + * @tparam kernel_size_t size of the convolution kernel + * @tparam stride_t convolution stride + * @tparam valid_pad_t if true: pad is "valid", if false: pad is "same" + */ +template +class Conv1DStatelessT +{ + static constexpr int num_features_out = Conv1DStateless::computeNumFeaturesOut(num_features_in_t, kernel_size_t, stride_t, valid_pad_t); + static constexpr int pad_left = Conv1DStateless::computePadLeft(num_features_in_t, kernel_size_t, stride_t, valid_pad_t); + static constexpr int pad_right = Conv1DStateless::computePadRight(num_features_in_t, kernel_size_t, stride_t, valid_pad_t); + + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_num_filters_in = ceil_div(num_filters_in_t, v_size); + static constexpr auto v_num_filters_out = ceil_div(num_filters_out_t, v_size); + static constexpr auto v_in_size = v_num_filters_in * num_features_in_t; + static constexpr auto v_out_size = v_num_filters_out * num_features_out; + + using weights_type = std::array, kernel_size_t>; + +public: + Conv1DStatelessT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "conv1d_stateless"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Empty function, this layer has no state */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer if pad is "valid". */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&inMatrix)[v_in_size]) noexcept + { + // @TODO: can we vectorize in the other direction if num_filters == 1? + for(int out_col_idx = 0; out_col_idx < num_features_out; ++out_col_idx) + { + for(int out_row_idx = 0; out_row_idx < v_num_filters_out; ++out_row_idx) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T out_temp[v_size] {}; + for(int i = 0; i < v_size; ++i) + { + v_type sum {}; + for(int in_col_idx = out_col_idx * stride_t; in_col_idx < out_col_idx * stride_t + kernel_size_t; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - out_col_idx * stride_t; + for(int in_row_idx = 0; in_row_idx < v_num_filters_in; ++in_row_idx) + sum += kernelWeights[out_row_idx * v_size + i][kernel_col_idx][in_row_idx] * (inMatrix[in_col_idx * v_num_filters_in + in_row_idx]); + } + out_temp[i] = xsimd::reduce_add(sum); + } + outs[out_col_idx * v_num_filters_out + out_row_idx] += xsimd::load_aligned(out_temp); + } + } + } + + /** Performs forward propagation for this layer if pad is "same" */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&inMatrix)[v_in_size]) noexcept + { + int out_col_idx = 0; + + for(; out_col_idx * stride_t < pad_left; ++out_col_idx) + { + for(int out_row_idx = 0; out_row_idx < v_num_filters_out; ++out_row_idx) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T out_temp[v_size] {}; + for(int i = 0; i < v_size; ++i) + { + v_type sum {}; + const int eff_kernel_size = kernel_size_t - pad_left + out_col_idx * stride_t; + for(int in_col_idx = 0; in_col_idx < eff_kernel_size; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx + (kernel_size_t - eff_kernel_size); + for(int in_row_idx = 0; in_row_idx < v_num_filters_in; ++in_row_idx) + sum += kernelWeights[out_row_idx * v_size + i][kernel_col_idx][in_row_idx] * (inMatrix[in_col_idx * v_num_filters_in + in_row_idx]); + } + out_temp[i] = xsimd::reduce_add(sum); + } + outs[out_col_idx * v_num_filters_out + out_row_idx] += xsimd::load_aligned(out_temp); + } + } + + for(; out_col_idx * stride_t - pad_left + kernel_size_t < num_features_in_t; ++out_col_idx) + { + for(int out_row_idx = 0; out_row_idx < v_num_filters_out; ++out_row_idx) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T out_temp[v_size] {}; + for(int i = 0; i < v_size; ++i) + { + v_type sum {}; + for(int in_col_idx = out_col_idx * stride_t - pad_left; in_col_idx < out_col_idx * stride_t - pad_left + kernel_size_t; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - (out_col_idx * stride_t - pad_left); + for(int in_row_idx = 0; in_row_idx < v_num_filters_in; ++in_row_idx) + sum += kernelWeights[out_row_idx * v_size + i][kernel_col_idx][in_row_idx] * (inMatrix[in_col_idx * v_num_filters_in + in_row_idx]); + } + out_temp[i] = xsimd::reduce_add(sum); + } + outs[out_col_idx * v_num_filters_out + out_row_idx] += xsimd::load_aligned(out_temp); + } + } + + for(; out_col_idx * stride_t - pad_left + kernel_size_t <= num_features_in_t + pad_right; ++out_col_idx) + { + for(int out_row_idx = 0; out_row_idx < v_num_filters_out; ++out_row_idx) + { + alignas(RTNEURAL_DEFAULT_ALIGNMENT) T out_temp[v_size] {}; + for(int i = 0; i < v_size; ++i) + { + v_type sum {}; + const int eff_kernel_size = num_features_in_t - (out_col_idx * stride_t - pad_left); + for(int in_col_idx = (num_features_in_t - eff_kernel_size); in_col_idx < num_features_in_t; ++in_col_idx) + { + const auto kernel_col_idx = in_col_idx - (num_features_in_t - eff_kernel_size); + for(int in_row_idx = 0; in_row_idx < v_num_filters_in; ++in_row_idx) + sum += kernelWeights[out_row_idx * v_size + i][kernel_col_idx][in_row_idx] * (inMatrix[in_col_idx * v_num_filters_in + in_row_idx]); + } + out_temp[i] = xsimd::reduce_add(sum); + } + outs[out_col_idx * v_num_filters_out + out_row_idx] += xsimd::load_aligned(out_temp); + } + } + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[num_filters_out][num_filters_in][kernel_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>& inWeights); + + /** Returns the size of the convolution kernel. */ + RTNEURAL_REALTIME int getKernelSize() const noexcept { return kernel_size_t; } + + /** Returns the convolution dilation rate. */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride_t; } + + v_type outs[v_out_size]; + +private: + weights_type kernelWeights[num_filters_out_t]; +}; + +} // RTNEURAL + +#endif // RTNEURAL_CONV1D_STATELESS_XSIMD_H diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_xsimd.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_xsimd.tpp new file mode 100644 index 0000000..42cccff --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv1d_stateless/conv1d_stateless_xsimd.tpp @@ -0,0 +1,74 @@ +#include "conv1d_stateless_xsimd.h" + +namespace RTNEURAL_NAMESPACE +{ +template +Conv1DStateless::Conv1DStateless(int in_num_filters_in, int in_num_features_in, int in_num_filters_out, int in_kernel_size, int in_stride, bool in_valid_pad) + : num_filters_in(in_num_filters_in) + , num_features_in(in_num_features_in) + , num_filters_out(in_num_filters_out) + , kernel_size(in_kernel_size) + , stride(in_stride) + , valid_pad(in_valid_pad) + , num_features_out(computeNumFeaturesOut(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) + , pad_left(computePadLeft(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) + , pad_right(computePadRight(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) + , Layer(in_num_filters_in * in_num_features_in, in_num_filters_out * computeNumFeaturesOut(in_num_features_in, in_kernel_size, in_stride, in_valid_pad)) +{ + kernelWeights.resize(num_filters_out); + for(auto& kw : kernelWeights) + { + kw.resize(kernel_size); + for(auto& col : kw) + col.resize(num_filters_in, (T)0); + } + + scratch.resize(num_filters_in, (T)0); +} + +template +Conv1DStateless::Conv1DStateless(std::initializer_list sizes) + : Conv1DStateless(*sizes.begin(), *(sizes.begin() + 1), *(sizes.begin() + 2), *(sizes.begin() + 3), *(sizes.begin() + 4), *(sizes.begin() + 5)) +{ +} + +template +Conv1DStateless::Conv1DStateless(const Conv1DStateless& other) + : Conv1DStateless(other.num_filters_in, other.num_features_in, other.num_filters_out, other.kernel_size, other.stride, other.valid_pad) +{ +} + +template +Conv1DStateless& Conv1DStateless::operator=(const Conv1DStateless& other) +{ + return *this = Conv1DStateless(other); +} + +template +void Conv1DStateless::setWeights(const std::vector>>& inWeights) +{ + for(int i = 0; i < num_filters_out; ++i) + for(int k = 0; k < num_filters_in; ++k) + for(int j = 0; j < kernel_size; ++j) + kernelWeights[i][j][k] = inWeights.at(i).at(k).at(j); +} + +//==================================================== + +template +Conv1DStatelessT::Conv1DStatelessT() +{ + for(int i = 0; i < num_filters_out_t; ++i) + for(int k = 0; k < num_filters_in_t; ++k) + std::fill(std::begin(kernelWeights[i][k]), std::end(kernelWeights[i][k]), (T)0); +} + +template +void Conv1DStatelessT::setWeights(const std::vector>>& inWeights) +{ + for(int i = 0; i < num_filters_out_t; ++i) + for(int k = 0; k < num_filters_in_t; ++k) + for(int j = 0; j < kernel_size_t; ++j) + kernelWeights[i][j][k / v_size] = set_value(kernelWeights[i][j][k / v_size], k % v_size, inWeights.at(i).at(k).at(j)); +} +} // RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d.h new file mode 100644 index 0000000..1752a5e --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d.h @@ -0,0 +1,254 @@ +#ifndef CONV2D_H_INCLUDED +#define CONV2D_H_INCLUDED + +#if RTNEURAL_USE_EIGEN +#include "conv2d_eigen.h" +#include "conv2d_eigen.tpp" +#elif RTNEURAL_USE_XSIMD +#include "conv2d_xsimd.h" +#include "conv2d_xsimd.tpp" +#else +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include "../conv1d_stateless/conv1d_stateless.h" + +namespace RTNEURAL_NAMESPACE +{ +/** + * Dynamic implementation of a 2-dimensional convolution layer with no activation. + * + * @tparam T Type of the layer (float, double, int ...) + */ +template +class Conv2D : public Layer +{ +public: + /** + * @param in_num_filters_in number of input filters (channels) + * @param in_num_filters_out number of output filters (channels) + * @param in_num_features_in number of input features + * @param in_kernel_size_time size of the convolution kernel (time axis) + * @param in_kernel_size_feature size of the convolution kernel (feature axis) + * @param in_dilation_rate dilation_rate (time axis) + * @param in_stride convolution stride (feature axis) + * @param in_valid_pad whether the padding is "valid" or not ("same" otherwise) + */ + Conv2D(int in_num_filters_in, int in_num_filters_out, int in_num_features_in, int in_kernel_size_time, int in_kernel_size_feature, int in_dilation_rate, int in_stride, bool in_valid_pad); + Conv2D(std::initializer_list sizes); + Conv2D(const Conv2D& other); + Conv2D& operator=(const Conv2D& other); + virtual ~Conv2D() = default; + + /** Reset the layer's state */ + RTNEURAL_REALTIME void reset() override + { + state_index = 0; + + for(int i = 0; i < receptive_field; i++) + { + std::fill(state[i].begin(), state[i].end(), (T)0); + } + }; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "conv2d"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* output) noexcept override + { + for(int i = 0; i < kernel_size_time; ++i) + { + int state_idx_to_use = (state_index + (receptive_field - 1) - i * dilation_rate) % receptive_field; + + conv1dLayers[i].forward(input, state[state_idx_to_use].data()); + } + + for(int i = 0; i < num_features_out; ++i) + { + for(int j = 0; j < num_filters_out; ++j) + { + output[i * num_filters_out + j] = state[state_index][i * num_filters_out + j] + bias[j]; + } + } + + std::fill(state[state_index].begin(), state[state_index].end(), (T)0); + state_index = state_index == receptive_field - 1 ? 0 : state_index + 1; + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[num_filters_out][num_filters_in][kernel_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>>& inWeights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[num_filters_out] + */ + RTNEURAL_REALTIME void setBias(const std::vector& inBias); + + /** Returns the size of the convolution kernel (time axis). */ + RTNEURAL_REALTIME int getKernelSizeTime() const noexcept { return kernel_size_time; } + + /** Returns the size of the convolution kernel (feature axis). */ + RTNEURAL_REALTIME int getKernelSizeFeature() const noexcept { return kernel_size_feature; } + + /** Returns the convolution stride (feature axis) */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride; } + + /** Returns the convolution dilation rate (time axis) */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate; } + + const int num_filters_in; + const int num_features_in; + const int num_filters_out; + const int kernel_size_time; + const int kernel_size_feature; + const int dilation_rate; + const int stride; + const int num_features_out; + const int receptive_field; + const bool valid_pad; + +private: + std::vector> conv1dLayers; + + std::vector> state; + + int state_index = 0; + + std::vector bias; +}; + +//==================================================== + +/** + * Static implementation of a 2-dimensional convolution layer with no activation. + * + * @tparam T Type of the layer (float, double, int ...) + * @tparam num_filters_in_t number of input filters (channels) + * @tparam num_filters_out_t number of output filters (channels) + * @tparam num_features_in_t number of input features + * @tparam kernel_size_time_t size of the convolution kernel (time axis) + * @tparam kernel_size_feature_t size of the convolution kernel (feature axis) + * @tparam dilation_rate_t dilation_rate (time axis) + * @tparam stride_t convolution stride (feature axis) + * @tparam valid_pad_t if true: pad is "valid". if false: pad is "same" + */ +template +class Conv2DT +{ +public: + static constexpr int num_features_out = Conv1DStateless::computeNumFeaturesOut(num_features_in_t, kernel_size_feature_t, stride_t, valid_pad_t); + static constexpr auto in_size = num_filters_in_t * num_features_in_t; + static constexpr auto out_size = num_filters_out_t * num_features_out; + + using bias_type = std::array; + using output_type = std::array; + + static constexpr int receptive_field = 1 + (kernel_size_time_t - 1) * dilation_rate_t; + static constexpr int num_filters_in = num_filters_in_t; + static constexpr int num_features_in = num_features_in_t; + static constexpr int num_filters_out = num_filters_out_t; + static constexpr int kernel_size_time = kernel_size_time_t; + static constexpr int kernel_size_feature = kernel_size_feature_t; + static constexpr int dilation_rate = dilation_rate_t; + static constexpr int stride = stride_t; + static constexpr bool valid_pad = valid_pad_t; + + Conv2DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "conv2d"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Reset the layer's state */ + RTNEURAL_REALTIME void reset() + { + state_index = 0; + + for(int i = 0; i < receptive_field; i++) + { + std::fill(state[i].begin(), state[i].end(), (T)0); + } + }; + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T (&ins)[in_size]) noexcept + { + for(int i = 0; i < kernel_size_time; ++i) + { + int state_idx_to_use = (state_index + (receptive_field - 1) - i * dilation_rate) % receptive_field; + + std::fill(std::begin(conv1dLayers[i].outs), std::end(conv1dLayers[i].outs), (T)0); + conv1dLayers[i].forward(ins); + + for(int j = 0; j < state[state_idx_to_use].size(); ++j) + state[state_idx_to_use][j] += conv1dLayers[i].outs[j]; + } + + for(int i = 0; i < num_features_out; ++i) + { + for(int j = 0; j < num_filters_out; ++j) + { + outs[i * num_filters_out + j] = state[state_index][i * num_filters_out + j] + bias[j]; + } + } + + std::fill(state[state_index].begin(), state[state_index].end(), (T)0); + state_index = state_index == receptive_field - 1 ? 0 : state_index + 1; + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights [kernel_size_time][num_filters_out][num_filters_in][kernel_size_feature] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>>& inWeights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[num_filters_out] + */ + RTNEURAL_REALTIME void setBias(const std::vector& inBias); + + /** Returns the size of the convolution kernel (time axis). */ + RTNEURAL_REALTIME int getKernelSizeTime() const noexcept { return kernel_size_time_t; } + + /** Returns the size of the convolution kernel (feature axis). */ + RTNEURAL_REALTIME int getKernelSizeFeature() const noexcept { return kernel_size_feature_t; } + + /** Returns the convolution stride */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride_t; } + + /** Returns the convolution dilation rate */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate_t; } + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[num_filters_out_t * num_features_out]; + +private: + std::array, + kernel_size_time_t> + conv1dLayers; + + std::array state; + + int state_index = 0; + + alignas(RTNEURAL_DEFAULT_ALIGNMENT) bias_type bias; +}; + +} // RTNEURAL + +#endif // RTNEURAL_USE_STL +#endif // CONV2D_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d.tpp new file mode 100644 index 0000000..47304c3 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d.tpp @@ -0,0 +1,92 @@ +#include "conv2d.h" + +#if !RTNEURAL_USE_EIGEN && !RTNEURAL_USE_XSIMD + +namespace RTNEURAL_NAMESPACE +{ +template +Conv2D::Conv2D(int in_num_filters_in, int in_num_filters_out, int in_num_features_in, int in_kernel_size_time, int in_kernel_size_feature, + int in_dilation_rate, int in_stride, bool in_valid_pad) + : num_filters_in(in_num_filters_in) + , num_filters_out(in_num_filters_out) + , num_features_in(in_num_features_in) + , kernel_size_time(in_kernel_size_time) + , kernel_size_feature(in_kernel_size_feature) + , dilation_rate(in_dilation_rate) + , stride(in_stride) + , num_features_out(Conv1DStateless::computeNumFeaturesOut(in_num_features_in, in_kernel_size_feature, in_stride, in_valid_pad)) + , receptive_field(1 + (in_kernel_size_time - 1) * in_dilation_rate) // See "Dilated (atrous) convolution" note here: https://distill.pub/2019/computing-receptive-fields/ + , valid_pad(in_valid_pad) + , Layer(in_num_features_in * in_num_filters_in, Conv1DStateless::computeNumFeaturesOut(in_num_features_in, in_kernel_size_feature, in_stride, in_valid_pad) * in_num_filters_out) +{ + conv1dLayers.resize(kernel_size_time, Conv1DStateless(num_filters_in, num_features_in, num_filters_out, kernel_size_feature, stride, valid_pad)); + bias.resize(num_filters_out, (T)0); + + state.resize(receptive_field); + for(auto& stateMat : state) + { + stateMat.resize(num_filters_out * num_features_out, (T)0); + } +} + +template +Conv2D::Conv2D(std::initializer_list sizes) + : Conv2D(*sizes.begin(), *(sizes.begin() + 1), *(sizes.begin() + 2), *(sizes.begin() + 3), *(sizes.begin() + 4), + *(sizes.begin() + 5), *(sizes.begin() + 6), *(sizes.begin() + 7)) +{ +} + +template +Conv2D::Conv2D(const Conv2D& other) + : Conv2D(other.num_filters_in, other.num_filters_out, other.num_features_in, other.kernel_size_time, other.kernel_size_feature, + other.dilation_rate, other.stride, other.valid_pad) +{ +} + +template +Conv2D& Conv2D::operator=(const Conv2D& other) +{ + return *this = Conv2D(other); +} + +template +void Conv2D::setWeights(const std::vector>>>& inWeights) +{ + for(int i = 0; i < kernel_size_time; i++) + { + conv1dLayers[i].setWeights(inWeights[i]); + } +} + +template +void Conv2D::setBias(const std::vector& inBias) +{ + std::copy(inBias.begin(), inBias.end(), bias.begin()); +} + +template +Conv2DT::Conv2DT() +{ +} + +template +void Conv2DT::setWeights(const std::vector>>>& inWeights) +{ + for(int i = 0; i < kernel_size_time_t; i++) + { + conv1dLayers[i].setWeights(inWeights[i]); + } +} + +template +void Conv2DT::setBias(const std::vector& inBias) +{ + std::copy(inBias.begin(), inBias.end(), bias.begin()); +} +} // RTNEURAL_NAMESPACE + +#endif // RTNEURAL_USE_STL diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_eigen.h new file mode 100644 index 0000000..9dd7ed7 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_eigen.h @@ -0,0 +1,247 @@ +#ifndef CONV2D_EIGEN_H_INCLUDED +#define CONV2D_EIGEN_H_INCLUDED + +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include "../conv1d_stateless/conv1d_stateless.h" +#include + +namespace RTNEURAL_NAMESPACE +{ +/** + * Dynamic implementation of a 2-dimensional convolution layer with no activation. + * + * @tparam T Type of the layer (float, double, int ...) + */ +template +class Conv2D : public Layer +{ +public: + /** + * @param in_num_filters_in number of input filters (channels) + * @param in_num_filters_out number of output filters (channels) + * @param in_num_features_in number of input features + * @param in_kernel_size_time size of the convolution kernel (time axis) + * @param in_kernel_size_feature size of the convolution kernel (feature axis) + * @param in_dilation_rate dilation_rate (time axis) + * @param in_stride convolution stride (feature axis) + * @param in_valid_pad whether the padding is "valid" or not ("same" otherwise) + */ + Conv2D(int in_num_filters_in, int in_num_filters_out, int in_num_features_in, int in_kernel_size_time, int in_kernel_size_feature, int in_dilation_rate, int in_stride, bool in_valid_pad); + Conv2D(std::initializer_list sizes); + Conv2D(const Conv2D& other); + Conv2D& operator=(const Conv2D& other); + virtual ~Conv2D() = default; + + /** Reset the layer's state */ + RTNEURAL_REALTIME void reset() override + { + state_index = 0; + + for(int i = 0; i < receptive_field; i++) + { + state[i].setZero(); + } + }; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "conv2d"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* output) noexcept override + { + auto inMatrix = Eigen::Map, + RTNeuralEigenAlignment>(input, num_filters_in, num_features_in); + + auto outMatrix = Eigen::Map, + RTNeuralEigenAlignment>(output, num_filters_out, num_features_out); + + for(int i = 0; i < kernel_size_time; i++) + { + int state_idx_to_use = (state_index + (receptive_field - 1) - i * dilation_rate) % receptive_field; + + conv1dLayers[i].forward(inMatrix.data(), state[state_idx_to_use].data()); + } + + outMatrix = state[state_index].colwise() + bias; + + state[state_index].setZero(); + state_index = state_index == receptive_field - 1 ? 0 : state_index + 1; + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[num_filters_out][num_filters_in][kernel_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>>& inWeights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[num_filters_out] + */ + RTNEURAL_REALTIME void setBias(const std::vector& inBias); + + /** Returns the size of the convolution kernel (time axis). */ + RTNEURAL_REALTIME int getKernelSizeTime() const noexcept { return kernel_size_time; } + + /** Returns the size of the convolution kernel (feature axis). */ + RTNEURAL_REALTIME int getKernelSizeFeature() const noexcept { return kernel_size_feature; } + + /** Returns the convolution stride (feature axis) */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride; } + + /** Returns the convolution dilation rate (time axis) */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate; } + + const int num_filters_in; + const int num_features_in; + const int num_filters_out; + const int kernel_size_time; + const int kernel_size_feature; + const int dilation_rate; + const int stride; + const int num_features_out; + const int receptive_field; + const bool valid_pad; + +private: + std::vector> conv1dLayers; + + std::vector> state; + + int state_index = 0; + + Eigen::Vector bias; +}; + +//==================================================== + +/** + * Static implementation of a 2-dimensional convolution layer with no activation. + * + * @tparam T Type of the layer (float, double, int ...) + * @tparam num_filters_in_t number of input filters (channels) + * @tparam num_filters_out_t number of output filters (channels) + * @tparam num_features_in_t number of input features + * @tparam kernel_size_time_t size of the convolution kernel (time axis) + * @tparam kernel_size_feature_t size of the convolution kernel (feature axis) + * @tparam dilation_rate_t dilation_rate (time axis) + * @tparam stride_t convolution stride (feature axis) + * @tparam valid_pad_t if true: pad is "valid". if false: pad is "same" + */ +template +class Conv2DT +{ +public: + static constexpr int num_features_out = Conv1DStateless::computeNumFeaturesOut(num_features_in_t, kernel_size_feature_t, stride_t, valid_pad_t); + static constexpr auto in_size = num_filters_in_t * num_features_in_t; + static constexpr auto out_size = num_filters_out_t * num_features_out; + + using bias_type = Eigen::Vector; + using input_type = Eigen::Matrix; + using input_type_flat = Eigen::Matrix; + using output_type = Eigen::Matrix; + using output_type_flat = Eigen::Matrix; + + static constexpr int receptive_field = 1 + (kernel_size_time_t - 1) * dilation_rate_t; + static constexpr int num_filters_in = num_filters_in_t; + static constexpr int num_features_in = num_features_in_t; + static constexpr int num_filters_out = num_filters_out_t; + static constexpr int kernel_size_time = kernel_size_time_t; + static constexpr int kernel_size_feature = kernel_size_feature_t; + static constexpr int dilation_rate = dilation_rate_t; + static constexpr int stride = stride_t; + static constexpr bool valid_pad = valid_pad_t; + + Conv2DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "conv2d"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Reset the layer's state */ + RTNEURAL_REALTIME void reset() + { + state_index = 0; + + for(int i = 0; i < receptive_field; i++) + { + state[i] = output_type::Zero(); + } + }; + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const input_type_flat& inMatrix) noexcept + { + const auto inMatrixReshaped = Eigen::Map(inMatrix.data()); + auto outMatrix = Eigen::Map(outs.data()); + + for(int i = 0; i < kernel_size_time_t; i++) + { + int state_idx_to_use = (state_index + (receptive_field - 1) - i * dilation_rate) % receptive_field; + + conv1dLayers[i].forward(inMatrixReshaped); + + state[state_idx_to_use] += Eigen::Map(conv1dLayers[i].outs); + } + + outMatrix = state[state_index].colwise() + bias; + + state[state_index].setZero(); + state_index = state_index == receptive_field - 1 ? 0 : state_index + 1; + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights [kernel_size_time][num_filters_out][num_filters_in][kernel_size_feature] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>>& inWeights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[num_filters_out] + */ + RTNEURAL_REALTIME void setBias(const std::vector& inBias); + + /** Returns the size of the convolution kernel (time axis). */ + RTNEURAL_REALTIME int getKernelSizeTime() const noexcept { return kernel_size_time_t; } + + /** Returns the size of the convolution kernel (feature axis). */ + RTNEURAL_REALTIME int getKernelSizeFeature() const noexcept { return kernel_size_feature_t; } + + /** Returns the convolution stride */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride_t; } + + /** Returns the convolution dilation rate */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate_t; } + + Eigen::Map outs; + +private: + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[num_filters_out_t * num_features_out]; + + std::array, + kernel_size_time_t> + conv1dLayers; + + std::array state; + + int state_index = 0; + + bias_type bias; +}; + +} // RTNEURAL + +#endif // CONV2D_EIGEN_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_eigen.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_eigen.tpp new file mode 100644 index 0000000..7ede459 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_eigen.tpp @@ -0,0 +1,91 @@ +#include "conv2d_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ +template +Conv2D::Conv2D(int in_num_filters_in, int in_num_filters_out, int in_num_features_in, int in_kernel_size_time, int in_kernel_size_feature, + int in_dilation_rate, int in_stride, bool in_valid_pad) + : num_filters_in(in_num_filters_in) + , num_filters_out(in_num_filters_out) + , num_features_in(in_num_features_in) + , kernel_size_time(in_kernel_size_time) + , kernel_size_feature(in_kernel_size_feature) + , dilation_rate(in_dilation_rate) + , stride(in_stride) + , num_features_out(Conv1DStateless::computeNumFeaturesOut(in_num_features_in, in_kernel_size_feature, in_stride, in_valid_pad)) + , receptive_field(1 + (in_kernel_size_time - 1) * in_dilation_rate) // See "Dilated (atrous) convolution" note here: https://distill.pub/2019/computing-receptive-fields/ + , valid_pad(in_valid_pad) + , Layer(in_num_features_in * in_num_filters_in, Conv1DStateless::computeNumFeaturesOut(in_num_features_in, in_kernel_size_feature, in_stride, in_valid_pad) * in_num_filters_out) +{ + conv1dLayers.resize(kernel_size_time, Conv1DStateless(num_filters_in, num_features_in, num_filters_out, kernel_size_feature, stride, valid_pad)); + bias = Eigen::Vector::Zero(num_filters_out); + + state.resize(receptive_field, Eigen::Matrix::Zero(num_filters_out, num_features_out)); +} + +template +Conv2D::Conv2D(std::initializer_list sizes) + : Conv2D(*sizes.begin(), *(sizes.begin() + 1), *(sizes.begin() + 2), *(sizes.begin() + 3), *(sizes.begin() + 4), + *(sizes.begin() + 5), *(sizes.begin() + 6), *(sizes.begin() + 7)) +{ +} + +template +Conv2D::Conv2D(const Conv2D& other) + : Conv2D(other.num_filters_in, other.num_filters_out, other.num_features_in, other.kernel_size_time, other.kernel_size_feature, + other.dilation_rate, other.stride, other.valid_pad) +{ +} + +template +Conv2D& Conv2D::operator=(const Conv2D& other) +{ + return *this = Conv2D(other); +} + +template +void Conv2D::setWeights(const std::vector>>>& inWeights) +{ + for(int i = 0; i < kernel_size_time; i++) + { + conv1dLayers[i].setWeights(inWeights[i]); + } +} + +template +void Conv2D::setBias(const std::vector& inBias) +{ + for(int i = 0; i < num_filters_out; i++) + { + bias(i) = inBias[i]; + } +} + +template +Conv2DT::Conv2DT() + : outs(outs_internal) +{ +} + +template +void Conv2DT::setWeights(const std::vector>>>& inWeights) +{ + for(int i = 0; i < kernel_size_time_t; i++) + { + conv1dLayers[i].setWeights(inWeights[i]); + } +} + +template +void Conv2DT::setBias(const std::vector& inBias) +{ + for(int i = 0; i < num_filters_out_t; i++) + { + bias(i) = inBias[i]; + } +} +} // RTNEURAL_NAMESPACE \ No newline at end of file diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_xsimd.h new file mode 100644 index 0000000..5c783ff --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_xsimd.h @@ -0,0 +1,252 @@ +#ifndef RTNEURAL_CONV2D_XSIMD_H +#define RTNEURAL_CONV2D_XSIMD_H + +#include "../Layer.h" +#include "../config.h" +#include "../conv1d_stateless/conv1d_stateless.h" +#include + +namespace RTNEURAL_NAMESPACE +{ +/** + * Dynamic implementation of a 2-dimensional convolution layer with no activation. + * + * @tparam T Type of the layer (float, double, int ...) + */ +template +class Conv2D : public Layer +{ +public: + /** + * @param in_num_filters_in number of input filters (channels) + * @param in_num_filters_out number of output filters (channels) + * @param in_num_features_in number of input features + * @param in_kernel_size_time size of the convolution kernel (time axis) + * @param in_kernel_size_feature size of the convolution kernel (feature axis) + * @param in_dilation_rate dilation_rate (time axis) + * @param in_stride convolution stride (feature axis) + * @param in_valid_pad whether the padding is "valid" or not ("same" otherwise) + */ + Conv2D(int in_num_filters_in, int in_num_filters_out, int in_num_features_in, int in_kernel_size_time, int in_kernel_size_feature, int in_dilation_rate, int in_stride, bool in_valid_pad); + Conv2D(std::initializer_list sizes); + Conv2D(const Conv2D& other); + Conv2D& operator=(const Conv2D& other); + virtual ~Conv2D() = default; + + /** Reset the layer's state */ + RTNEURAL_REALTIME void reset() override + { + state_index = 0; + + for(int i = 0; i < receptive_field; i++) + { + std::fill(state[i].begin(), state[i].end(), (T)0); + } + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "conv2d"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* output) noexcept override + { + for(int i = 0; i < kernel_size_time; ++i) + { + int state_idx_to_use = (state_index + (receptive_field - 1) - i * dilation_rate) % receptive_field; + + conv1dLayers[i].forward(input, state[state_idx_to_use].data()); + } + + for(int i = 0; i < num_features_out; ++i) + { + const auto* stateCol = state[state_index].data() + i * num_filters_out; + auto* outCol = output + i * num_filters_out; + xsimd::transform(stateCol, stateCol + num_filters_out, bias.begin(), outCol, [](auto a, auto b) + { return a + b; }); + } + + std::fill(state[state_index].begin(), state[state_index].end(), (T)0); + state_index = state_index == receptive_field - 1 ? 0 : state_index + 1; + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights[num_filters_out][num_filters_in][kernel_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>>& inWeights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[num_filters_out] + */ + RTNEURAL_REALTIME void setBias(const std::vector& inBias); + + /** Returns the size of the convolution kernel (time axis). */ + RTNEURAL_REALTIME int getKernelSizeTime() const noexcept { return kernel_size_time; } + + /** Returns the size of the convolution kernel (feature axis). */ + RTNEURAL_REALTIME int getKernelSizeFeature() const noexcept { return kernel_size_feature; } + + /** Returns the convolution stride (feature axis) */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride; } + + /** Returns the convolution dilation rate (time axis) */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate; } + + const int num_filters_in; + const int num_features_in; + const int num_filters_out; + const int kernel_size_time; + const int kernel_size_feature; + const int dilation_rate; + const int stride; + const int num_features_out; + const int receptive_field; + const bool valid_pad; + +private: + std::vector> conv1dLayers; + + std::vector>> state; + + int state_index = 0; + + std::vector> bias; +}; + +//==================================================== + +/** + * Static implementation of a 2-dimensional convolution layer with no activation. + * + * @tparam T Type of the layer (float, double, int ...) + * @tparam num_filters_in_t number of input filters (channels) + * @tparam num_filters_out_t number of output filters (channels) + * @tparam num_features_in_t number of input features + * @tparam kernel_size_time_t size of the convolution kernel (time axis) + * @tparam kernel_size_feature_t size of the convolution kernel (feature axis) + * @tparam dilation_rate_t dilation_rate (time axis) + * @tparam stride_t convolution stride (feature axis) + * @tparam valid_pad_t if true: pad is "valid". if false: pad is "same" + */ +template +class Conv2DT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_num_filters_in = ceil_div(num_filters_in_t, v_size); + static constexpr auto v_num_filters_out = ceil_div(num_filters_out_t, v_size); + static constexpr auto v_in_size = v_num_filters_in * num_features_in_t; + +public: + static constexpr int num_features_out = Conv1DStateless::computeNumFeaturesOut(num_features_in_t, kernel_size_feature_t, stride_t, valid_pad_t); + static constexpr auto in_size = num_filters_in_t * num_features_in_t; + static constexpr auto out_size = num_filters_out_t * num_features_out; + static constexpr auto v_out_size = v_num_filters_out * num_features_out; + + using output_type = std::array; + + static constexpr int receptive_field = 1 + (kernel_size_time_t - 1) * dilation_rate_t; + static constexpr int num_filters_in = num_filters_in_t; + static constexpr int num_features_in = num_features_in_t; + static constexpr int num_filters_out = num_filters_out_t; + static constexpr int kernel_size_time = kernel_size_time_t; + static constexpr int kernel_size_feature = kernel_size_feature_t; + static constexpr int dilation_rate = dilation_rate_t; + static constexpr int stride = stride_t; + static constexpr bool valid_pad = valid_pad_t; + + Conv2DT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "conv2d"; } + + /** Returns false since convolution is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Reset the layer's state */ + RTNEURAL_REALTIME void reset() + { + state_index = 0; + + for(int i = 0; i < receptive_field; i++) + { + std::fill(state[i].begin(), state[i].end(), (T)0); + } + } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const v_type (&ins)[v_in_size]) noexcept + { + for(int i = 0; i < kernel_size_time; ++i) + { + int state_idx_to_use = (state_index + (receptive_field - 1) - i * dilation_rate) % receptive_field; + + std::fill(std::begin(conv1dLayers[i].outs), std::end(conv1dLayers[i].outs), (T)0); + conv1dLayers[i].forward(ins); + + for(int j = 0; j < state[state_idx_to_use].size(); ++j) + state[state_idx_to_use][j] += conv1dLayers[i].outs[j]; + } + + for(int i = 0; i < num_features_out; ++i) + { + for(int j = 0; j < v_num_filters_out; ++j) + { + outs[i * v_num_filters_out + j] = state[state_index][i * v_num_filters_out + j] + bias[j]; + } + } + + std::fill(state[state_index].begin(), state[state_index].end(), (T)0); + state_index = state_index == receptive_field - 1 ? 0 : state_index + 1; + } + + /** + * Sets the layer weights. + * + * The weights vector must have size weights [kernel_size_time][num_filters_out][num_filters_in][kernel_size_feature] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>>>& inWeights); + + /** + * Sets the layer biases. + * + * The bias vector must have size bias[num_filters_out] + */ + RTNEURAL_REALTIME void setBias(const std::vector& inBias); + + /** Returns the size of the convolution kernel (time axis). */ + RTNEURAL_REALTIME int getKernelSizeTime() const noexcept { return kernel_size_time_t; } + + /** Returns the size of the convolution kernel (feature axis). */ + RTNEURAL_REALTIME int getKernelSizeFeature() const noexcept { return kernel_size_feature_t; } + + /** Returns the convolution stride */ + RTNEURAL_REALTIME int getStride() const noexcept { return stride_t; } + + /** Returns the convolution dilation rate */ + RTNEURAL_REALTIME int getDilationRate() const noexcept { return dilation_rate_t; } + + v_type outs[v_out_size]; + +private: + std::array, + kernel_size_time_t> + conv1dLayers; + + std::array state; + + int state_index = 0; + + v_type bias[v_num_filters_out]; +}; + +} // RTNEURAL + +#endif // RTNEURAL_CONV2D_XSIMD_H diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_xsimd.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_xsimd.tpp new file mode 100644 index 0000000..c6fbbce --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/conv2d/conv2d_xsimd.tpp @@ -0,0 +1,88 @@ +#include "conv2d_xsimd.h" + +namespace RTNEURAL_NAMESPACE +{ +template +Conv2D::Conv2D(int in_num_filters_in, int in_num_filters_out, int in_num_features_in, int in_kernel_size_time, int in_kernel_size_feature, + int in_dilation_rate, int in_stride, bool in_valid_pad) + : num_filters_in(in_num_filters_in) + , num_filters_out(in_num_filters_out) + , num_features_in(in_num_features_in) + , kernel_size_time(in_kernel_size_time) + , kernel_size_feature(in_kernel_size_feature) + , dilation_rate(in_dilation_rate) + , stride(in_stride) + , num_features_out(Conv1DStateless::computeNumFeaturesOut(in_num_features_in, in_kernel_size_feature, in_stride, in_valid_pad)) + , receptive_field(1 + (in_kernel_size_time - 1) * in_dilation_rate) // See "Dilated (atrous) convolution" note here: https://distill.pub/2019/computing-receptive-fields/ + , valid_pad(in_valid_pad) + , Layer(in_num_features_in * in_num_filters_in, Conv1DStateless::computeNumFeaturesOut(in_num_features_in, in_kernel_size_feature, in_stride, in_valid_pad) * in_num_filters_out) +{ + conv1dLayers.resize(kernel_size_time, Conv1DStateless(num_filters_in, num_features_in, num_filters_out, kernel_size_feature, stride, valid_pad)); + bias.resize(num_filters_out, (T)0); + + state.resize(receptive_field); + for(auto& stateMat : state) + { + stateMat.resize(num_filters_out * num_features_out, (T)0); + } +} + +template +Conv2D::Conv2D(std::initializer_list sizes) + : Conv2D(*sizes.begin(), *(sizes.begin() + 1), *(sizes.begin() + 2), *(sizes.begin() + 3), *(sizes.begin() + 4), + *(sizes.begin() + 5), *(sizes.begin() + 6), *(sizes.begin() + 7)) +{ +} + +template +Conv2D::Conv2D(const Conv2D& other) + : Conv2D(other.num_filters_in, other.num_filters_out, other.num_features_in, other.kernel_size_time, other.kernel_size_feature, + other.dilation_rate, other.stride, other.valid_pad) +{ +} + +template +Conv2D& Conv2D::operator=(const Conv2D& other) +{ + return *this = Conv2D(other); +} + +template +void Conv2D::setWeights(const std::vector>>>& inWeights) +{ + for(int i = 0; i < kernel_size_time; i++) + { + conv1dLayers[i].setWeights(inWeights[i]); + } +} + +template +void Conv2D::setBias(const std::vector& inBias) +{ + std::copy(inBias.begin(), inBias.end(), bias.begin()); +} + +template +Conv2DT::Conv2DT() +{ +} + +template +void Conv2DT::setWeights(const std::vector>>>& inWeights) +{ + for(int i = 0; i < kernel_size_time_t; i++) + { + conv1dLayers[i].setWeights(inWeights[i]); + } +} + +template +void Conv2DT::setBias(const std::vector& inBias) +{ + std::copy(inBias.begin(), inBias.end(), reinterpret_cast(std::begin(bias))); +} +} // RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/dense/dense.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/dense/dense.h new file mode 100644 index 0000000..9ab5973 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/dense/dense.h @@ -0,0 +1,254 @@ +#ifndef DENSE_H_INCLUDED +#define DENSE_H_INCLUDED + +#include +#include +#include + +#if RTNEURAL_USE_EIGEN +#include "dense_eigen.h" +#elif RTNEURAL_USE_XSIMD +#include "dense_xsimd.h" +#else +#include "../Layer.h" +#include "../config.h" + +namespace RTNEURAL_NAMESPACE +{ + +#ifndef DOXYGEN +/** Single-output dense layer used internally */ +template +class Dense1 +{ +public: + explicit Dense1(int in_size) + : in_size(in_size) + { + weights = new T[in_size]; + } + + ~Dense1() { delete[] weights; } + + RTNEURAL_REALTIME inline T forward(const T* input) noexcept + { + return std::inner_product(weights, weights + in_size, input, (T)0) + bias; + } + + RTNEURAL_REALTIME void setWeights(const T* newWeights) + { + for(int i = 0; i < in_size; ++i) + weights[i] = newWeights[i]; + } + + RTNEURAL_REALTIME void setBias(T b) { bias = b; } + + RTNEURAL_REALTIME T getWeight(int i) const noexcept { return weights[i]; } + + RTNEURAL_REALTIME T getBias() const noexcept { return bias; } + +private: + const int in_size; + T bias; + + T* weights; +}; +#endif // DOXYGEN + +/** + * Dynamic implementation of a fully-connected (dense) layer, + * with no activation. + */ +template +class Dense final : public Layer +{ +public: + /** Constructs a dense layer for a given input and output size. */ + Dense(int in_size, int out_size) + : Layer(in_size, out_size) + { + subLayers = new Dense1*[out_size]; + for(int i = 0; i < out_size; ++i) + subLayers[i] = new Dense1(in_size); + } + + Dense(std::initializer_list sizes) + : Dense(*sizes.begin(), *(sizes.begin() + 1)) + { + } + + Dense(const Dense& other) + : Dense(other.in_size, other.out_size) + { + } + + Dense& operator=(const Dense& other) + { + return *this = Dense(other); + } + + virtual ~Dense() + { + for(int i = 0; i < Layer::out_size; ++i) + delete subLayers[i]; + + delete[] subLayers; + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "dense"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + for(int i = 0; i < Layer::out_size; ++i) + out[i] = subLayers[i]->forward(input); + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights vector must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>& newWeights) + { + for(int i = 0; i < Layer::out_size; ++i) + subLayers[i]->setWeights(newWeights[i].data()); + } + + /** + * Sets the layer weights from a given array. + * + * The dimension of the weights array must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(T** newWeights) + { + for(int i = 0; i < Layer::out_size; ++i) + subLayers[i]->setWeights(newWeights[i]); + } + + /** + * Sets the layer bias from a given array of size + * bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const T* b) + { + for(int i = 0; i < Layer::out_size; ++i) + subLayers[i]->setBias(b[i]); + } + + /** Returns the weights value at the given indices. */ + RTNEURAL_REALTIME T getWeight(int i, int k) const noexcept + { + return subLayers[i]->getWeight(k); + } + + /** Returns the bias value at the given index. */ + RTNEURAL_REALTIME T getBias(int i) const noexcept { return subLayers[i]->getBias(); } + +private: + Dense1** subLayers; +}; + +//==================================================== +/** + * Static implementation of a fully-connected (dense) layer, + * with no activation. + */ +template +class DenseT +{ + static constexpr auto weights_size = in_sizet * out_sizet; + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + + DenseT() + { + for(int i = 0; i < weights_size; ++i) + weights[i] = (T)0.0; + + for(int i = 0; i < out_size; ++i) + bias[i] = (T)0.0; + + for(int i = 0; i < out_size; ++i) + outs[i] = (T)0.0; + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "dense"; } + + /** Returns false since dense is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Reset is a no-op, since Dense does not have state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T (&ins)[in_size]) noexcept + { + for(int i = 0; i < out_size; ++i) + outs[i] = std::inner_product(ins, ins + in_size, &weights[i * in_size], (T)0) + bias[i]; + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights vector must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>& newWeights) + { + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < in_size; ++k) + { + auto idx = i * in_size + k; + weights[idx] = newWeights[i][k]; + } + } + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights array must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(T** newWeights) + { + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < in_size; ++k) + { + auto idx = i * in_size + k; + weights[idx] = newWeights[i][k]; + } + } + } + + /** + * Sets the layer bias from a given array of size + * bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const T* b) + { + for(int i = 0; i < out_size; ++i) + bias[i] = b[i]; + } + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + +private: + T bias[out_size]; + T weights[weights_size]; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // RTNEURAL_USE_STL + +#endif // DENSE_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/dense/dense_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/dense/dense_eigen.h new file mode 100644 index 0000000..18b540e --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/dense/dense_eigen.h @@ -0,0 +1,210 @@ +#ifndef DENSEEIGEN_H_INCLUDED +#define DENSEEIGEN_H_INCLUDED + +#include "../Layer.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a fully-connected (dense) layer, + * with no activation. + */ +template +class Dense : public Layer +{ +public: + /** Constructs a dense layer for a given input and output size. */ + Dense(int in_size, int out_size) + : Layer(in_size, out_size) + { + weights = Eigen::Matrix::Zero(out_size, in_size + 1); + + inVec = Eigen::Matrix::Zero(in_size + 1); + outVec = Eigen::Matrix::Zero(out_size); + + inVec(in_size, 0) = (T)1; + } + + Dense(std::initializer_list sizes) + : Dense(*sizes.begin(), *(sizes.begin() + 1)) + { + } + + Dense(const Dense& other) + : Dense(other.in_size, other.out_size) + { + } + + Dense& operator=(const Dense& other) + { + return *this = Dense(other); + } + + virtual ~Dense() = default; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "dense"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + for(int i = 0; i < Layer::in_size; ++i) + inVec(i, 0) = input[i]; + + /** + * out = | w b | * | input | + * | 1 | + */ + outVec.noalias() = weights * inVec; + + for(int i = 0; i < Layer::out_size; ++i) + out[i] = outVec(i, 0); + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights vector must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>& newWeights) + { + for(int i = 0; i < Layer::out_size; ++i) + for(int k = 0; k < Layer::in_size; ++k) + weights(i, k) = newWeights[i][k]; + } + + /** + * Sets the layer weights from a given array. + * + * The dimension of the weights array must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(T** newWeights) + { + for(int i = 0; i < Layer::out_size; ++i) + for(int k = 0; k < Layer::in_size; ++k) + weights(i, k) = newWeights[i][k]; + } + + /** + * Sets the layer bias from a given array of size + * bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const T* b) + { + for(int i = 0; i < Layer::out_size; ++i) + weights(i, Layer::in_size) = b[i]; + } + + /** Returns the weights value at the given indices. */ + RTNEURAL_REALTIME T getWeight(int i, int k) const noexcept { return weights(i, k); } + + /** Returns the bias value at the given index. */ + RTNEURAL_REALTIME T getBias(int i) const noexcept { return weights(i, Layer::in_size); } + +private: + Eigen::Matrix weights; + + Eigen::Matrix inVec; + Eigen::Matrix outVec; +}; + +//==================================================== +/** + * Static implementation of a fully-connected (dense) layer, + * with no activation. + */ +template +class DenseT +{ + using out_vec_type = Eigen::Matrix; + using in_vec_type = Eigen::Matrix; + using mat_type = Eigen::Matrix; + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + + DenseT() + : outs(outs_internal) + { + weights = mat_type::Zero(); + ins_internal = in_vec_type::Zero(); + ins_internal(in_size, 0) = (T)1; + outs = out_vec_type::Zero(); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "dense"; } + + /** Returns false since dense is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Reset is a no-op, since Dense does not have state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const Eigen::Matrix& ins) noexcept + { + for(int i = 0; i < in_size; ++i) + ins_internal(i, 0) = ins(i, 0); + + /** + * out = | w b | * | input | + * | 1 | + */ + outs.noalias() = weights * ins_internal; + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights vector must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>& newWeights) + { + for(int i = 0; i < out_size; ++i) + for(int k = 0; k < in_size; ++k) + weights(i, k) = newWeights[i][k]; + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights array must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(T** newWeights) + { + for(int i = 0; i < out_size; ++i) + for(int k = 0; k < in_size; ++k) + weights(i, k) = newWeights[i][k]; + } + + /** + * Sets the layer bias from a given array of size + * bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const T* b) + { + for(int i = 0; i < out_size; ++i) + weights(i, in_size) = b[i]; + } + + Eigen::Map outs; + +private: + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + in_vec_type ins_internal; + + mat_type weights; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // DENSEEIGEN_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/dense/dense_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/dense/dense_xsimd.h new file mode 100644 index 0000000..73c904b --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/dense/dense_xsimd.h @@ -0,0 +1,389 @@ +#ifndef DENSEXSIMD_H_INCLUDED +#define DENSEXSIMD_H_INCLUDED + +#include "../Layer.h" +#include "../config.h" +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a fully-connected (dense) layer, + * with no activation. + */ +template +class Dense : public Layer +{ +public: + /** Constructs a dense layer for a given input and output size. */ + Dense(int in_size, int out_size) + : Layer(in_size, out_size) + { + prod.resize(in_size, (T)0); + weights = vec2_type(out_size, vec_type(in_size, (T)0)); + + bias.resize(out_size, (T)0); + sums.resize(out_size, (T)0); + } + + Dense(std::initializer_list sizes) + : Dense(*sizes.begin(), *(sizes.begin() + 1)) + { + } + + Dense(const Dense& other) + : Dense(other.in_size, other.out_size) + { + } + + Dense& operator=(const Dense& other) + { + return *this = Dense(other); + } + + virtual ~Dense() = default; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "dense"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* out) noexcept override + { + for(int l = 0; l < Layer::out_size; ++l) + { + xsimd::transform(input, &input[Layer::in_size], weights[l].data(), prod.data(), + [](auto const& a, auto const& b) + { return a * b; }); + + auto sum = xsimd::reduce(prod.begin(), prod.begin() + Layer::in_size, (T)0); + out[l] = sum + bias[l]; + } + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights vector must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>& newWeights) + { + for(int i = 0; i < Layer::out_size; ++i) + for(int k = 0; k < Layer::in_size; ++k) + weights[i][k] = newWeights[i][k]; + } + + /** + * Sets the layer weights from a given array. + * + * The dimension of the weights array must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(T** newWeights) + { + for(int i = 0; i < Layer::out_size; ++i) + for(int k = 0; k < Layer::in_size; ++k) + weights[i][k] = newWeights[i][k]; + } + + /** + * Sets the layer bias from a given array of size + * bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const T* b) + { + for(int i = 0; i < Layer::out_size; ++i) + bias[i] = b[i]; + } + + /** Returns the weights value at the given indices. */ + RTNEURAL_REALTIME T getWeight(int i, int k) const noexcept { return weights[i][k]; } + + /** Returns the bias value at the given index. */ + RTNEURAL_REALTIME T getBias(int i) const noexcept { return bias[i]; } + +private: + using vec_type = std::vector>; + using vec2_type = std::vector; + + vec_type bias; + vec2_type weights; + vec_type prod; + vec_type sums; +}; + +//==================================================== +/** + * Static implementation of a fully-connected (dense) layer, + * with no activation. + */ +template +class DenseT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_in_size = ceil_div(in_sizet, v_size); + static constexpr auto v_out_size = ceil_div(out_sizet, v_size); + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + + DenseT() + { + for(int i = 0; i < v_out_size; ++i) + for(int k = 0; k < in_size; ++k) + weights[k][i] = v_type((T)0.0); + + for(int i = 0; i < v_out_size; ++i) + bias[i] = v_type((T)0.0); + + for(int i = 0; i < v_out_size; ++i) + outs[i] = v_type((T)0.0); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "dense"; } + + /** Returns false since dense is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Reset is a no-op, since Dense does not have state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const v_type (&ins)[v_in_size]) noexcept + { + static constexpr auto v_size_inner = std::min(v_size, in_size); + + for(int i = 0; i < v_out_size; ++i) + outs[i] = bias[i]; + + T scalar_in alignas(RTNEURAL_DEFAULT_ALIGNMENT)[v_size] { (T)0 }; + for(int k = 0; k < v_in_size; ++k) + { + ins[k].store_aligned(scalar_in); + for(int i = 0; i < v_out_size; ++i) + { + for(int j = 0; j < v_size_inner; ++j) + outs[i] += scalar_in[j] * weights[k * v_size + j][i]; + } + } + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights vector must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>& newWeights) + { + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < in_size; ++k) + { + weights[k][i / v_size] = set_value(weights[k][i / v_size], i % v_size, newWeights[i][k]); + } + } + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights array must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(T** newWeights) + { + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < in_size; ++k) + { + weights[k][i / v_size] = set_value(weights[k][i / v_size], i % v_size, newWeights[i][k]); + } + } + } + + /** + * Sets the layer bias from a given array of size + * bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const T* b) + { + for(int i = 0; i < out_size; ++i) + bias[i / v_size] = set_value(bias[i / v_size], i % v_size, b[i]); + } + + v_type outs[v_out_size]; + +private: + v_type bias[v_out_size]; + v_type weights[in_size][v_out_size]; +}; + +/** + * Static implementation of a fully-connected (dense) layer, + * optimized for out_size=1. + */ +template +class DenseT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_in_size = ceil_div(in_sizet, v_size); + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = 1; + + DenseT() + { + for(int i = 0; i < v_in_size; ++i) + weights[i] = v_type((T)0.0); + + outs[0] = v_type((T)0.0); + } + + std::string getName() const noexcept { return "dense"; } + constexpr bool isActivation() const noexcept { return false; } + + RTNEURAL_REALTIME void reset() { } + + RTNEURAL_REALTIME inline void forward(const v_type (&ins)[v_in_size]) noexcept + { + v_type y {}; + for(int k = 0; k < v_in_size; ++k) + y += ins[k] * weights[k]; + + outs[0] = v_type(xsimd::reduce_add(y) + bias); + } + + RTNEURAL_REALTIME void setWeights(const std::vector>& newWeights) + { + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < in_size; ++k) + { + auto idx = k / v_size; + weights[idx] = set_value(weights[idx], k % v_size, newWeights[i][k]); + } + } + } + + RTNEURAL_REALTIME void setWeights(T** newWeights) + { + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < in_size; ++k) + { + auto idx = k / v_size; + weights[idx] = set_value(weights[idx], k % v_size, newWeights[i][k]); + } + } + } + + RTNEURAL_REALTIME void setBias(const T* b) + { + bias = b[0]; + } + + v_type outs[1]; + +private: + T bias; + v_type weights[v_in_size]; +}; + +/** + * Static implementation of a fully-connected (dense) layer, + * optimized for in_size=1. + */ +template +class DenseT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_out_size = ceil_div(out_sizet, v_size); + +public: + static constexpr auto in_size = 1; + static constexpr auto out_size = out_sizet; + + DenseT() + { + for(int i = 0; i < v_out_size; ++i) + weights[i] = v_type((T)0.0); + + for(int i = 0; i < v_out_size; ++i) + bias[i] = v_type((T)0.0); + + for(int i = 0; i < v_out_size; ++i) + outs[i] = v_type((T)0.0); + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "dense"; } + + /** Returns false since dense is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Reset is a no-op, since Dense does not have state. */ + RTNEURAL_REALTIME void reset() { } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const v_type (&ins)[1]) noexcept + { + for(int i = 0; i < v_out_size; ++i) + outs[i] = bias[i]; + + const auto in = ins[0].get(0); + for(int i = 0; i < v_out_size; ++i) + outs[i] += in * weights[i]; + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights vector must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(const std::vector>& newWeights) + { + for(int i = 0; i < out_size; ++i) + weights[i / v_size] = set_value(weights[i / v_size], i % v_size, newWeights[i][0]); + } + + /** + * Sets the layer weights from a given vector. + * + * The dimension of the weights array must be + * weights[out_size][in_size] + */ + RTNEURAL_REALTIME void setWeights(T** newWeights) + { + for(int i = 0; i < out_size; ++i) + weights[i / v_size] = set_value(weights[i / v_size], i % v_size, newWeights[i][0]); + } + + /** + * Sets the layer bias from a given array of size + * bias[out_size] + */ + RTNEURAL_REALTIME void setBias(const T* b) + { + for(int i = 0; i < out_size; ++i) + bias[i / v_size] = set_value(bias[i / v_size], i % v_size, b[i]); + } + + v_type outs[v_out_size]; + +private: + v_type bias[v_out_size]; + v_type weights[v_out_size]; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // DENSEXSIMD_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru.h new file mode 100644 index 0000000..0e30040 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru.h @@ -0,0 +1,357 @@ +#ifndef GRU_H_INCLUDED +#define GRU_H_INCLUDED + +#include + +#if RTNEURAL_USE_EIGEN +#include "gru_eigen.h" +#include "gru_eigen.tpp" +#elif RTNEURAL_USE_XSIMD +#include "gru_xsimd.h" +#include "gru_xsimd.tpp" +#else +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include "../maths/maths_stl.h" +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a gated recurrent unit (GRU) layer + * with tanh activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's GRU implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class GRULayer final : public Layer +{ +public: + /** Constructs a GRU layer for a given input and output size. */ + GRULayer(int in_size, int out_size); + GRULayer(std::initializer_list sizes); + GRULayer(const GRULayer& other); + GRULayer& operator=(const GRULayer& other); + virtual ~GRULayer(); + + /** Resets the state of the GRU. */ + RTNEURAL_REALTIME void reset() override { std::fill(ht1, ht1 + Layer::out_size, (T)0); } + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "gru"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* h) noexcept override + { + for(int i = 0; i < Layer::out_size; ++i) + { + zVec[i] = MathsProvider::sigmoid(vMult(zWeights.W[i], input, Layer::in_size) + vMult(zWeights.U[i], ht1, Layer::out_size) + zWeights.b[0][i] + zWeights.b[1][i]); + rVec[i] = MathsProvider::sigmoid(vMult(rWeights.W[i], input, Layer::in_size) + vMult(rWeights.U[i], ht1, Layer::out_size) + rWeights.b[0][i] + rWeights.b[1][i]); + cVec[i] = MathsProvider::tanh(vMult(cWeights.W[i], input, Layer::in_size) + rVec[i] * (vMult(cWeights.U[i], ht1, Layer::out_size) + cWeights.b[1][i]) + cWeights.b[0][i]); + h[i] = ((T)1 - zVec[i]) * cVec[i] + zVec[i] * ht1[i]; + } + + std::copy(h, h + Layer::out_size, ht1); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][3 * out_size] + */ + RTNEURAL_REALTIME void setWVals(T** wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][3 * out_size] + */ + RTNEURAL_REALTIME void setUVals(T** uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[2][3 * out_size] + */ + RTNEURAL_REALTIME void setBVals(T** bVals); + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][3 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][3 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[2][3 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector>& bVals); + + /** Returns the kernel weight for the given indices. */ + RTNEURAL_REALTIME T getWVal(int i, int k) const noexcept; + + /** Returns the recurrent weight for the given indices. */ + RTNEURAL_REALTIME T getUVal(int i, int k) const noexcept; + + /** Returns the bias value for the given indices. */ + RTNEURAL_REALTIME T getBVal(int i, int k) const noexcept; + +protected: + T* ht1; + + /** Struct to hold layer weights (used internally) */ + struct WeightSet + { + WeightSet(int in_size, int out_size); + ~WeightSet(); + + T** W; // kernel weights + T** U; // recurrent weights + T** b; // bias + const int out_size; + }; + + WeightSet zWeights; + WeightSet rWeights; + WeightSet cWeights; + + T* zVec; + T* rVec; + T* cVec; + + static constexpr int kNumBiasLayers { 2 }; +}; + +//==================================================== +/** + * Static implementation of a gated recurrent unit (GRU) layer + * with tanh activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's GRU implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class GRULayerT +{ +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + + GRULayerT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "gru"; } + + /** Returns false since GRU is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Prepares the GRU to process with a given delay length. */ + template + std::enable_if_t + prepare(int delaySamples); + + /** Prepares the GRU to process with a given delay length. */ + template + std::enable_if_t + prepare(T delaySamples); + + /** Resets the state of the GRU. */ + RTNEURAL_REALTIME void reset(); + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if<(N > 1), void>::type + forward(const T (&ins)[in_size]) noexcept + { + // compute zt + recurrent_mat_mul(outs, Uz, zt); + kernel_mat_mul(ins, Wz, kernel_outs); + for(int i = 0; i < out_size; ++i) + zt[i] = MathsProvider::sigmoid(zt[i] + bz[i] + kernel_outs[i]); + + // compute rt + recurrent_mat_mul(outs, Ur, rt); + kernel_mat_mul(ins, Wr, kernel_outs); + for(int i = 0; i < out_size; ++i) + rt[i] = MathsProvider::sigmoid(rt[i] + br[i] + kernel_outs[i]); + + // compute h_hat + recurrent_mat_mul(outs, Uh, ct); + kernel_mat_mul(ins, Wh, kernel_outs); + for(int i = 0; i < out_size; ++i) + ht[i] = MathsProvider::tanh(rt[i] * (ct[i] + bh1[i]) + bh0[i] + kernel_outs[i]); + + computeOutput(); + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&ins)[in_size]) noexcept + { + // compute zt + recurrent_mat_mul(outs, Uz, zt); + for(int i = 0; i < out_size; ++i) + zt[i] = MathsProvider::sigmoid(zt[i] + bz[i] + (Wz_1[i] * ins[0])); + + // compute rt + recurrent_mat_mul(outs, Ur, rt); + for(int i = 0; i < out_size; ++i) + rt[i] = MathsProvider::sigmoid(rt[i] + br[i] + (Wr_1[i] * ins[0])); + + // compute h_hat + recurrent_mat_mul(outs, Uh, ct); + for(int i = 0; i < out_size; ++i) + ht[i] = MathsProvider::tanh(rt[i] * (ct[i] + bh1[i]) + bh0[i] + (Wh_1[i] * ins[0])); + + computeOutput(); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][3 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][3 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[2][3 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector>& bVals); + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + +private: + template + inline std::enable_if_t + computeOutput() noexcept + { + for(int i = 0; i < out_size; ++i) + outs[i] = ((T)1.0 - zt[i]) * ht[i] + zt[i] * outs[i]; + } + + template + inline std::enable_if_t + computeOutput() noexcept + { + for(int i = 0; i < out_size; ++i) + outs_delayed[delayWriteIdx][i] = ((T)1.0 - zt[i]) * ht[i] + zt[i] * outs[i]; + + processDelay(outs_delayed, outs, delayWriteIdx); + } + + template + inline std::enable_if_t + processDelay(std::vector>& delayVec, T (&out)[out_size], int delayWriteIndex) noexcept + { + for(int i = 0; i < out_size; ++i) + out[i] = delayVec[0][i]; + + for(int j = 0; j < delayWriteIndex; ++j) + { + for(int i = 0; i < out_size; ++i) + delayVec[j][i] = delayVec[j + 1][i]; + } + } + + template + inline std::enable_if_t + processDelay(std::vector>& delayVec, T (&out)[out_size], int delayWriteIndex) noexcept + { + for(int i = 0; i < out_size; ++i) + out[i] = delayPlus1Mult * delayVec[0][i] + delayMult * delayVec[1][i]; + + for(int j = 0; j < delayWriteIndex; ++j) + { + for(int i = 0; i < out_size; ++i) + delayVec[j][i] = delayVec[j + 1][i]; + } + } + + static inline void recurrent_mat_mul(const T (&vec)[out_size], const T (&mat)[out_size][out_size], T (&out)[out_size]) noexcept + { + for(int j = 0; j < out_size; ++j) + out[j] = std::inner_product(mat[j], mat[j] + out_size, vec, (T)0); + } + + static inline void kernel_mat_mul(const T (&vec)[in_size], const T (&mat)[out_size][in_size], T (&out)[out_size]) noexcept + { + for(int j = 0; j < out_size; ++j) + out[j] = std::inner_product(mat[j], mat[j] + in_size, vec, (T)0); + } + + // kernel weights + T Wr alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][in_size]; + T Wz alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][in_size]; + T Wh alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][in_size]; + T kernel_outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + // single-input kernel weights + T Wz_1 alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T Wr_1 alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T Wh_1 alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + // recurrent weights + T Uz alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][out_size]; + T Ur alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][out_size]; + T Uh alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][out_size]; + + // biases + T bz alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T br alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T bh0 alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T bh1 alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + // intermediate vars + T zt alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T rt alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T ct alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T ht alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + // needed for delays when doing sample rate correction + std::vector> outs_delayed; + int delayWriteIdx = 0; + T delayMult = (T)1; + T delayPlus1Mult = (T)0; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // RTNEURAL_USE_EIGEN + +#endif // GRU_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru.tpp new file mode 100644 index 0000000..1c3c76f --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru.tpp @@ -0,0 +1,364 @@ +#include "gru.h" + +namespace RTNEURAL_NAMESPACE +{ + +#if !RTNEURAL_USE_EIGEN && !RTNEURAL_USE_XSIMD +template +GRULayer::GRULayer(int in_size, int out_size) + : Layer(in_size, out_size) + , zWeights(in_size, out_size) + , rWeights(in_size, out_size) + , cWeights(in_size, out_size) +{ + ht1 = new T[out_size]; + zVec = new T[out_size]; + rVec = new T[out_size]; + cVec = new T[out_size]; +} + +template +GRULayer::GRULayer(std::initializer_list sizes) + : GRULayer(*sizes.begin(), *(sizes.begin() + 1)) +{ +} + +template +GRULayer::GRULayer(const GRULayer& other) + : GRULayer(other.in_size, other.out_size) +{ +} + +template +GRULayer& GRULayer::operator=(const GRULayer& other) +{ + if(&other != this) + *this = GRULayer(other); + return *this; +} + +template +GRULayer::~GRULayer() +{ + delete[] ht1; + delete[] zVec; + delete[] rVec; + delete[] cVec; +} + +template +GRULayer::WeightSet::WeightSet(int in_size, int out_size) + : out_size(out_size) +{ + W = new T*[out_size]; + U = new T*[out_size]; + b = new T*[kNumBiasLayers]; + + for(int i = 0; i < kNumBiasLayers; ++i) + { + b[i] = new T[out_size]; + } + + for(int i = 0; i < out_size; ++i) + { + W[i] = new T[in_size]; + U[i] = new T[out_size]; + } +} + +template +GRULayer::WeightSet::~WeightSet() +{ + for(int i = 0; i < kNumBiasLayers; ++i) + { + delete[] b[i]; + } + + for(int i = 0; i < out_size; ++i) + { + delete[] W[i]; + delete[] U[i]; + } + + delete[] b; + delete[] W; + delete[] U; +} + +template +void GRULayer::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < Layer::in_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.W[k][i] = wVals[i][k]; + rWeights.W[k][i] = wVals[i][k + Layer::out_size]; + cWeights.W[k][i] = wVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setWVals(T** wVals) +{ + for(int i = 0; i < Layer::in_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.W[k][i] = wVals[i][k]; + rWeights.W[k][i] = wVals[i][k + Layer::out_size]; + cWeights.W[k][i] = wVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.U[k][i] = uVals[i][k]; + rWeights.U[k][i] = uVals[i][k + Layer::out_size]; + cWeights.U[k][i] = uVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setUVals(T** uVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.U[k][i] = uVals[i][k]; + rWeights.U[k][i] = uVals[i][k + Layer::out_size]; + cWeights.U[k][i] = uVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setBVals(const std::vector>& bVals) +{ + for(int i = 0; i < 2; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.b[i][k] = bVals[i][k]; + rWeights.b[i][k] = bVals[i][k + Layer::out_size]; + cWeights.b[i][k] = bVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setBVals(T** bVals) +{ + for(int i = 0; i < 2; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.b[i][k] = bVals[i][k]; + rWeights.b[i][k] = bVals[i][k + Layer::out_size]; + cWeights.b[i][k] = bVals[i][k + Layer::out_size * 2]; + } + } +} + +template +T GRULayer::getWVal(int i, int k) const noexcept +{ + T** set = zWeights.W; + if(k > 2 * Layer::out_size) + { + k -= 2 * Layer::out_size; + set = cWeights.W; + } + else if(k > Layer::out_size) + { + k -= Layer::out_size; + set = rWeights.W; + } + + return set[i][k]; +} + +template +T GRULayer::getUVal(int i, int k) const noexcept +{ + T** set = zWeights.U; + if(k > 2 * Layer::out_size) + { + k -= 2 * Layer::out_size; + set = cWeights.U; + } + else if(k > Layer::out_size) + { + k -= Layer::out_size; + set = rWeights.U; + } + + return set[i][k]; +} + +template +T GRULayer::getBVal(int i, int k) const noexcept +{ + T** set = zWeights.b; + if(k > 2 * Layer::out_size) + { + k -= 2 * Layer::out_size; + set = cWeights.b; + } + else if(k > Layer::out_size) + { + k -= Layer::out_size; + set = rWeights.b; + } + + return set[i][k]; +} + +//==================================================== +template +GRULayerT::GRULayerT() +{ + for(int i = 0; i < out_size; ++i) + { + // single-input kernel weights + Wz_1[i] = (T)0; + Wr_1[i] = (T)0; + Wh_1[i] = (T)0; + + // biases + bz[i] = (T)0; + br[i] = (T)0; + bh0[i] = (T)0; + bh1[i] = (T)0; + + // intermediate vars + zt[i] = (T)0; + rt[i] = (T)0; + ct[i] = (T)0; + ht[i] = (T)0; + } + + for(int i = 0; i < out_size; ++i) + { + // recurrent weights + for(int k = 0; k < out_size; ++k) + { + Uz[i][k] = (T)0; + Ur[i][k] = (T)0; + Uh[i][k] = (T)0; + } + + // kernel weights + for(int k = 0; k < in_size; ++k) + { + Wz[i][k] = (T)0; + Wr[i][k] = (T)0; + Wh[i][k] = (T)0; + } + } + + reset(); +} + +template +template +std::enable_if_t +GRULayerT::prepare(int delaySamples) +{ + delayWriteIdx = delaySamples - 1; + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +template +std::enable_if_t +GRULayerT::prepare(T delaySamples) +{ + const auto delayOffFactor = delaySamples - std::floor(delaySamples); + delayMult = (T)1 - delayOffFactor; + delayPlus1Mult = delayOffFactor; + + delayWriteIdx = (int)std::ceil(delaySamples) - (int)std::ceil(delayOffFactor); + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +void GRULayerT::reset() +{ + if(sampleRateCorr != SampleRateCorrectionMode::None) + { + for(auto& vec : outs_delayed) + std::fill(vec.begin(), vec.end(), T {}); + } + + // reset output state + for(int i = 0; i < out_size; ++i) + outs[i] = (T)0; +} + +// kernel weights +template +void GRULayerT::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < in_size; ++i) + { + for(int j = 0; j < out_size; ++j) + { + Wz[j][i] = wVals[i][j]; + Wr[j][i] = wVals[i][j + out_size]; + Wh[j][i] = wVals[i][j + 2 * out_size]; + } + } + + for(int j = 0; j < out_size; ++j) + { + Wz_1[j] = wVals[0][j]; + Wr_1[j] = wVals[0][j + out_size]; + Wh_1[j] = wVals[0][j + 2 * out_size]; + } +} + +// recurrent weights +template +void GRULayerT::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < out_size; ++i) + { + for(int j = 0; j < out_size; ++j) + { + Uz[j][i] = uVals[i][j]; + Ur[j][i] = uVals[i][j + out_size]; + Uh[j][i] = uVals[i][j + 2 * out_size]; + } + } +} + +// biases +template +void GRULayerT::setBVals(const std::vector>& bVals) +{ + for(int k = 0; k < out_size; ++k) + { + bz[k] = bVals[0][k] + bVals[1][k]; + br[k] = bVals[0][k + out_size] + bVals[1][k + out_size]; + bh0[k] = bVals[0][k + 2 * out_size]; + bh1[k] = bVals[1][k + 2 * out_size]; + } +} + +#endif // !RTNEURAL_USE_EIGEN && !RTNEURAL_USE_XSIMD + +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_eigen.h new file mode 100644 index 0000000..c83acd1 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_eigen.h @@ -0,0 +1,346 @@ +#ifndef GRUEIGEN_H_INCLUDED +#define GRUEIGEN_H_INCLUDED + +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include "../maths/maths_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a gated recurrent unit (GRU) layer + * with tanh activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's GRU implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class GRULayer : public Layer +{ +public: + /** Constructs a GRU layer for a given input and output size. */ + GRULayer(int in_size, int out_size); + GRULayer(std::initializer_list sizes); + GRULayer(const GRULayer& other); + GRULayer& operator=(const GRULayer& other); + virtual ~GRULayer() = default; + + /** Resets the state of the GRU. */ + RTNEURAL_REALTIME void reset() override + { + extendedHt1.setZero(); + extendedHt1(Layer::out_size) = (T)1; + } + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "gru"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* h) noexcept override + { + for(int i = 0; i < Layer::in_size; ++i) + { + extendedInVec(i) = input[i]; + } + + /** + * | Wz bz[0] | | input | | Wz * input + bz[0] | + * alpha = | Wr br[0] | * | 1 | = | Wr * input + br[0] | + * | Wc bc[0] | | Wc * input + bc[0] | + * + * | Uz bz[1] | | h(t-1) | | Uz * h(t-1) + bz[1] | + * beta = | Ur br[1] | * | 1 | = | Ur * h(t-1) + br[1] | + * | Uc bc[1] | | Uc * h(t-1) + bc[1] | + */ + alphaVec.noalias() = wCombinedWeights * extendedInVec; + betaVec.noalias() = uCombinedWeights * extendedHt1; + + /** + * gamma = sigmoid( | z | = sigmoid(alpha[0 : 2*out_sizet] + beta[0 : 2*out_sizet]) + * | r | ) + */ + gammaVec.noalias() = alphaVec.segment(0, 2 * Layer::out_size) + betaVec.segment(0, 2 * Layer::out_size); + gammaVec = MathsProvider::sigmoid(gammaVec); + + /** + * c = tanh( alpha[2*out_sizet : 3*out_sizet] + r.cwiseProduct(beta[2*out_sizet : 3*out_sizet] ) + * i.e. c = tanh( Wc * input + bc[0] + r.cwiseProduct(Uc * h(t-1) + bc[1]) ) + */ + cVec.noalias() = alphaVec.segment(2 * Layer::out_size, Layer::out_size) + gammaVec.segment(Layer::out_size, Layer::out_size).cwiseProduct(betaVec.segment(2 * Layer::out_size, Layer::out_size)); + cVec = MathsProvider::tanh(cVec); + + /** + * h(t-1) = (1 - z).cwiseProduct(c) + z.cwiseProduct(h(t-1)) + * = c - z.cwiseProduct(c) + z.cwiseProduct(ht(t-1)) + * = c + z.cwiseProduct(h(t-1) - c) + */ + extendedHt1.segment(0, Layer::out_size) = cVec + gammaVec.segment(0, Layer::out_size).cwiseProduct(extendedHt1.segment(0, Layer::out_size) - cVec); + + for(int i = 0; i < Layer::out_size; ++i) + { + h[i] = extendedHt1(i); + } + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][3 * out_size] + */ + RTNEURAL_REALTIME void setWVals(T** wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][3 * out_size] + */ + RTNEURAL_REALTIME void setUVals(T** uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[2][3 * out_size] + */ + RTNEURAL_REALTIME void setBVals(T** bVals); + + /** Returns the kernel weight for the given indices. */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** Returns the recurrent weight for the given indices. */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** Returns the bias value for the given indices. */ + RTNEURAL_REALTIME void setBVals(const std::vector>& bVals); + + RTNEURAL_REALTIME T getWVal(int i, int k) const noexcept; + RTNEURAL_REALTIME T getUVal(int i, int k) const noexcept; + RTNEURAL_REALTIME T getBVal(int i, int k) const noexcept; + +private: + // Kernels + // | Wz bz0 | + // | Wr br0 | + // | Wc bc0 | + Eigen::Matrix wCombinedWeights; + + // | Uz bz1 | + // | Ur br1 | + // | Uc bc1 | + Eigen::Matrix uCombinedWeights; + + // Input vec + Eigen::Matrix extendedInVec; + + // h(t-1) vec + Eigen::Matrix extendedHt1; + + // Scratch memory + Eigen::Matrix alphaVec; + Eigen::Matrix betaVec; + Eigen::Matrix gammaVec; + Eigen::Matrix cVec; +}; + +//==================================================== +/** + * Static implementation of a gated recurrent unit (GRU) layer + * with tanh activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's GRU implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class GRULayerT +{ + using in_type = Eigen::Matrix; + using extended_in_type = Eigen::Matrix; + using out_type = Eigen::Matrix; + using extended_out_type = Eigen::Matrix; + + using w_k_type = Eigen::Matrix; + using u_k_type = Eigen::Matrix; + + using three_out_type = Eigen::Matrix; + using two_out_type = Eigen::Matrix; + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + + GRULayerT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "gru"; } + + /** Returns false since GRU is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Prepares the GRU to process with a given delay length. */ + template + std::enable_if_t + prepare(int delaySamples); + + /** Prepares the GRU to process with a given delay length. */ + template + std::enable_if_t + prepare(T delaySamples); + + /** Resets the state of the GRU. */ + RTNEURAL_REALTIME void reset(); + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const in_type& ins) noexcept + { + for(int i = 0; i < in_sizet; ++i) + { + extendedInVec(i) = ins(i); + } + + /** + * | Wz bz[0] | | input | | Wz * input + bz[0] | + * alpha = | Wr br[0] | * | 1 | = | Wr * input + br[0] | + * | Wc bc[0] | | Wc * input + bc[0] | + * + * | Uz bz[1] | | h(t-1) | | Uz * h(t-1) + bz[1] | + * beta = | Ur br[1] | * | 1 | = | Ur * h(t-1) + br[1] | + * | Uc bc[1] | | Uc * h(t-1) + bc[1] | + */ + alphaVec.noalias() = wCombinedWeights * extendedInVec; + betaVec.noalias() = uCombinedWeights * extendedHt1; + + /** + * gamma = sigmoid( | z | = sigmoid(alpha[0 : 2*out_sizet] + beta[0 : 2*out_sizet]) + * | r | ) + */ + gammaVec = MathsProvider::sigmoid(alphaVec.segment(0, 2 * out_sizet) + betaVec.segment(0, 2 * out_sizet)); + + /** + * c = tanh( alpha[2*out_sizet : 3*out_sizet] + r.cwiseProduct(beta[2*out_sizet : 3*out_sizet] ) + * i.e. c = tanh( Wc * input + bc[0] + r.cwiseProduct(Uc * h(t-1) + bc[1]) ) + */ + cVec.noalias() = alphaVec.segment(2 * out_sizet, out_sizet) + gammaVec.segment(out_sizet, out_sizet).cwiseProduct(betaVec.segment(2 * out_sizet, out_sizet)); + cVec = MathsProvider::tanh(cVec); + + /** + * h(t-1) = (1 - z).cwiseProduct(c) + z.cwiseProduct(h(t-1)) + * = c - z.cwiseProduct(c) + z.cwiseProduct(ht(t-1)) + * = c + z.cwiseProduct(h(t-1) - c) + */ + extendedHt1.segment(0, out_sizet) = cVec + gammaVec.segment(0, out_sizet).cwiseProduct(extendedHt1.segment(0, out_sizet) - cVec); + + computeOutput(); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][3 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][3 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[2][3 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector>& bVals); + + Eigen::Map outs; + +private: + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + template + inline std::enable_if_t + computeOutput() noexcept + { + for(int i = 0; i < out_sizet; ++i) + { + outs(i) = extendedHt1(i); + } + } + + template + inline std::enable_if_t + computeOutput() noexcept + { + for(int i = 0; i < out_sizet; ++i) + { + outs_delayed[delayWriteIdx][i] = extendedHt1(i); + } + + processDelay(outs_delayed, outs, delayWriteIdx); + + for(int i = 0; i < out_sizet; ++i) + { + extendedHt1(i) = outs(i); + } + } + + template + inline std::enable_if_t + processDelay(std::vector& delayVec, OutVec& out, int delayWriteIndex) noexcept + { + out = delayVec[0]; + + for(int j = 0; j < delayWriteIndex; ++j) + delayVec[j] = delayVec[j + 1]; + } + + template + inline std::enable_if_t + processDelay(std::vector& delayVec, OutVec& out, int delayWriteIndex) noexcept + { + out = delayPlus1Mult * delayVec[0] + delayMult * delayVec[1]; + + for(int j = 0; j < delayWriteIndex; ++j) + delayVec[j] = delayVec[j + 1]; + } + + // kernel weights + w_k_type wCombinedWeights; + u_k_type uCombinedWeights; + + // scratch memory + three_out_type alphaVec; + three_out_type betaVec; + two_out_type gammaVec; + + // input, output, memory + out_type cVec; + extended_in_type extendedInVec; + extended_out_type extendedHt1; + + // needed for delays when doing sample rate correction + std::vector outs_delayed; + int delayWriteIdx = 0; + T delayMult = (T)1; + T delayPlus1Mult = (T)0; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // GRUEIGEN_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_eigen.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_eigen.tpp new file mode 100644 index 0000000..ab07b8e --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_eigen.tpp @@ -0,0 +1,240 @@ +#if RTNEURAL_USE_EIGEN + +#include "gru_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ + +template +GRULayer::GRULayer(int in_size, int out_size) + : Layer(in_size, out_size) +{ + wCombinedWeights = Eigen::Matrix::Zero(3 * out_size, in_size + 1); + uCombinedWeights = Eigen::Matrix::Zero(3 * out_size, out_size + 1); + extendedInVec = Eigen::Matrix::Zero(in_size + 1); + extendedHt1 = Eigen::Matrix::Zero(out_size + 1); + extendedInVec(Layer::in_size) = (T)1; + extendedHt1(Layer::out_size) = (T)1; + + alphaVec = Eigen::Matrix::Zero(3 * out_size); + betaVec = Eigen::Matrix::Zero(3 * out_size); + gammaVec = Eigen::Matrix::Zero(2 * out_size); + cVec = Eigen::Matrix::Zero(out_size); +} + +template +GRULayer::GRULayer(std::initializer_list sizes) + : GRULayer(*sizes.begin(), *(sizes.begin() + 1)) +{ +} + +template +GRULayer::GRULayer(const GRULayer& other) + : GRULayer(other.in_size, other.out_size) +{ +} + +template +GRULayer& GRULayer::operator=(const GRULayer& other) +{ + return *this = GRULayer(other); +} + +template +void GRULayer::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < Layer::in_size; ++i) + { + for(int k = 0; k < Layer::out_size * 3; ++k) + { + wCombinedWeights(k, i) = wVals[i][k]; + } + } +} + +template +void GRULayer::setWVals(T** wVals) +{ + for(int i = 0; i < Layer::in_size; ++i) + { + for(int k = 0; k < Layer::out_size * 3; ++k) + { + wCombinedWeights(k, i) = wVals[i][k]; + } + } +} + +template +void GRULayer::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < Layer::out_size * 3; ++k) + { + uCombinedWeights(k, i) = uVals[i][k]; + } + } +} + +template +void GRULayer::setUVals(T** uVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < Layer::out_size * 3; ++k) + { + uCombinedWeights(k, i) = uVals[i][k]; + } + } +} + +template +void GRULayer::setBVals(const std::vector>& bVals) +{ + for(int k = 0; k < Layer::out_size * 3; ++k) + { + wCombinedWeights(k, Layer::in_size) = bVals[0][k]; + uCombinedWeights(k, Layer::out_size) = bVals[1][k]; + } +} + +template +void GRULayer::setBVals(T** bVals) +{ + for(int k = 0; k < Layer::out_size * 3; ++k) + { + wCombinedWeights(k, Layer::in_size) = bVals[0][k]; + uCombinedWeights(k, Layer::out_size) = bVals[1][k]; + } +} + +template +T GRULayer::getWVal(int i, int k) const noexcept +{ + return wCombinedWeights[k][i]; +} + +template +T GRULayer::getUVal(int i, int k) const noexcept +{ + return uCombinedWeights[k][i]; +} + +template +T GRULayer::getBVal(int i, int k) const noexcept +{ + T val; + if(i == 0) + { + val = wCombinedWeights[k][Layer::in_size]; + } + else + { + val = uCombinedWeights[k][Layer::out_size]; + } + return val; +} + +//==================================================== +template +GRULayerT::GRULayerT() + : outs(outs_internal) +{ + wCombinedWeights = w_k_type::Zero(); + uCombinedWeights = u_k_type::Zero(); + alphaVec = three_out_type::Zero(); + betaVec = three_out_type::Zero(); + gammaVec = two_out_type::Zero(); + cVec = out_type::Zero(); + extendedInVec = extended_in_type::Zero(); + extendedHt1 = extended_out_type::Zero(); + + extendedInVec(in_sizet) = (T)1; + extendedHt1(out_sizet) = (T)1; + + reset(); +} + +template +template +std::enable_if_t +GRULayerT::prepare(int delaySamples) +{ + delayWriteIdx = delaySamples - 1; + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +template +std::enable_if_t +GRULayerT::prepare(T delaySamples) +{ + const auto delayOffFactor = delaySamples - std::floor(delaySamples); + delayMult = (T)1 - delayOffFactor; + delayPlus1Mult = delayOffFactor; + + delayWriteIdx = (int)std::ceil(delaySamples) - (int)std::ceil(delayOffFactor); + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +void GRULayerT::reset() +{ + if(sampleRateCorr != SampleRateCorrectionMode::None) + { + for(auto& vec : outs_delayed) + vec = out_type::Zero(); + } + + // reset output state + outs = out_type::Zero(); + + // reset extended internal state + extendedHt1.setZero(); + extendedHt1(out_sizet) = (T)1; +} + +// kernel weights +template +void GRULayerT::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < in_size; ++i) + { + for(int k = 0; k < out_size * 3; ++k) + { + wCombinedWeights(k, i) = wVals[i][k]; + } + } +} + +// recurrent weights +template +void GRULayerT::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < out_size * 3; ++k) + { + uCombinedWeights(k, i) = uVals[i][k]; + } + } +} + +// biases +template +void GRULayerT::setBVals(const std::vector>& bVals) +{ + for(int k = 0; k < out_size * 3; ++k) + { + wCombinedWeights(k, in_sizet) = bVals[0][k]; + uCombinedWeights(k, out_sizet) = bVals[1][k]; + } +} + +} // namespace RTNEURAL_NAMESPACE + +#endif // RTNEURAL_USE_EIGEN diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_xsimd.h new file mode 100644 index 0000000..212baed --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_xsimd.h @@ -0,0 +1,396 @@ +#ifndef GRUXSIMD_H_INCLUDED +#define GRUXSIMD_H_INCLUDED + +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include "../maths/maths_xsimd.h" +#include +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a gated recurrent unit (GRU) layer + * with tanh activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's GRU implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class GRULayer : public Layer +{ +public: + /** Constructs a GRU layer for a given input and output size. */ + GRULayer(int in_size, int out_size); + GRULayer(std::initializer_list sizes); + GRULayer(const GRULayer& other); + GRULayer& operator=(const GRULayer& other); + virtual ~GRULayer(); + + /** Resets the state of the GRU. */ + RTNEURAL_REALTIME void reset() override { std::fill(ht1.begin(), ht1.end(), (T)0); } + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "gru"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* h) noexcept override + { + for(int i = 0; i < Layer::out_size; ++i) + { + zVec[i] = vMult(zWeights.W[i].data(), input, prod_in.data(), Layer::in_size) + vMult(zWeights.U[i].data(), ht1.data(), prod_out.data(), Layer::out_size); + rVec[i] = vMult(rWeights.W[i].data(), input, prod_in.data(), Layer::in_size) + vMult(rWeights.U[i].data(), ht1.data(), prod_out.data(), Layer::out_size); + cVec[i] = vMult(cWeights.W[i].data(), input, prod_in.data(), Layer::in_size); + cTmp[i] = vMult(cWeights.U[i].data(), ht1.data(), prod_out.data(), Layer::out_size); + } + + vAdd(zVec.data(), zWeights.b[0].data(), zVec.data(), Layer::out_size); + vAdd(zVec.data(), zWeights.b[1].data(), zVec.data(), Layer::out_size); + sigmoid(zVec.data(), zVec.data(), Layer::out_size); + + vAdd(rVec.data(), rWeights.b[0].data(), rVec.data(), Layer::out_size); + vAdd(rVec.data(), rWeights.b[1].data(), rVec.data(), Layer::out_size); + sigmoid(rVec.data(), rVec.data(), Layer::out_size); + + vAdd(cTmp.data(), cWeights.b[1].data(), cTmp.data(), Layer::out_size); + vProd(cTmp.data(), rVec.data(), cTmp.data(), Layer::out_size); + vAdd(cTmp.data(), cVec.data(), cVec.data(), Layer::out_size); + vAdd(cVec.data(), cWeights.b[0].data(), cVec.data(), Layer::out_size); + tanh(cVec.data(), cVec.data(), Layer::out_size); + + vSub(ones.data(), zVec.data(), h, Layer::out_size); + vProd(h, cVec.data(), h, Layer::out_size); + vProd(zVec.data(), ht1.data(), prod_out.data(), Layer::out_size); + vAdd(h, prod_out.data(), h, Layer::out_size); + + vCopy(h, ht1.data(), Layer::out_size); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][3 * out_size] + */ + RTNEURAL_REALTIME void setWVals(T** wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][3 * out_size] + */ + RTNEURAL_REALTIME void setUVals(T** uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[2][3 * out_size] + */ + RTNEURAL_REALTIME void setBVals(T** bVals); + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][3 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][3 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[2][3 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector>& bVals); + + /** Returns the kernel weight for the given indices. */ + RTNEURAL_REALTIME T getWVal(int i, int k) const noexcept; + + /** Returns the recurrent weight for the given indices. */ + RTNEURAL_REALTIME T getUVal(int i, int k) const noexcept; + + /** Returns the bias value for the given indices. */ + RTNEURAL_REALTIME T getBVal(int i, int k) const noexcept; + +protected: + using vec_type = std::vector>; + using vec2_type = std::vector; + + vec_type ht1; + + struct WeightSet + { + WeightSet(int in_size, int out_size); + ~WeightSet(); + + vec2_type W; // kernel weights + vec2_type U; // recurrent weights + vec_type b[2]; // bias + const int out_size; + }; + + WeightSet zWeights; + WeightSet rWeights; + WeightSet cWeights; + + vec_type zVec; + vec_type rVec; + vec_type cVec; + vec_type cTmp; + + vec_type prod_in; + vec_type prod_out; + vec_type ones; +}; + +//==================================================== +/** + * Static implementation of a gated recurrent unit (GRU) layer + * with tanh activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's GRU implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class GRULayerT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_in_size = ceil_div(in_sizet, v_size); + static constexpr auto v_out_size = ceil_div(out_sizet, v_size); + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + + GRULayerT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "gru"; } + + /** Returns false since GRU is not an activation layer. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Prepares the GRU to process with a given delay length. */ + template + std::enable_if_t + prepare(int delaySamples); + + /** Prepares the GRU to process with a given delay length. */ + template + std::enable_if_t + prepare(T delaySamples); + + /** Resets the state of the GRU. */ + RTNEURAL_REALTIME void reset(); + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if<(N > 1), void>::type + forward(const v_type (&ins)[v_in_size]) noexcept + { + // compute zt + recurrent_mat_mul(outs, Uz, zt); + kernel_mat_mul(ins, Wz, kernel_outs); + for(int i = 0; i < v_out_size; ++i) + zt[i] = MathsProvider::sigmoid(zt[i] + bz[i] + kernel_outs[i]); + + // compute rt + recurrent_mat_mul(outs, Ur, rt); + kernel_mat_mul(ins, Wr, kernel_outs); + for(int i = 0; i < v_out_size; ++i) + rt[i] = MathsProvider::sigmoid(rt[i] + br[i] + kernel_outs[i]); + + // compute h_hat + recurrent_mat_mul(outs, Uh, ct); + kernel_mat_mul(ins, Wh, kernel_outs); + for(int i = 0; i < v_out_size; ++i) + ht[i] = MathsProvider::tanh(xsimd::fma(rt[i], ct[i] + bh1[i], bh0[i] + kernel_outs[i])); + + computeOutput(); + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&ins)[v_in_size]) noexcept + { + // compute zt + recurrent_mat_mul(outs, Uz, zt); + for(int i = 0; i < v_out_size; ++i) + zt[i] = MathsProvider::sigmoid(xsimd::fma(Wz_1[i], ins[0], zt[i] + bz[i])); + + // compute rt + recurrent_mat_mul(outs, Ur, rt); + for(int i = 0; i < v_out_size; ++i) + rt[i] = MathsProvider::sigmoid(xsimd::fma(Wr_1[i], ins[0], rt[i] + br[i])); + + // compute h_hat + recurrent_mat_mul(outs, Uh, ct); + for(int i = 0; i < v_out_size; ++i) + ht[i] = MathsProvider::tanh(xsimd::fma(rt[i], ct[i] + bh1[i], xsimd::fma(Wh_1[i], ins[0], bh0[i]))); + + computeOutput(); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][3 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][3 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[2][3 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector>& bVals); + + v_type outs[v_out_size]; + +private: + template + inline std::enable_if_t + computeOutput() noexcept + { + for(int i = 0; i < v_out_size; ++i) + outs[i] = xsimd::fma((v_type((T)1.0) - zt[i]), ht[i], zt[i] * outs[i]); + } + + template + inline std::enable_if_t + computeOutput() noexcept + { + for(int i = 0; i < v_out_size; ++i) + outs_delayed[delayWriteIdx][i] = xsimd::fma((v_type((T)1.0) - zt[i]), ht[i], zt[i] * outs[i]); + + processDelay(outs_delayed, outs, delayWriteIdx); + } + + template + inline std::enable_if_t + processDelay(std::vector>& delayVec, v_type (&out)[v_out_size], int delayWriteIndex) noexcept + { + for(int i = 0; i < v_out_size; ++i) + out[i] = delayVec[0][i]; + + for(int j = 0; j < delayWriteIndex; ++j) + { + for(int i = 0; i < v_out_size; ++i) + delayVec[j][i] = delayVec[j + 1][i]; + } + } + + template + inline std::enable_if_t + processDelay(std::vector>& delayVec, v_type (&out)[v_out_size], int delayWriteIndex) noexcept + { + for(int i = 0; i < v_out_size; ++i) + out[i] = delayPlus1Mult * delayVec[0][i] + delayMult * delayVec[1][i]; + + for(int j = 0; j < delayWriteIndex; ++j) + { + for(int i = 0; i < v_out_size; ++i) + delayVec[j][i] = delayVec[j + 1][i]; + } + } + + static inline void recurrent_mat_mul(const v_type (&vec)[v_out_size], const v_type (&mat)[out_size][v_out_size], v_type (&out)[v_out_size]) noexcept + { + for(int i = 0; i < v_out_size; ++i) + out[i] = v_type(0); + + T scalar_in alignas(RTNEURAL_DEFAULT_ALIGNMENT)[v_size] { (T)0 }; + for(int k = 0; k < v_out_size; ++k) + { + vec[k].store_aligned(scalar_in); + for(int i = 0; i < v_out_size; ++i) + { + for(int j = 0; j < v_size; ++j) + out[i] += scalar_in[j] * mat[k * v_size + j][i]; + } + } + } + + static inline void kernel_mat_mul(const v_type (&vec)[v_in_size], const v_type (&mat)[in_size][v_out_size], v_type (&out)[v_out_size]) noexcept + { + for(int i = 0; i < v_out_size; ++i) + out[i] = v_type(0); + + T scalar_in alignas(RTNEURAL_DEFAULT_ALIGNMENT)[v_size] { (T)0 }; + for(int k = 0; k < v_in_size; ++k) + { + vec[k].store_aligned(scalar_in); + for(int i = 0; i < v_out_size; ++i) + { + for(int j = 0; j < v_size; ++j) + out[i] += scalar_in[j] * mat[k * v_size + j][i]; + } + } + } + + // kernel weights + v_type Wz[in_size][v_out_size]; + v_type Wr[in_size][v_out_size]; + v_type Wh[in_size][v_out_size]; + v_type kernel_outs[v_out_size]; + + // single-input kernel weights + v_type Wz_1[v_out_size]; + v_type Wr_1[v_out_size]; + v_type Wh_1[v_out_size]; + + // recurrent weights + v_type Uz[out_size][v_out_size]; + v_type Ur[out_size][v_out_size]; + v_type Uh[out_size][v_out_size]; + + // biases + v_type bz[v_out_size]; + v_type br[v_out_size]; + v_type bh0[v_out_size]; + v_type bh1[v_out_size]; + + // intermediate vars + v_type zt[v_out_size]; + v_type rt[v_out_size]; + v_type ct[v_out_size]; + v_type ht[v_out_size]; + + // needed for delays when doing sample rate correction + std::vector> outs_delayed; + int delayWriteIdx = 0; + v_type delayMult = (T)1; + v_type delayPlus1Mult = (T)0; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // GRUXSIMD_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_xsimd.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_xsimd.tpp new file mode 100644 index 0000000..2c797f3 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/gru/gru_xsimd.tpp @@ -0,0 +1,337 @@ +#include "gru_xsimd.h" + +namespace RTNEURAL_NAMESPACE +{ + +template +GRULayer::GRULayer(int in_size, int out_size) + : Layer(in_size, out_size) + , zWeights(in_size, out_size) + , rWeights(in_size, out_size) + , cWeights(in_size, out_size) +{ + ht1.resize(out_size, (T)0); + zVec.resize(out_size, (T)0); + rVec.resize(out_size, (T)0); + cVec.resize(out_size, (T)0); + cTmp.resize(out_size, (T)0); + + prod_in.resize(in_size, (T)0); + prod_out.resize(out_size, (T)0); + + ones.resize(out_size, (T)1); +} + +template +GRULayer::GRULayer(std::initializer_list sizes) + : GRULayer(*sizes.begin(), *(sizes.begin() + 1)) +{ +} + +template +GRULayer::GRULayer(const GRULayer& other) + : GRULayer(other.in_size, other.out_size) +{ +} + +template +GRULayer& GRULayer::operator=(const GRULayer& other) +{ + return *this = GRULayer(other); +} + +template +GRULayer::~GRULayer() = default; + +template +GRULayer::WeightSet::WeightSet(int in_size, int out_size) + : out_size(out_size) +{ + W = vec2_type(out_size, vec_type(in_size, (T)0)); + U = vec2_type(out_size, vec_type(out_size, (T)0)); + + b[0].resize(out_size, (T)0); + b[1].resize(out_size, (T)0); +} + +template +GRULayer::WeightSet::~WeightSet() = default; + +template +void GRULayer::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < Layer::in_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.W[k][i] = wVals[i][k]; + rWeights.W[k][i] = wVals[i][k + Layer::out_size]; + cWeights.W[k][i] = wVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setWVals(T** wVals) +{ + for(int i = 0; i < Layer::in_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.W[k][i] = wVals[i][k]; + rWeights.W[k][i] = wVals[i][k + Layer::out_size]; + cWeights.W[k][i] = wVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.U[k][i] = uVals[i][k]; + rWeights.U[k][i] = uVals[i][k + Layer::out_size]; + cWeights.U[k][i] = uVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setUVals(T** uVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.U[k][i] = uVals[i][k]; + rWeights.U[k][i] = uVals[i][k + Layer::out_size]; + cWeights.U[k][i] = uVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setBVals(const std::vector>& bVals) +{ + for(int i = 0; i < 2; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.b[i][k] = bVals[i][k]; + rWeights.b[i][k] = bVals[i][k + Layer::out_size]; + cWeights.b[i][k] = bVals[i][k + Layer::out_size * 2]; + } + } +} + +template +void GRULayer::setBVals(T** bVals) +{ + for(int i = 0; i < 2; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + zWeights.b[i][k] = bVals[i][k]; + rWeights.b[i][k] = bVals[i][k + Layer::out_size]; + cWeights.b[i][k] = bVals[i][k + Layer::out_size * 2]; + } + } +} + +template +T GRULayer::getWVal(int i, int k) const noexcept +{ + T** set = zWeights.W; + if(k > 2 * Layer::out_size) + { + k -= 2 * Layer::out_size; + set = cWeights.W; + } + else if(k > Layer::out_size) + { + k -= Layer::out_size; + set = rWeights.W; + } + + return set[i][k]; +} + +template +T GRULayer::getUVal(int i, int k) const noexcept +{ + T** set = zWeights.U; + if(k > 2 * Layer::out_size) + { + k -= 2 * Layer::out_size; + set = cWeights.U; + } + else if(k > Layer::out_size) + { + k -= Layer::out_size; + set = rWeights.U; + } + + return set[i][k]; +} + +template +T GRULayer::getBVal(int i, int k) const noexcept +{ + T** set = zWeights.b; + if(k > 2 * Layer::out_size) + { + k -= 2 * Layer::out_size; + set = cWeights.b; + } + else if(k > Layer::out_size) + { + k -= Layer::out_size; + set = rWeights.b; + } + + return set[i][k]; +} + +//==================================================== +template +GRULayerT::GRULayerT() +{ + for(int i = 0; i < v_out_size; ++i) + { + // single-input kernel weights + Wz_1[i] = v_type((T)0); + Wr_1[i] = v_type((T)0); + Wh_1[i] = v_type((T)0); + + // biases + bz[i] = v_type((T)0); + br[i] = v_type((T)0); + bh0[i] = v_type((T)0); + bh1[i] = v_type((T)0); + + // intermediate vars + zt[i] = v_type((T)0); + rt[i] = v_type((T)0); + ct[i] = v_type((T)0); + ht[i] = v_type((T)0); + } + + // kernel weights + for(int k = 0; k < in_size; ++k) + { + for(int i = 0; i < v_out_size; ++i) + { + Wz[k][i] = v_type((T)0); + Wr[k][i] = v_type((T)0); + Wh[k][i] = v_type((T)0); + } + } + + // recurrent weights + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < v_out_size; ++k) + { + Uz[i][k] = v_type((T)0); + Ur[i][k] = v_type((T)0); + Uh[i][k] = v_type((T)0); + } + } + + reset(); +} + +template +template +std::enable_if_t +GRULayerT::prepare(int delaySamples) +{ + delayWriteIdx = delaySamples - 1; + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +template +std::enable_if_t +GRULayerT::prepare(T delaySamples) +{ + const auto delayOffFactor = delaySamples - std::floor(delaySamples); + delayMult = (T)1 - delayOffFactor; + delayPlus1Mult = delayOffFactor; + + delayWriteIdx = (int)std::ceil(delaySamples) - (int)std::ceil(delayOffFactor); + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +void GRULayerT::reset() +{ + if(sampleRateCorr != SampleRateCorrectionMode::None) + { + for(auto& vec : outs_delayed) + std::fill(vec.begin(), vec.end(), v_type {}); + } + + // reset output state + for(int i = 0; i < v_out_size; ++i) + outs[i] = v_type((T)0); +} + +// kernel weights +template +void GRULayerT::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < in_size; ++k) + { + Wz[k][i / v_size] = set_value(Wz[k][i / v_size], i % v_size, wVals[k][i]); + Wr[k][i / v_size] = set_value(Wr[k][i / v_size], i % v_size, wVals[k][i + out_size]); + Wh[k][i / v_size] = set_value(Wh[k][i / v_size], i % v_size, wVals[k][i + 2 * out_size]); + } + } + + for(int j = 0; j < out_size; ++j) + { + Wz_1[j / v_size] = set_value(Wz_1[j / v_size], j % v_size, wVals[0][j]); + Wr_1[j / v_size] = set_value(Wr_1[j / v_size], j % v_size, wVals[0][j + out_size]); + Wh_1[j / v_size] = set_value(Wh_1[j / v_size], j % v_size, wVals[0][j + 2 * out_size]); + } +} + +// recurrent weights +template +void GRULayerT::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < out_size; ++k) + { + Uz[k][i / v_size] = set_value(Uz[k][i / v_size], i % v_size, uVals[k][i]); + Ur[k][i / v_size] = set_value(Ur[k][i / v_size], i % v_size, uVals[k][i + out_size]); + Uh[k][i / v_size] = set_value(Uh[k][i / v_size], i % v_size, uVals[k][i + 2 * out_size]); + } + } +} + +// biases +template +void GRULayerT::setBVals(const std::vector>& bVals) +{ + for(int k = 0; k < out_size; ++k) + { + bz[k / v_size] = set_value(bz[k / v_size], k % v_size, bVals[0][k] + bVals[1][k]); + br[k / v_size] = set_value(br[k / v_size], k % v_size, bVals[0][k + out_size] + bVals[1][k + out_size]); + bh0[k / v_size] = set_value(bh0[k / v_size], k % v_size, bVals[0][k + 2 * out_size]); + bh1[k / v_size] = set_value(bh1[k / v_size], k % v_size, bVals[1][k + 2 * out_size]); + } +} + +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm.h new file mode 100644 index 0000000..3d6cab4 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm.h @@ -0,0 +1,363 @@ +#ifndef LSTM_H_INCLUDED +#define LSTM_H_INCLUDED + +#if RTNEURAL_USE_EIGEN +#include "lstm_eigen.h" +#include "lstm_eigen.tpp" +#elif RTNEURAL_USE_XSIMD +#include "lstm_xsimd.h" +#include "lstm_xsimd.tpp" +#else +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include "../maths/maths_stl.h" +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a LSTM layer with tanh + * activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's LSTM implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class LSTMLayer final : public Layer +{ +public: + /** Constructs a LSTM layer for a given input and output size. */ + LSTMLayer(int in_size, int out_size); + LSTMLayer(std::initializer_list sizes); + LSTMLayer(const LSTMLayer& other); + LSTMLayer& operator=(const LSTMLayer& other); + virtual ~LSTMLayer(); + + /** Resets the state of the LSTM. */ + RTNEURAL_REALTIME void reset() override; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "lstm"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* h) noexcept override + { + for(int i = 0; i < Layer::out_size; ++i) + { + fVec[i] = MathsProvider::sigmoid(vMult(fWeights.W[i], input, Layer::in_size) + vMult(fWeights.U[i], ht1, Layer::out_size) + fWeights.b[i]); + iVec[i] = MathsProvider::sigmoid(vMult(iWeights.W[i], input, Layer::in_size) + vMult(iWeights.U[i], ht1, Layer::out_size) + iWeights.b[i]); + oVec[i] = MathsProvider::sigmoid(vMult(oWeights.W[i], input, Layer::in_size) + vMult(oWeights.U[i], ht1, Layer::out_size) + oWeights.b[i]); + ctVec[i] = MathsProvider::tanh(vMult(cWeights.W[i], input, Layer::in_size) + vMult(cWeights.U[i], ht1, Layer::out_size) + cWeights.b[i]); + cVec[i] = fVec[i] * ct1[i] + iVec[i] * ctVec[i]; + h[i] = oVec[i] * MathsProvider::tanh(cVec[i]); + } + + std::copy(cVec, cVec + Layer::out_size, ct1); + std::copy(h, h + Layer::out_size, ht1); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][4 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][4 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[4 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector& bVals); + +protected: + T* ht1; + T* ct1; + + /** Struct to hold layer weights (used internally) */ + struct WeightSet + { + WeightSet(int in_size, int out_size); + ~WeightSet(); + + T** W; // kernel weights + T** U; // recurrent weights + T* b; // bias + const int out_size; + }; + + WeightSet fWeights; + WeightSet iWeights; + WeightSet oWeights; + WeightSet cWeights; + + T* fVec; + T* iVec; + T* oVec; + T* ctVec; + T* cVec; +}; + +//==================================================== +/** + * Static implementation of a LSTM layer with tanh + * activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's LSTM implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class LSTMLayerT +{ +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + + LSTMLayerT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "lstm"; } + + /** Returns false since LSTM is not an activation. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Prepares the LSTM to process with a given delay length. */ + template + std::enable_if_t + prepare(int delaySamples); + + /** Prepares the LSTM to process with a given delay length. */ + template + std::enable_if_t + prepare(T delaySamples); + + /** Resets the state of the LSTM. */ + RTNEURAL_REALTIME void reset(); + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if<(N > 1), void>::type + forward(const T (&ins)[in_size]) noexcept + { + // compute ft + recurrent_mat_mul(outs, Uf, ft); + kernel_mat_mul(ins, Wf, kernel_outs); + for(int i = 0; i < out_size; ++i) + ft[i] = MathsProvider::sigmoid(ft[i] + bf[i] + kernel_outs[i]); + + // compute it + recurrent_mat_mul(outs, Ui, it); + kernel_mat_mul(ins, Wi, kernel_outs); + for(int i = 0; i < out_size; ++i) + it[i] = MathsProvider::sigmoid(it[i] + bi[i] + kernel_outs[i]); + + // compute ot + recurrent_mat_mul(outs, Uo, ot); + kernel_mat_mul(ins, Wo, kernel_outs); + for(int i = 0; i < out_size; ++i) + ot[i] = MathsProvider::sigmoid(ot[i] + bo[i] + kernel_outs[i]); + + computeOutputs(ins); + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const T (&ins)[in_size]) noexcept + { + // compute ft + recurrent_mat_mul(outs, Uf, ft); + for(int i = 0; i < out_size; ++i) + ft[i] = MathsProvider::sigmoid(ft[i] + bf[i] + (Wf_1[i] * ins[0])); + + // compute it + recurrent_mat_mul(outs, Ui, it); + for(int i = 0; i < out_size; ++i) + it[i] = MathsProvider::sigmoid(it[i] + bi[i] + (Wi_1[i] * ins[0])); + + // compute ot + recurrent_mat_mul(outs, Uo, ot); + for(int i = 0; i < out_size; ++i) + ot[i] = MathsProvider::sigmoid(ot[i] + bo[i] + (Wo_1[i] * ins[0])); + + computeOutputs(ins); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][4 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][4 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[4 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector& bVals); + + T outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + +private: + template + inline std::enable_if_t + computeOutputs(const T (&ins)[in_size]) noexcept + { + computeOutputsInternal(ins, ct, outs); + } + + template + inline std::enable_if_t + computeOutputs(const T (&ins)[in_size]) noexcept + { + computeOutputsInternal(ins, ct_delayed[delayWriteIdx], outs_delayed[delayWriteIdx]); + + processDelay(ct_delayed, ct, delayWriteIdx); + processDelay(outs_delayed, outs, delayWriteIdx); + } + + template + inline std::enable_if_t<(N > 1), void> + computeOutputsInternal(const T (&ins)[in_size], VecType& ctVec, VecType& outsVec) noexcept + { + // compute ct + recurrent_mat_mul(outs, Uc, ht); + kernel_mat_mul(ins, Wc, kernel_outs); + for(int i = 0; i < out_size; ++i) + ctVec[i] = it[i] * MathsProvider::tanh(ht[i] + bc[i] + kernel_outs[i]) + ft[i] * ct[i]; + + // compute output + for(int i = 0; i < out_size; ++i) + outsVec[i] = ot[i] * MathsProvider::tanh(ctVec[i]); + } + + template + inline std::enable_if_t + computeOutputsInternal(const T (&ins)[in_size], VecType& ctVec, VecType& outsVec) noexcept + { + // compute ct + recurrent_mat_mul(outs, Uc, ht); + for(int i = 0; i < out_size; ++i) + ctVec[i] = it[i] * MathsProvider::tanh(ht[i] + bc[i] + (Wc_1[i] * ins[0])) + ft[i] * ct[i]; + + // compute output + for(int i = 0; i < out_size; ++i) + outsVec[i] = ot[i] * MathsProvider::tanh(ctVec[i]); + } + + template + inline std::enable_if_t + processDelay(std::vector>& delayVec, T (&out)[out_size], int delayWriteIndex) noexcept + { + for(int i = 0; i < out_size; ++i) + out[i] = delayVec[0][i]; + + for(int j = 0; j < delayWriteIndex; ++j) + { + for(int i = 0; i < out_size; ++i) + delayVec[j][i] = delayVec[j + 1][i]; + } + } + + template + inline std::enable_if_t + processDelay(std::vector>& delayVec, T (&out)[out_size], int delayWriteIndex) noexcept + { + for(int i = 0; i < out_size; ++i) + out[i] = delayPlus1Mult * delayVec[0][i] + delayMult * delayVec[1][i]; + + for(int j = 0; j < delayWriteIndex; ++j) + { + for(int i = 0; i < out_size; ++i) + delayVec[j][i] = delayVec[j + 1][i]; + } + } + + static inline void recurrent_mat_mul(const T (&vec)[out_size], const T (&mat)[out_size][out_size], T (&out)[out_size]) noexcept + { + for(int j = 0; j < out_size; ++j) + out[j] = std::inner_product(mat[j], mat[j] + out_size, vec, (T)0); + } + + static inline void kernel_mat_mul(const T (&vec)[in_size], const T (&mat)[out_size][in_size], T (&out)[out_size]) noexcept + { + for(int j = 0; j < out_size; ++j) + out[j] = std::inner_product(mat[j], mat[j] + in_size, vec, (T)0); + } + + // kernel weights + T Wf alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][in_size]; + T Wi alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][in_size]; + T Wo alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][in_size]; + T Wc alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][in_size]; + T kernel_outs alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + // single-input kernel weights + T Wf_1 alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T Wi_1 alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T Wo_1 alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T Wc_1 alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + // recurrent weights + T Uf alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][out_size]; + T Ui alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][out_size]; + T Uo alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][out_size]; + T Uc alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size][out_size]; + + // biases + T bf alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T bi alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T bo alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T bc alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + // intermediate vars + T ft alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T it alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T ot alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T ht alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + T ct alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + // needed for delays when doing sample rate correction + std::vector> ct_delayed; + std::vector> outs_delayed; + int delayWriteIdx = 0; + T delayMult = (T)1; + T delayPlus1Mult = (T)0; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif + +#endif // LSTM_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm.tpp new file mode 100644 index 0000000..4e6b29e --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm.tpp @@ -0,0 +1,287 @@ +#include "lstm.h" + +namespace RTNEURAL_NAMESPACE +{ + +#if !RTNEURAL_USE_EIGEN && !RTNEURAL_USE_XSIMD + +template +LSTMLayer::LSTMLayer(int in_size, int out_size) + : Layer(in_size, out_size) + , fWeights(in_size, out_size) + , iWeights(in_size, out_size) + , oWeights(in_size, out_size) + , cWeights(in_size, out_size) +{ + ht1 = new T[out_size]; + ct1 = new T[out_size]; + + fVec = new T[out_size]; + iVec = new T[out_size]; + oVec = new T[out_size]; + ctVec = new T[out_size]; + cVec = new T[out_size]; +} + +template +LSTMLayer::LSTMLayer(std::initializer_list sizes) + : LSTMLayer(*sizes.begin(), *(sizes.begin() + 1)) +{ +} + +template +LSTMLayer::LSTMLayer(const LSTMLayer& other) + : LSTMLayer(other.in_size, other.out_size) +{ +} + +template +LSTMLayer& LSTMLayer::operator=(const LSTMLayer& other) +{ + if(&other != this) + *this = LSTMLayer(other); + return *this; +} + +template +LSTMLayer::~LSTMLayer() +{ + delete[] ht1; + delete[] ct1; + + delete[] fVec; + delete[] iVec; + delete[] oVec; + delete[] ctVec; + delete[] cVec; +} + +template +void LSTMLayer::reset() +{ + std::fill(ht1, ht1 + Layer::out_size, (T)0); + std::fill(ct1, ct1 + Layer::out_size, (T)0); +} + +template +LSTMLayer::WeightSet::WeightSet(int in_size, int out_size) + : out_size(out_size) +{ + W = new T*[out_size]; + U = new T*[out_size]; + b = new T[out_size]; + + for(int i = 0; i < out_size; ++i) + { + W[i] = new T[in_size]; + U[i] = new T[out_size]; + } +} + +template +LSTMLayer::WeightSet::~WeightSet() +{ + delete[] b; + + for(int i = 0; i < out_size; ++i) + { + delete[] W[i]; + delete[] U[i]; + } + + delete[] W; + delete[] U; +} + +template +void LSTMLayer::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < Layer::in_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + iWeights.W[k][i] = wVals[i][k]; + fWeights.W[k][i] = wVals[i][k + Layer::out_size]; + cWeights.W[k][i] = wVals[i][k + Layer::out_size * 2]; + oWeights.W[k][i] = wVals[i][k + Layer::out_size * 3]; + } + } +} + +template +void LSTMLayer::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + iWeights.U[k][i] = uVals[i][k]; + fWeights.U[k][i] = uVals[i][k + Layer::out_size]; + cWeights.U[k][i] = uVals[i][k + Layer::out_size * 2]; + oWeights.U[k][i] = uVals[i][k + Layer::out_size * 3]; + } + } +} + +template +void LSTMLayer::setBVals(const std::vector& bVals) +{ + for(int k = 0; k < Layer::out_size; ++k) + { + iWeights.b[k] = bVals[k]; + fWeights.b[k] = bVals[k + Layer::out_size]; + cWeights.b[k] = bVals[k + Layer::out_size * 2]; + oWeights.b[k] = bVals[k + Layer::out_size * 3]; + } +} + +//==================================================== +template +LSTMLayerT::LSTMLayerT() +{ + for(int i = 0; i < out_size; ++i) + { + // single-input kernel weights + Wf_1[i] = (T)0; + Wi_1[i] = (T)0; + Wo_1[i] = (T)0; + Wc_1[i] = (T)0; + + // biases + bf[i] = (T)0; + bi[i] = (T)0; + bo[i] = (T)0; + bc[i] = (T)0; + + // intermediate vars + ft[i] = (T)0; + it[i] = (T)0; + ot[i] = (T)0; + ht[i] = (T)0; + } + + for(int i = 0; i < out_size; ++i) + { + // recurrent weights + for(int k = 0; k < out_size; ++k) + { + Uf[i][k] = (T)0; + Ui[i][k] = (T)0; + Uo[i][k] = (T)0; + Uc[i][k] = (T)0; + } + + // kernel weights + for(int k = 0; k < in_size; ++k) + { + Wf[i][k] = (T)0; + Wi[i][k] = (T)0; + Wo[i][k] = (T)0; + Wc[i][k] = (T)0; + } + } + + reset(); +} + +template +template +std::enable_if_t +LSTMLayerT::prepare(int delaySamples) +{ + delayWriteIdx = delaySamples - 1; + ct_delayed.resize(delayWriteIdx + 1, {}); + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +template +std::enable_if_t +LSTMLayerT::prepare(T delaySamples) +{ + const auto delayOffFactor = delaySamples - std::floor(delaySamples); + delayMult = (T)1 - delayOffFactor; + delayPlus1Mult = delayOffFactor; + + delayWriteIdx = (int)std::ceil(delaySamples) - (int)std::ceil(delayOffFactor); + ct_delayed.resize(delayWriteIdx + 1, {}); + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +void LSTMLayerT::reset() +{ + if(sampleRateCorr != SampleRateCorrectionMode::None) + { + for(auto& x : ct_delayed) + std::fill(x.begin(), x.end(), T {}); + + for(auto& x : outs_delayed) + std::fill(x.begin(), x.end(), T {}); + } + + // reset output state + for(int i = 0; i < out_size; ++i) + { + ct[i] = (T)0; + outs[i] = (T)0; + } +} + +template +void LSTMLayerT::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < in_size; ++i) + { + for(int j = 0; j < out_size; ++j) + { + Wi[j][i] = wVals[i][j]; + Wf[j][i] = wVals[i][j + out_size]; + Wc[j][i] = wVals[i][j + 2 * out_size]; + Wo[j][i] = wVals[i][j + 3 * out_size]; + } + } + + for(int j = 0; j < out_size; ++j) + { + Wi_1[j] = wVals[0][j]; + Wf_1[j] = wVals[0][j + out_size]; + Wc_1[j] = wVals[0][j + 2 * out_size]; + Wo_1[j] = wVals[0][j + 3 * out_size]; + } +} + +template +void LSTMLayerT::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < out_size; ++i) + { + for(int j = 0; j < out_size; ++j) + { + Ui[j][i] = uVals[i][j]; + Uf[j][i] = uVals[i][j + out_size]; + Uc[j][i] = uVals[i][j + 2 * out_size]; + Uo[j][i] = uVals[i][j + 3 * out_size]; + } + } +} + +template +void LSTMLayerT::setBVals(const std::vector& bVals) +{ + for(int k = 0; k < out_size; ++k) + { + bi[k] = bVals[k]; + bf[k] = bVals[k + out_size]; + bc[k] = bVals[k + 2 * out_size]; + bo[k] = bVals[k + 3 * out_size]; + } +} + +#endif // !RTNEURAL_USE_EIGEN && !RTNEURAL_USE_XSIMD + +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_eigen.h new file mode 100644 index 0000000..c8f3d94 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_eigen.h @@ -0,0 +1,291 @@ +#ifndef LSTM_EIGEN_INCLUDED +#define LSTM_EIGEN_INCLUDED + +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include "../maths/maths_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a LSTM layer with tanh + * activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's LSTM implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class LSTMLayer : public Layer +{ +public: + /** Constructs a LSTM layer for a given input and output size. */ + LSTMLayer(int in_size, int out_size); + LSTMLayer(std::initializer_list sizes); + LSTMLayer(const LSTMLayer& other); + LSTMLayer& operator=(const LSTMLayer& other); + virtual ~LSTMLayer() = default; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "lstm"; } + + /** Resets the state of the LSTM. */ + RTNEURAL_REALTIME void reset() override; + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* h) noexcept override + { + for(int i = 0; i < Layer::in_size; ++i) + { + extendedInVecHt1(i) = input[i]; + } + + /** + * | f | | Wf Uf Bf | | input | + * | i | = | Wi Ui Bi | * | ht1 | + * | o | | Wo Uo Bo | | 1 | + * | ct | | Wct Uct Bct | + */ + fioctVecs.noalias() = combinedWeights * extendedInVecHt1; + + fioVecs = fioctVecs.segment(0, Layer::out_size * 3); + ctVec = MathsProvider::tanh(fioctVecs.segment(Layer::out_size * 3, Layer::out_size)); + + fioVecs = MathsProvider::sigmoid(fioVecs); + + ct1 = fioVecs.segment(0, Layer::out_size).cwiseProduct(ct1) + fioVecs.segment(Layer::out_size, Layer::out_size).cwiseProduct(ctVec); + cTanhVec = MathsProvider::tanh(ct1); + + ht1 = fioVecs.segment(Layer::out_size * 2, Layer::out_size).cwiseProduct(cTanhVec); + + for(int i = 0; i < Layer::out_size; ++i) + { + h[i] = extendedInVecHt1(Layer::in_size + i) = ht1(i); + } + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][4 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][4 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[4 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector& bVals); + +private: + Eigen::Matrix combinedWeights; + + Eigen::Matrix extendedInVecHt1; + + Eigen::Matrix fioctVecs; + Eigen::Matrix fioVecs; + Eigen::Matrix ctVec; + + Eigen::Matrix cTanhVec; + + Eigen::Matrix ht1; + Eigen::Matrix ct1; +}; + +//==================================================== +/** + * Static implementation of a LSTM layer with tanh + * activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's LSTM implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class LSTMLayerT +{ + using weights_combined_type = Eigen::Matrix; + using extended_in_out_type = Eigen::Matrix; + using four_out_type = Eigen::Matrix; + using three_out_type = Eigen::Matrix; + + using in_type = Eigen::Matrix; + using out_type = Eigen::Matrix; + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + + LSTMLayerT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "lstm"; } + + /** Returns false since LSTM is not an activation. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Prepares the LSTM to process with a given delay length. */ + template + std::enable_if_t + prepare(int delaySamples); + + /** Prepares the LSTM to process with a given delay length. */ + template + std::enable_if_t + prepare(T delaySamples); + + /** Resets the state of the LSTM. */ + RTNEURAL_REALTIME void reset(); + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const in_type& ins) noexcept + { + for(int i = 0; i < in_sizet; ++i) + { + extendedInHt1Vec(i) = ins(i); + } + + /** + * | f | | Wf Uf Bf | | input | + * | i | = | Wi Ui Bi | * | ht1 | + * | o | | Wo Uo Bo | | 1 | + * | ct | | Wct Uct Bct | + */ + fioctsVecs.noalias() = combinedWeights * extendedInHt1Vec; + + fioVecs = MathsProvider::sigmoid(fioctsVecs.segment(0, 3 * out_sizet)); + ctVec = MathsProvider::tanh(fioctsVecs.segment(3 * out_sizet, out_sizet)); + + computeOutputs(); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][4 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][4 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[4 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector& bVals); + + Eigen::Map outs; + +private: + T outs_internal alignas(RTNEURAL_DEFAULT_ALIGNMENT)[out_size]; + + template + inline std::enable_if_t + computeOutputs() noexcept + { + computeOutputsInternal(cVec, outs); + + for(int i = 0; i < out_sizet; ++i) + { + extendedInHt1Vec(in_sizet + i) = outs(i); + } + } + + template + inline std::enable_if_t + computeOutputs() noexcept + { + computeOutputsInternal(ct_delayed[delayWriteIdx], outs_delayed[delayWriteIdx]); + + processDelay(ct_delayed, cVec, delayWriteIdx); + processDelay(outs_delayed, outs, delayWriteIdx); + + for(int i = 0; i < out_sizet; ++i) + { + extendedInHt1Vec(in_sizet + i) = outs(i); + } + } + + template + inline void computeOutputsInternal(VecType1& cVecLocal, VecType2& outsVec) noexcept + { + cVecLocal.noalias() + = fioVecs.segment(0, out_sizet) + .cwiseProduct(cVec) + + fioVecs.segment(out_sizet, out_sizet) + .cwiseProduct(ctVec); + + cTanhVec = MathsProvider::tanh(cVecLocal); + outsVec.noalias() = fioVecs.segment(out_sizet * 2, out_sizet).cwiseProduct(cTanhVec); + } + + template + inline std::enable_if_t + processDelay(std::vector& delayVec, OutVec& out, int delayWriteIndex) noexcept + { + out = delayVec[0]; + + for(int j = 0; j < delayWriteIndex; ++j) + delayVec[j] = delayVec[j + 1]; + } + + template + inline std::enable_if_t + processDelay(std::vector& delayVec, OutVec& out, int delayWriteIndex) noexcept + { + out = delayPlus1Mult * delayVec[0] + delayMult * delayVec[1]; + + for(int j = 0; j < delayWriteIndex; ++j) + delayVec[j] = delayVec[j + 1]; + } + + // kernel weights + weights_combined_type combinedWeights; + extended_in_out_type extendedInHt1Vec; + four_out_type fioctsVecs; + three_out_type fioVecs; + out_type cTanhVec; + + // intermediate values + out_type ctVec; + out_type cVec; + + // needed for delays when doing sample rate correction + std::vector ct_delayed; + std::vector outs_delayed; + int delayWriteIdx = 0; + T delayMult = (T)1; + T delayPlus1Mult = (T)0; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // LSTM_EIGEN_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_eigen.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_eigen.tpp new file mode 100644 index 0000000..c48301d --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_eigen.tpp @@ -0,0 +1,208 @@ +#include "lstm_eigen.h" + +namespace RTNEURAL_NAMESPACE +{ + +template +LSTMLayer::LSTMLayer(int in_size, int out_size) + : Layer(in_size, out_size) +{ + combinedWeights = Eigen::Matrix::Zero(4 * out_size, in_size + out_size + 1); + extendedInVecHt1 = Eigen::Matrix::Zero(in_size + out_size + 1); + extendedInVecHt1(in_size + out_size) = (T)1; + + fioctVecs = Eigen::Matrix::Zero(4 * out_size); + fioVecs = Eigen::Matrix::Zero(3 * out_size); + ctVec = Eigen::Matrix::Zero(out_size); + + cTanhVec = Eigen::Matrix::Zero(out_size, 1); + + ht1 = Eigen::Matrix::Zero(out_size); + ct1 = Eigen::Matrix::Zero(out_size); +} + +template +LSTMLayer::LSTMLayer(std::initializer_list sizes) + : LSTMLayer(*sizes.begin(), *(sizes.begin() + 1)) +{ +} + +template +LSTMLayer::LSTMLayer(const LSTMLayer& other) + : LSTMLayer(other.in_size, other.out_size) +{ +} + +template +LSTMLayer& LSTMLayer::operator=(const LSTMLayer& other) +{ + return *this = LSTMLayer(other); +} + +template +void LSTMLayer::reset() +{ + ht1.setZero(); + ct1.setZero(); + extendedInVecHt1.setZero(); + extendedInVecHt1(Layer::in_size + Layer::out_size) = (T)1; +} + +template +void LSTMLayer::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < Layer::in_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + combinedWeights(k, i) = wVals[i][k + Layer::out_size]; // Wf + combinedWeights(k + Layer::out_size, i) = wVals[i][k]; // Wi + combinedWeights(k + Layer::out_size * 2, i) = wVals[i][k + Layer::out_size * 3]; // Wo + combinedWeights(k + Layer::out_size * 3, i) = wVals[i][k + Layer::out_size * 2]; // Wc + } + } +} + +template +void LSTMLayer::setUVals(const std::vector>& uVals) +{ + int col; + for(int i = 0; i < Layer::out_size; ++i) + { + col = i + Layer::in_size; + for(int k = 0; k < Layer::out_size; ++k) + { + combinedWeights(k, col) = uVals[i][k + Layer::out_size]; // Uf + combinedWeights(k + Layer::out_size, col) = uVals[i][k]; // Ui + combinedWeights(k + Layer::out_size * 2, col) = uVals[i][k + Layer::out_size * 3]; // Uo + combinedWeights(k + Layer::out_size * 3, col) = uVals[i][k + Layer::out_size * 2]; // Uc + } + } +} + +template +void LSTMLayer::setBVals(const std::vector& bVals) +{ + int col = Layer::in_size + Layer::out_size; + for(int k = 0; k < Layer::out_size; ++k) + { + combinedWeights(k, col) = bVals[k + Layer::out_size]; // Bf + combinedWeights(k + Layer::out_size, col) = bVals[k]; // Bi + combinedWeights(k + Layer::out_size * 2, col) = bVals[k + Layer::out_size * 3]; // Bo + combinedWeights(k + Layer::out_size * 3, col) = bVals[k + Layer::out_size * 2]; // Bc + } +} + +//==================================================== +template +LSTMLayerT::LSTMLayerT() + : outs(outs_internal) +{ + combinedWeights = weights_combined_type::Zero(); + extendedInHt1Vec = extended_in_out_type::Zero(); + fioctsVecs = four_out_type::Zero(); + fioVecs = three_out_type::Zero(); + + ctVec = out_type::Zero(); + cTanhVec = out_type::Zero(); + + reset(); +} + +template +template +std::enable_if_t +LSTMLayerT::prepare(int delaySamples) +{ + delayWriteIdx = delaySamples - 1; + ct_delayed.resize(delayWriteIdx + 1, {}); + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +template +std::enable_if_t +LSTMLayerT::prepare(T delaySamples) +{ + const auto delayOffFactor = delaySamples - std::floor(delaySamples); + delayMult = (T)1 - delayOffFactor; + delayPlus1Mult = delayOffFactor; + + delayWriteIdx = (int)std::ceil(delaySamples) - (int)std::ceil(delayOffFactor); + ct_delayed.resize(delayWriteIdx + 1, {}); + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +void LSTMLayerT::reset() +{ + if(sampleRateCorr != SampleRateCorrectionMode::None) + { + for(auto& x : ct_delayed) + x = out_type::Zero(); + + for(auto& x : outs_delayed) + x = out_type::Zero(); + } + + // reset output state + extendedInHt1Vec.setZero(); + extendedInHt1Vec(in_sizet + out_sizet) = (T)1; + outs = out_type::Zero(); + cVec = out_type::Zero(); + ctVec.setZero(); +} + +// kernel weights +template +void LSTMLayerT::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < in_size; ++i) + { + for(int k = 0; k < out_size; ++k) + { + combinedWeights(k, i) = wVals[i][k + out_sizet]; // Wf + combinedWeights(k + out_sizet, i) = wVals[i][k]; // Wi + combinedWeights(k + out_sizet * 2, i) = wVals[i][k + out_sizet * 3]; // Wo + combinedWeights(k + out_sizet * 3, i) = wVals[i][k + out_sizet * 2]; // Wc + } + } +} + +// recurrent weights +template +void LSTMLayerT::setUVals(const std::vector>& uVals) +{ + int col; + for(int i = 0; i < out_size; ++i) + { + col = i + in_sizet; + for(int k = 0; k < out_size; ++k) + { + combinedWeights(k, col) = uVals[i][k + out_sizet]; // Uf + combinedWeights(k + out_sizet, col) = uVals[i][k]; // Ui + combinedWeights(k + out_sizet * 2, col) = uVals[i][k + out_sizet * 3]; // Uo + combinedWeights(k + out_sizet * 3, col) = uVals[i][k + out_sizet * 2]; // Uc + } + } +} + +// biases +template +void LSTMLayerT::setBVals(const std::vector& bVals) +{ + int col = in_size + out_size; + for(int k = 0; k < out_size; ++k) + { + combinedWeights(k, col) = bVals[k + out_sizet]; // Bf + combinedWeights(k + out_sizet, col) = bVals[k]; // Bi + combinedWeights(k + out_sizet * 2, col) = bVals[k + out_sizet * 3]; // Bo + combinedWeights(k + out_sizet * 3, col) = bVals[k + out_sizet * 2]; // Bc + } +} + +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_xsimd.h new file mode 100644 index 0000000..973235f --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_xsimd.h @@ -0,0 +1,408 @@ +#ifndef LSTM_XSIMD_H_INCLUDED +#define LSTM_XSIMD_H_INCLUDED + +#include "../Layer.h" +#include "../common.h" +#include "../config.h" +#include "../maths/maths_xsimd.h" +#include + +namespace RTNEURAL_NAMESPACE +{ + +/** + * Dynamic implementation of a LSTM layer with tanh + * activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's LSTM implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class LSTMLayer : public Layer +{ +public: + /** Constructs a LSTM layer for a given input and output size. */ + LSTMLayer(int in_size, int out_size); + LSTMLayer(std::initializer_list sizes); + LSTMLayer(const LSTMLayer& other); + LSTMLayer& operator=(const LSTMLayer& other); + virtual ~LSTMLayer(); + + /** Resets the state of the LSTM. */ + RTNEURAL_REALTIME void reset() override; + + /** Returns the name of this layer. */ + std::string getName() const noexcept override { return "lstm"; } + + /** Performs forward propagation for this layer. */ + RTNEURAL_REALTIME inline void forward(const T* input, T* h) noexcept override + { + for(int i = 0; i < Layer::out_size; ++i) + { + fVec[i] = vMult(fWeights.W[i].data(), input, prod_in.data(), Layer::in_size) + vMult(fWeights.U[i].data(), ht1.data(), prod_out.data(), Layer::out_size); + iVec[i] = vMult(iWeights.W[i].data(), input, prod_in.data(), Layer::in_size) + vMult(iWeights.U[i].data(), ht1.data(), prod_out.data(), Layer::out_size); + oVec[i] = vMult(oWeights.W[i].data(), input, prod_in.data(), Layer::in_size) + vMult(oWeights.U[i].data(), ht1.data(), prod_out.data(), Layer::out_size); + ctVec[i] = vMult(cWeights.W[i].data(), input, prod_in.data(), Layer::in_size) + vMult(cWeights.U[i].data(), ht1.data(), prod_out.data(), Layer::out_size); + } + + vAdd(fVec.data(), fWeights.b.data(), fVec.data(), Layer::out_size); + sigmoid(fVec.data(), fVec.data(), Layer::out_size); + + vAdd(iVec.data(), iWeights.b.data(), iVec.data(), Layer::out_size); + sigmoid(iVec.data(), iVec.data(), Layer::out_size); + + vAdd(oVec.data(), oWeights.b.data(), oVec.data(), Layer::out_size); + sigmoid(oVec.data(), oVec.data(), Layer::out_size); + + vAdd(ctVec.data(), cWeights.b.data(), ctVec.data(), Layer::out_size); + tanh(ctVec.data(), ctVec.data(), Layer::out_size); + + vProd(fVec.data(), ct1.data(), cVec.data(), Layer::out_size); + vProd(iVec.data(), ctVec.data(), prod_out.data(), Layer::out_size); + vAdd(cVec.data(), prod_out.data(), cVec.data(), Layer::out_size); + + tanh(cVec.data(), h, Layer::out_size); + vProd(h, oVec.data(), h, Layer::out_size); + + vCopy(cVec.data(), ct1.data(), Layer::out_size); + vCopy(h, ht1.data(), Layer::out_size); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][4 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][4 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[4 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector& bVals); + +protected: + using vec_type = std::vector>; + using vec2_type = std::vector; + + vec_type ht1; + vec_type ct1; + + struct WeightSet + { + WeightSet(int in_size, int out_size); + ~WeightSet(); + + vec2_type W; // kernel weights + vec2_type U; // recurrent weights + vec_type b; // bias + const int out_size; + }; + + WeightSet fWeights; + WeightSet iWeights; + WeightSet oWeights; + WeightSet cWeights; + + vec_type fVec; + vec_type iVec; + vec_type oVec; + vec_type ctVec; + vec_type cVec; + + vec_type prod_in; + vec_type prod_out; +}; + +//==================================================== +/** + * Static implementation of a LSTM layer with tanh + * activation and sigmoid recurrent activation. + * + * To ensure that the recurrent state is initialized to zero, + * please make sure to call `reset()` before your first call to + * the `forward()` method. + * + * Compared to TensorFlow's LSTM implementation, this layer will + * behave by default as if the parameter `stateful=True`. A "stateless" + * GRU can be achieved by calling the `reset()` function in between + * calls to `forward()`. + */ +template +class LSTMLayerT +{ + using v_type = xsimd::simd_type; + static constexpr auto v_size = (int)v_type::size; + static constexpr auto v_in_size = ceil_div(in_sizet, v_size); + static constexpr auto v_out_size = ceil_div(out_sizet, v_size); + +public: + static constexpr auto in_size = in_sizet; + static constexpr auto out_size = out_sizet; + + LSTMLayerT(); + + /** Returns the name of this layer. */ + std::string getName() const noexcept { return "lstm"; } + + /** Returns false since LSTM is not an activation. */ + constexpr bool isActivation() const noexcept { return false; } + + /** Prepares the LSTM to process with a given delay length. */ + template + std::enable_if_t + prepare(int delaySamples); + + /** Prepares the LSTM to process with a given delay length. */ + template + std::enable_if_t + prepare(T delaySamples); + + /** Resets the state of the LSTM. */ + RTNEURAL_REALTIME void reset(); + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if<(N > 1), void>::type + forward(const v_type (&ins)[v_in_size]) noexcept + { + // compute ft + recurrent_mat_mul(outs, Uf, ft); + kernel_mat_mul(ins, Wf, kernel_outs); + for(int i = 0; i < v_out_size; ++i) + ft[i] = MathsProvider::sigmoid(ft[i] + bf[i] + kernel_outs[i]); + + // compute it + recurrent_mat_mul(outs, Ui, it); + kernel_mat_mul(ins, Wi, kernel_outs); + for(int i = 0; i < v_out_size; ++i) + it[i] = MathsProvider::sigmoid(it[i] + bi[i] + kernel_outs[i]); + + // compute ot + recurrent_mat_mul(outs, Uo, ot); + kernel_mat_mul(ins, Wo, kernel_outs); + for(int i = 0; i < v_out_size; ++i) + ot[i] = MathsProvider::sigmoid(ot[i] + bo[i] + kernel_outs[i]); + + computeOutputs(ins); + } + + /** Performs forward propagation for this layer. */ + template + RTNEURAL_REALTIME inline typename std::enable_if::type + forward(const v_type (&ins)[v_in_size]) noexcept + { + // compute ft + recurrent_mat_mul(outs, Uf, ft); + for(int i = 0; i < v_out_size; ++i) + ft[i] = MathsProvider::sigmoid(xsimd::fma(Wf_1[i], ins[0], ft[i] + bf[i])); + + // compute it + recurrent_mat_mul(outs, Ui, it); + for(int i = 0; i < v_out_size; ++i) + it[i] = MathsProvider::sigmoid(xsimd::fma(Wi_1[i], ins[0], it[i] + bi[i])); + + // compute ot + recurrent_mat_mul(outs, Uo, ot); + for(int i = 0; i < v_out_size; ++i) + ot[i] = MathsProvider::sigmoid(xsimd::fma(Wo_1[i], ins[0], ot[i] + bo[i])); + + computeOutputs(ins); + } + + /** + * Sets the layer kernel weights. + * + * The weights vector must have size weights[in_size][4 * out_size] + */ + RTNEURAL_REALTIME void setWVals(const std::vector>& wVals); + + /** + * Sets the layer recurrent weights. + * + * The weights vector must have size weights[out_size][4 * out_size] + */ + RTNEURAL_REALTIME void setUVals(const std::vector>& uVals); + + /** + * Sets the layer bias. + * + * The bias vector must have size weights[4 * out_size] + */ + RTNEURAL_REALTIME void setBVals(const std::vector& bVals); + + v_type outs[v_out_size]; + +private: + template + inline std::enable_if_t + computeOutputs(const v_type (&ins)[v_in_size]) noexcept + { + computeOutputsInternal(ins, ct, outs); + } + + template + inline std::enable_if_t + computeOutputs(const v_type (&ins)[v_in_size]) noexcept + { + computeOutputsInternal(ins, ct_delayed[delayWriteIdx], outs_delayed[delayWriteIdx]); + + processDelay(ct_delayed, ct, delayWriteIdx); + processDelay(outs_delayed, outs, delayWriteIdx); + } + + template + inline std::enable_if_t<(N > 1), void> + computeOutputsInternal(const v_type (&ins)[v_in_size], VecType& ctVec, VecType& outsVec) noexcept + { + // compute ct + recurrent_mat_mul(outs, Uc, ht); + kernel_mat_mul(ins, Wc, kernel_outs); + for(int i = 0; i < v_out_size; ++i) + ctVec[i] = xsimd::fma(it[i], MathsProvider::tanh(ht[i] + bc[i] + kernel_outs[i]), ft[i] * ct[i]); + + // compute output + for(int i = 0; i < v_out_size; ++i) + outsVec[i] = ot[i] * MathsProvider::tanh(ctVec[i]); + } + + template + inline std::enable_if_t + computeOutputsInternal(const v_type (&ins)[v_in_size], VecType& ctVec, VecType& outsVec) noexcept + { + // compute ct + recurrent_mat_mul(outs, Uc, ht); + for(int i = 0; i < v_out_size; ++i) + ctVec[i] = xsimd::fma(it[i], MathsProvider::tanh(xsimd::fma(Wc_1[i], ins[0], ht[i] + bc[i])), ft[i] * ct[i]); + + // compute output + for(int i = 0; i < v_out_size; ++i) + outsVec[i] = ot[i] * MathsProvider::tanh(ctVec[i]); + } + + template + inline std::enable_if_t + processDelay(std::vector>& delayVec, v_type (&out)[v_out_size], int delayWriteIndex) noexcept + { + for(int i = 0; i < v_out_size; ++i) + out[i] = delayVec[0][i]; + + for(int j = 0; j < delayWriteIndex; ++j) + { + for(int i = 0; i < v_out_size; ++i) + delayVec[j][i] = delayVec[j + 1][i]; + } + } + + template + inline std::enable_if_t + processDelay(std::vector>& delayVec, v_type (&out)[v_out_size], int delayWriteIndex) noexcept + { + for(int i = 0; i < v_out_size; ++i) + out[i] = delayPlus1Mult * delayVec[0][i] + delayMult * delayVec[1][i]; + + for(int j = 0; j < delayWriteIndex; ++j) + { + for(int i = 0; i < v_out_size; ++i) + delayVec[j][i] = delayVec[j + 1][i]; + } + } + + static inline void recurrent_mat_mul(const v_type (&vec)[v_out_size], const v_type (&mat)[out_size][v_out_size], v_type (&out)[v_out_size]) noexcept + { + for(int i = 0; i < v_out_size; ++i) + out[i] = v_type(0); + + T scalar_in alignas(RTNEURAL_DEFAULT_ALIGNMENT)[v_size] { (T)0 }; + for(int k = 0; k < v_out_size; ++k) + { + vec[k].store_aligned(scalar_in); + for(int i = 0; i < v_out_size; ++i) + { + for(int j = 0; j < v_size; ++j) + out[i] += scalar_in[j] * mat[k * v_size + j][i]; + } + } + } + + static inline void kernel_mat_mul(const v_type (&vec)[v_in_size], const v_type (&mat)[in_size][v_out_size], v_type (&out)[v_out_size]) noexcept + { + for(int i = 0; i < v_out_size; ++i) + out[i] = v_type(0); + + T scalar_in alignas(RTNEURAL_DEFAULT_ALIGNMENT)[v_size] { (T)0 }; + for(int k = 0; k < v_in_size; ++k) + { + vec[k].store_aligned(scalar_in); + for(int i = 0; i < v_out_size; ++i) + { + for(int j = 0; j < v_size; ++j) + out[i] += scalar_in[j] * mat[k * v_size + j][i]; + } + } + } + + static inline v_type sigmoid(v_type x) noexcept + { + return (T)1.0 / ((T)1.0 + xsimd::exp(-x)); + } + + // kernel weights + v_type Wf[in_size][v_out_size]; + v_type Wi[in_size][v_out_size]; + v_type Wo[in_size][v_out_size]; + v_type Wc[in_size][v_out_size]; + v_type kernel_outs[v_out_size]; + + // single-input kernel weights + v_type Wf_1[v_out_size]; + v_type Wi_1[v_out_size]; + v_type Wo_1[v_out_size]; + v_type Wc_1[v_out_size]; + + // recurrent weights + v_type Uf[out_size][v_out_size]; + v_type Ui[out_size][v_out_size]; + v_type Uo[out_size][v_out_size]; + v_type Uc[out_size][v_out_size]; + + // biases + v_type bf[v_out_size]; + v_type bi[v_out_size]; + v_type bo[v_out_size]; + v_type bc[v_out_size]; + + // intermediate vars + v_type ft[v_out_size]; + v_type it[v_out_size]; + v_type ot[v_out_size]; + v_type ht[v_out_size]; + v_type ct[v_out_size]; + + // needed for delays when doing sample rate correction + std::vector> ct_delayed; + std::vector> outs_delayed; + int delayWriteIdx = 0; + v_type delayMult = (T)1; + v_type delayPlus1Mult = (T)0; +}; + +} // namespace RTNEURAL_NAMESPACE + +#endif // LSTM_XSIMD_H_INCLUDED diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_xsimd.tpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_xsimd.tpp new file mode 100644 index 0000000..ad1f1b9 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/lstm/lstm_xsimd.tpp @@ -0,0 +1,259 @@ +#include "lstm_xsimd.h" + +namespace RTNEURAL_NAMESPACE +{ + +template +LSTMLayer::LSTMLayer(int in_size, int out_size) + : Layer(in_size, out_size) + , fWeights(in_size, out_size) + , iWeights(in_size, out_size) + , oWeights(in_size, out_size) + , cWeights(in_size, out_size) +{ + ht1.resize(out_size, (T)0); + ct1.resize(out_size, (T)0); + + fVec.resize(out_size, (T)0); + iVec.resize(out_size, (T)0); + oVec.resize(out_size, (T)0); + ctVec.resize(out_size, (T)0); + cVec.resize(out_size, (T)0); + + prod_in.resize(in_size, (T)0); + prod_out.resize(out_size, (T)0); +} + +template +LSTMLayer::LSTMLayer(std::initializer_list sizes) + : LSTMLayer(*sizes.begin(), *(sizes.begin() + 1)) +{ +} + +template +LSTMLayer::LSTMLayer(const LSTMLayer& other) + : LSTMLayer(other.in_size, other.out_size) +{ +} + +template +LSTMLayer& LSTMLayer::operator=(const LSTMLayer& other) +{ + return *this = LSTMLayer(other); +} + +template +LSTMLayer::~LSTMLayer() = default; + +template +void LSTMLayer::reset() +{ + std::fill(ht1.begin(), ht1.end(), (T)0); + std::fill(ct1.begin(), ct1.end(), (T)0); +} + +template +LSTMLayer::WeightSet::WeightSet(int in_size, int out_size) + : out_size(out_size) +{ + W = vec2_type(out_size, vec_type(in_size, (T)0)); + U = vec2_type(out_size, vec_type(out_size, (T)0)); + b.resize(out_size, (T)0); +} + +template +LSTMLayer::WeightSet::~WeightSet() = default; + +template +void LSTMLayer::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < Layer::in_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + iWeights.W[k][i] = wVals[i][k]; + fWeights.W[k][i] = wVals[i][k + Layer::out_size]; + cWeights.W[k][i] = wVals[i][k + Layer::out_size * 2]; + oWeights.W[k][i] = wVals[i][k + Layer::out_size * 3]; + } + } +} + +template +void LSTMLayer::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < Layer::out_size; ++i) + { + for(int k = 0; k < Layer::out_size; ++k) + { + iWeights.U[k][i] = uVals[i][k]; + fWeights.U[k][i] = uVals[i][k + Layer::out_size]; + cWeights.U[k][i] = uVals[i][k + Layer::out_size * 2]; + oWeights.U[k][i] = uVals[i][k + Layer::out_size * 3]; + } + } +} + +template +void LSTMLayer::setBVals(const std::vector& bVals) +{ + for(int k = 0; k < Layer::out_size; ++k) + { + iWeights.b[k] = bVals[k]; + fWeights.b[k] = bVals[k + Layer::out_size]; + cWeights.b[k] = bVals[k + Layer::out_size * 2]; + oWeights.b[k] = bVals[k + Layer::out_size * 3]; + } +} + +//==================================================== +template +LSTMLayerT::LSTMLayerT() +{ + for(int i = 0; i < v_out_size; ++i) + { + // single-input kernel weights + Wf_1[i] = v_type((T)0); + Wi_1[i] = v_type((T)0); + Wo_1[i] = v_type((T)0); + Wc_1[i] = v_type((T)0); + + // biases + bf[i] = v_type((T)0); + bi[i] = v_type((T)0); + bo[i] = v_type((T)0); + bc[i] = v_type((T)0); + + // intermediate vars + ft[i] = v_type((T)0); + it[i] = v_type((T)0); + ot[i] = v_type((T)0); + ht[i] = v_type((T)0); + } + + // kernel weights + for(int k = 0; k < in_size; ++k) + { + for(int i = 0; i < v_out_size; ++i) + { + Wf[k][i] = v_type((T)0); + Wi[k][i] = v_type((T)0); + Wo[k][i] = v_type((T)0); + Wc[k][i] = v_type((T)0); + } + } + + // recurrent weights + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < v_out_size; ++k) + { + Uf[i][k] = v_type((T)0); + Ui[i][k] = v_type((T)0); + Uo[i][k] = v_type((T)0); + Uc[i][k] = v_type((T)0); + } + } + + reset(); +} + +template +template +std::enable_if_t +LSTMLayerT::prepare(int delaySamples) +{ + delayWriteIdx = delaySamples - 1; + ct_delayed.resize(delayWriteIdx + 1, {}); + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +template +std::enable_if_t +LSTMLayerT::prepare(T delaySamples) +{ + const auto delayOffFactor = delaySamples - std::floor(delaySamples); + delayMult = (T)1 - delayOffFactor; + delayPlus1Mult = delayOffFactor; + + delayWriteIdx = (int)std::ceil(delaySamples) - (int)std::ceil(delayOffFactor); + ct_delayed.resize(delayWriteIdx + 1, {}); + outs_delayed.resize(delayWriteIdx + 1, {}); + + reset(); +} + +template +void LSTMLayerT::reset() +{ + if constexpr(sampleRateCorr != SampleRateCorrectionMode::None) + { + for(auto& x : ct_delayed) + std::fill(x.begin(), x.end(), v_type {}); + + for(auto& x : outs_delayed) + std::fill(x.begin(), x.end(), v_type {}); + } + + // reset output state + for(int i = 0; i < v_out_size; ++i) + { + ct[i] = v_type((T)0); + outs[i] = v_type((T)0); + } +} + +template +void LSTMLayerT::setWVals(const std::vector>& wVals) +{ + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < in_size; ++k) + { + Wi[k][i / v_size] = set_value(Wi[k][i / v_size], i % v_size, wVals[k][i]); + Wf[k][i / v_size] = set_value(Wf[k][i / v_size], i % v_size, wVals[k][i + out_size]); + Wc[k][i / v_size] = set_value(Wc[k][i / v_size], i % v_size, wVals[k][i + 2 * out_size]); + Wo[k][i / v_size] = set_value(Wo[k][i / v_size], i % v_size, wVals[k][i + 3 * out_size]); + } + } + + for(int j = 0; j < out_size; ++j) + { + Wi_1[j / v_size] = set_value(Wi_1[j / v_size], j % v_size, wVals[0][j]); + Wf_1[j / v_size] = set_value(Wf_1[j / v_size], j % v_size, wVals[0][j + out_size]); + Wc_1[j / v_size] = set_value(Wc_1[j / v_size], j % v_size, wVals[0][j + 2 * out_size]); + Wo_1[j / v_size] = set_value(Wo_1[j / v_size], j % v_size, wVals[0][j + 3 * out_size]); + } +} + +template +void LSTMLayerT::setUVals(const std::vector>& uVals) +{ + for(int i = 0; i < out_size; ++i) + { + for(int k = 0; k < out_size; ++k) + { + Ui[k][i / v_size] = set_value(Ui[k][i / v_size], i % v_size, uVals[k][i]); + Uf[k][i / v_size] = set_value(Uf[k][i / v_size], i % v_size, uVals[k][i + out_size]); + Uc[k][i / v_size] = set_value(Uc[k][i / v_size], i % v_size, uVals[k][i + 2 * out_size]); + Uo[k][i / v_size] = set_value(Uo[k][i / v_size], i % v_size, uVals[k][i + 3 * out_size]); + } + } +} + +template +void LSTMLayerT::setBVals(const std::vector& bVals) +{ + for(int k = 0; k < out_size; ++k) + { + bi[k / v_size] = set_value(bi[k / v_size], k % v_size, bVals[k]); + bf[k / v_size] = set_value(bf[k / v_size], k % v_size, bVals[k + out_size]); + bc[k / v_size] = set_value(bc[k / v_size], k % v_size, bVals[k + 2 * out_size]); + bo[k / v_size] = set_value(bo[k / v_size], k % v_size, bVals[k + 3 * out_size]); + } +} + +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/maths/maths_eigen.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/maths/maths_eigen.h new file mode 100644 index 0000000..3f7c8be --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/maths/maths_eigen.h @@ -0,0 +1,28 @@ +#pragma once + +#include + +namespace RTNEURAL_NAMESPACE +{ +struct DefaultMathsProvider +{ + template + static auto tanh(const Matrix& x) + { + return x.array().tanh(); + } + + template + static auto sigmoid(const Matrix& x) + { + using T = typename Matrix::Scalar; + return (T)1 / (((T)-1 * x.array()).array().exp() + (T)1); + } + + template + static auto exp(const Matrix& x) + { + return x.array().exp(); + } +}; +} diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/maths/maths_stl.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/maths/maths_stl.h new file mode 100644 index 0000000..ae9d76c --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/maths/maths_stl.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +namespace RTNEURAL_NAMESPACE +{ +struct DefaultMathsProvider +{ + template + static T tanh(T x) + { + return std::tanh(x); + } + + template + static T sigmoid(T x) + { + return (T)1 / ((T)1 + std::exp(-x)); + } + + template + static T exp(T x) + { + return std::exp(x); + } +}; +} diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/maths/maths_xsimd.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/maths/maths_xsimd.h new file mode 100644 index 0000000..45a6177 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/maths/maths_xsimd.h @@ -0,0 +1,33 @@ +#pragma once + +#include + +namespace RTNEURAL_NAMESPACE +{ +struct DefaultMathsProvider +{ + template + static T tanh(T x) + { + using std::tanh; + using xsimd::tanh; + return tanh(x); + } + + template + static T sigmoid(T x) + { + using std::exp; + using xsimd::exp; + return (T)1 / ((T)1 + exp(-x)); + } + + template + static T exp(T x) + { + using std::exp; + using xsimd::exp; + return exp(x); + } +}; +} diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/model_loader.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/model_loader.h new file mode 100644 index 0000000..a727e73 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/model_loader.h @@ -0,0 +1,728 @@ +#pragma once + +#include +#include "Model.h" +#include +#include +#include + +#if !RTNEURAL_NO_DEBUG +#include +#endif + +#if defined(__cplusplus) && __cplusplus >= 201703L +#define RTNEURAL_MAYBE_UNUSED [[maybe_unused]] +#else +#define RTNEURAL_MAYBE_UNUSED +#endif + +namespace RTNEURAL_NAMESPACE +{ +/** Utility functions for loading model weights from their json representation. */ +namespace json_parser +{ +#if RTNEURAL_NO_DEBUG + RTNEURAL_MAYBE_UNUSED static void debug_print(const std::string&, bool) + { + } +#else + RTNEURAL_MAYBE_UNUSED static void debug_print(const std::string& str, bool debug) + { + if(debug) + std::cout << str << std::endl; + } +#endif + + /** Loads weights for a Dense (or DenseT) layer from a json representation of the layer weights. */ + template + void loadDense(DenseType& dense, const nlohmann::json& weights) + { + // load weights + std::vector> denseWeights(dense.out_size); + for(auto& w : denseWeights) + w.resize(dense.in_size, (T)0); + + auto layerWeights = weights.at(0); + for(size_t i = 0; i < layerWeights.size(); ++i) + { + auto lw = layerWeights.at(i); + for(size_t j = 0; j < lw.size(); ++j) + denseWeights.at(j).at(i) = lw.at(j).get(); + } + + dense.setWeights(denseWeights); + + // load biases + std::vector denseBias = weights.at(1).get>(); + dense.setBias(denseBias.data()); + } + + /** Creates a Dense layer from a json representation of the layer weights. */ + template + std::unique_ptr> createDense(int in_size, int out_size, const nlohmann::json& weights) + { + auto dense = std::make_unique>(in_size, out_size); + loadDense(*dense.get(), weights); + return std::move(dense); + } + + /** Checks that a Dense (or DenseT) layer has the given dimensions. */ + template + bool checkDense(const DenseType& dense, const std::string& type, int layerDims, const bool debug) + { + if(type != "dense" && type != "time-distributed-dense") + { + debug_print("Wrong layer type! Expected: Dense", debug); + return false; + } + + if(layerDims != dense.out_size) + { + debug_print("Wrong layer size! Expected: " + std::to_string(dense.out_size), debug); + return false; + } + + return true; + } + + /** Loads weights for a Conv1D (or Conv1DT) layer from a json representation of the layer weights. */ + template + void loadConv1D(Conv1DType& conv, int kernel_size, int /*dilation*/, const nlohmann::json& weights) + { + // load weights + std::vector>> convWeights(conv.out_size); + for(auto& wIn : convWeights) + { + wIn.resize(conv.in_size / conv.getGroups()); + + for(auto& w : wIn) + w.resize(kernel_size, (T)0); + } + + auto layerWeights = weights.at(0); + for(size_t i = 0; i < layerWeights.size(); ++i) + { + auto lw = layerWeights.at(i); + for(size_t j = 0; j < lw.size(); ++j) + { + auto l = lw.at(j); + for(size_t k = 0; k < l.size(); ++k) + convWeights.at(k).at(j).at(kernel_size - 1 - i) = l.at(k).get(); + } + } + + conv.setWeights(convWeights); + + // load biases + std::vector convBias = weights.at(1).get>(); + conv.setBias(convBias); + } + + /** Loads weights for a Conv2D (or Conv2DT) layer from a json representation of the layer weights. */ + template + void loadConv2D(Conv2DType& conv2d, const nlohmann::json& weights) + { + // load weights + std::vector>>> convWeights(conv2d.kernel_size_time); + for(auto& wOut : convWeights) + { + wOut.resize(conv2d.num_filters_out); + + for(auto& wIn : wOut) + { + wIn.resize(conv2d.num_filters_in); + + for(auto& w : wIn) + w.resize(conv2d.kernel_size_feature, (T)0); + } + } + + // In Tensorflow (JSON file): [kernel_size_time, kernel_size_feature, num_filters_in, num_filters_out] + // In RTNeural conv2d::setWeights: [kernel_size_time, num_filters_out, num_filters_in, kernel_size_feature] + auto layerWeights = weights.at(0); + // Kernel Size Time + for(size_t i = 0; i < layerWeights.size(); ++i) + { + auto l1 = layerWeights.at(i); + // Kernel Size feature + for(size_t j = 0; j < l1.size(); ++j) + { + auto l2 = l1.at(j); + // Num filters in + for(size_t k = 0; k < l2.size(); ++k) + { + auto l3 = l2.at(k); + // Num filters out + for(size_t p = 0; p < l3.size(); ++p) + convWeights.at(i).at(p).at(k).at(j) = l3.at(p).get(); + } + } + } + + conv2d.setWeights(convWeights); + + // load biases + std::vector convBias = weights.at(1).get>(); + conv2d.setBias(convBias); + } + + /** Creates a Conv1D layer from a json representation of the layer weights. */ + template + std::unique_ptr> createConv1D(int in_size, int out_size, + int kernel_size, int dilation, int groups, const nlohmann::json& weights) + { + auto conv = std::make_unique>(in_size, out_size, kernel_size, dilation, groups); + loadConv1D(*conv.get(), kernel_size, dilation, weights); + return std::move(conv); + } + + /** Checks that a Conv1D (or Conv1DT) layer has the given dimensions. */ + template + bool checkConv1D(const Conv1DType& conv, const std::string& type, int layerDims, + int kernel_size, int dilation_rate, int groups, const bool debug) + { + if(type != "conv1d") + { + debug_print("Wrong layer type! Expected: Conv1D", debug); + return false; + } + + if(layerDims != conv.out_size) + { + debug_print("Wrong layer size! Expected: " + std::to_string(conv.out_size), debug); + return false; + } + + if(kernel_size != conv.getKernelSize()) + { + debug_print("Wrong kernel size! Expected: " + std::to_string(conv.getKernelSize()), debug); + return false; + } + + if(dilation_rate != conv.getDilationRate()) + { + debug_print("Wrong dilation_rate! Expected: " + std::to_string(conv.getDilationRate()), debug); + return false; + } + + if(groups != conv.getGroups()) + { + debug_print("Wrong number of groups! Expected: " + std::to_string(conv.getGroups()), debug); + return false; + } + + return true; + } + + template + std::unique_ptr> createConv2D(int num_filters_in, int num_features_in, int num_filters_out, + int kernel_size_time, int kernel_size_feature, int dilation, int stride, bool valid_pad, const nlohmann::json& weights) + { + auto conv = std::make_unique>(num_filters_in, num_filters_out, num_features_in, kernel_size_time, kernel_size_feature, dilation, stride, valid_pad); + loadConv2D(*conv.get(), weights); + return std::move(conv); + } + + /** Checks that a Conv2D (or Conv2DT) layer has the given dimensions. */ + template + bool checkConv2D(const Conv2DType& conv, const std::string& type, int layerDims, + int kernel_size_time, int kernel_size_feature, int dilation_rate, int stride, bool /*valid_pad*/, const bool debug) + { + if(type != "conv2d") + { + debug_print("Wrong layer type! Expected: Conv2D", debug); + return false; + } + + if(layerDims != conv.out_size) + { + debug_print("Wrong layer size! Expected: " + std::to_string(conv.out_size), debug); + return false; + } + + if(kernel_size_time != conv.getKernelSizeTime()) + { + debug_print("Wrong kernel size time! Expected: " + std::to_string(conv.getKernelSizeTime()), debug); + return false; + } + + if(kernel_size_feature != conv.getKernelSizeFeature()) + { + debug_print("Wrong kernel size feature! Expected: " + std::to_string(conv.getKernelSizeFeature()), debug); + return false; + } + + if(stride != conv.getStride()) + { + debug_print("Wrong stride! Expected: " + std::to_string(conv.getStride()), debug); + return false; + } + + if(dilation_rate != conv.getDilationRate()) + { + debug_print("Wrong dilation_rate! Expected: " + std::to_string(conv.getDilationRate()), debug); + return false; + } + + return true; + } + + /** Loads weights for a GRULayer (or GRULayerT) from a json representation of the layer weights. */ + template + void loadGRU(GRUType& gru, const nlohmann::json& weights) + { + // load kernel weights + std::vector> kernelWeights(gru.in_size); + for(auto& w : kernelWeights) + w.resize(3 * gru.out_size, (T)0); + + auto layerWeights = weights.at(0); + for(size_t i = 0; i < layerWeights.size(); ++i) + { + auto lw = layerWeights.at(i); + for(size_t j = 0; j < lw.size(); ++j) + kernelWeights.at(i).at(j) = lw.at(j).get(); + } + + gru.setWVals(kernelWeights); + + // load recurrent weights + std::vector> recurrentWeights(gru.out_size); + for(auto& w : recurrentWeights) + w.resize(3 * gru.out_size, (T)0); + + auto layerWeights2 = weights.at(1); + for(size_t i = 0; i < layerWeights2.size(); ++i) + { + auto lw = layerWeights2.at(i); + for(size_t j = 0; j < lw.size(); ++j) + recurrentWeights.at(i).at(j) = lw.at(j).get(); + } + + gru.setUVals(recurrentWeights); + + // load biases + std::vector> gruBias(2); + for(auto& b : gruBias) + b.resize(3 * gru.out_size, (T)0); + + auto layerBias = weights.at(2); + for(size_t i = 0; i < layerBias.size(); ++i) + { + auto lw = layerBias.at(i); + for(size_t j = 0; j < lw.size(); ++j) + gruBias.at(i).at(j) = lw.at(j).get(); + } + + gru.setBVals(gruBias); + } + + /** Creates a GRULayer from a json representation of the layer weights. */ + template + std::unique_ptr> createGRU(int in_size, int out_size, const nlohmann::json& weights) + { + auto gru = std::make_unique>(in_size, out_size); + loadGRU(*gru.get(), weights); + return std::move(gru); + } + + /** Checks that a GRULayer (or GRULayerT) has the given dimensions. */ + template + bool checkGRU(const GRUType& gru, const std::string& type, int layerDims, const bool debug) + { + if(type != "gru") + { + debug_print("Wrong layer type! Expected: GRU", debug); + return false; + } + + if(layerDims != gru.out_size) + { + debug_print("Wrong layer size! Expected: " + std::to_string(gru.out_size), debug); + return false; + } + + return true; + } + + /** Loads weights for a LSTMLayer (or LSTMLayerT) from a json representation of the layer weights. */ + template + void loadLSTM(LSTMType& lstm, const nlohmann::json& weights) + { + // load kernel weights + std::vector> kernelWeights(lstm.in_size); + for(auto& w : kernelWeights) + w.resize(4 * lstm.out_size, (T)0); + + auto layerWeights = weights.at(0); + for(size_t i = 0; i < layerWeights.size(); ++i) + { + auto lw = layerWeights.at(i); + for(size_t j = 0; j < lw.size(); ++j) + kernelWeights.at(i).at(j) = lw.at(j).get(); + } + + lstm.setWVals(kernelWeights); + + // load recurrent weights + std::vector> recurrentWeights(lstm.out_size); + for(auto& w : recurrentWeights) + w.resize(4 * lstm.out_size, (T)0); + + auto layerWeights2 = weights.at(1); + for(size_t i = 0; i < layerWeights2.size(); ++i) + { + auto lw = layerWeights2.at(i); + for(size_t j = 0; j < lw.size(); ++j) + recurrentWeights.at(i).at(j) = lw.at(j).get(); + } + + lstm.setUVals(recurrentWeights); + + // load biases + std::vector lstmBias = weights.at(2).get>(); + lstm.setBVals(lstmBias); + } + + /** Creates a LSTMLayer from a json representation of the layer weights. */ + template + std::unique_ptr> createLSTM(int in_size, int out_size, const nlohmann::json& weights) + { + auto lstm = std::make_unique>(in_size, out_size); + loadLSTM(*lstm.get(), weights); + return std::move(lstm); + } + + /** Checks that a LSTMLayer (or LSTMLayerT) has the given dimensions. */ + template + bool checkLSTM(const LSTMType& lstm, const std::string& type, int layerDims, const bool debug) + { + if(type != "lstm") + { + debug_print("Wrong layer type! Expected: LSTM", debug); + return false; + } + + if(layerDims != lstm.out_size) + { + debug_print("Wrong layer size! Expected: " + std::to_string(lstm.out_size), debug); + return false; + } + + return true; + } + + /** Loads weights for a PReLUActivation (or PReLUActivationT) from a json representation of the layer weights. */ + template + void loadPReLU(PReLUType& prelu, const nlohmann::json& weights) + { + std::vector preluWeights = weights.at(0).at(0).get>(); + prelu.setAlphaVals(preluWeights); + } + + /** Creates a PReLUActivation from a json representation of the layer weights. */ + template + std::unique_ptr> createPReLU(int in_size, const nlohmann::json& weights) + { + auto prelu = std::make_unique>(in_size); + loadPReLU(*prelu.get(), weights); + return std::move(prelu); + } + + /** Checks that a PReLUActivation (or PReLUActivationT) has the given dimensions. */ + template + bool checkPReLU(const PReLUType& prelu, const std::string& type, int layerDims, const bool debug) + { + if(type != "prelu") + { + debug_print("Wrong layer type! Expected: PReLU", debug); + return false; + } + + if(layerDims != prelu.out_size) + { + debug_print("Wrong layer size! Expected: " + std::to_string(prelu.out_size), debug); + return false; + } + + return true; + } + + /** Loads weights for a BatchNorm1DLayer (or BatchNorm1DT) or BatchNorm2DLayer (or BatchNorm2DT) from a json representation of the layer weights. */ + template + void loadBatchNorm(BatchNormType& batch_norm, const nlohmann::json& weights, bool affine) + { + if(affine) + { + batch_norm.setGamma(weights.at(0).get>()); + batch_norm.setBeta(weights.at(1).get>()); + batch_norm.setRunningMean(weights.at(2).get>()); + batch_norm.setRunningVariance(weights.at(3).get>()); + } + else + { + batch_norm.setRunningMean(weights.at(0).get>()); + batch_norm.setRunningVariance(weights.at(1).get>()); + } + } + + /** Loads weights for a BatchNorm1DLayer (or BatchNorm1DT) from a json representation of the layer weights. */ + template + void loadBatchNorm(BatchNormType& batch_norm, const nlohmann::json& weights) + { + loadBatchNorm(batch_norm, weights, BatchNormType::is_affine); + } + + /** Creates a BatchNorm1DLayer from a json representation of the layer weights. */ + template + std::unique_ptr> createBatchNorm(int size, const nlohmann::json& weights, T epsilon) + { + auto batch_norm = std::make_unique>(size); + loadBatchNorm(*batch_norm.get(), weights, weights.size() == 4); + batch_norm->setEpsilon(epsilon); + return std::move(batch_norm); + } + + template + std::unique_ptr> createBatchNorm2D(int num_filters_in, int num_features_in, const nlohmann::json& weights, T epsilon) + { + auto batch_norm = std::make_unique>(num_filters_in, num_features_in); + loadBatchNorm(*batch_norm.get(), weights, weights.size() == 4); + batch_norm->setEpsilon(epsilon); + return std::move(batch_norm); + } + + /** Checks that a BatchNorm1DLayer (or BatchNorm1DT) has the given dimensions. */ + template + bool checkBatchNorm(const BatchNormType& batch_norm, const std::string& type, int layerDims, const nlohmann::json& weights, const bool debug) + { + if(type != "batchnorm") + { + debug_print("Wrong layer type! Expected: BatchNorm", debug); + return false; + } + + if(BatchNormType::is_affine && weights.size() != 4) + { + debug_print("Wrong layer type! Expected: \"affine\" BatchNorm", debug); + return false; + } + + if(!BatchNormType::is_affine && weights.size() != 2) + { + debug_print("Wrong layer type! Expected: non-\"affine\" BatchNorm", debug); + return false; + } + + if(layerDims != batch_norm.out_size) + { + debug_print("Wrong layer size! Expected: " + std::to_string(batch_norm.out_size), debug); + return false; + } + return true; + } + + /** Checks that a BatchNorm2DLayer (or BatchNorm2DT) has the given dimensions. */ + template + bool checkBatchNorm2D(const BatchNormType& batch_norm, const std::string& type, int layerDims, const nlohmann::json& weights, const bool debug) + { + if(type != "batchnorm2d") + { + debug_print("Wrong layer type! Expected: BatchNorm2D", debug); + return false; + } + + if(BatchNormType::is_affine && weights.size() != 4) + { + debug_print("Wrong layer type! Expected: \"affine\" BatchNorm2D", debug); + return false; + } + + if(!BatchNormType::is_affine && weights.size() != 2) + { + debug_print("Wrong layer type! Expected: non-\"affine\" BatchNorm2D", debug); + return false; + } + + if(layerDims != batch_norm.out_size) + { + debug_print("Wrong layer size! Expected: " + std::to_string(batch_norm.out_size), debug); + return false; + } + + if(weights[0].size() != batch_norm.num_filters) + { + debug_print("Wrong weight dimension! Expected: " + std::to_string(batch_norm.num_features), debug); + return false; + } + + return true; + } + + /** Creates an activation layer of a given type. */ + template + std::unique_ptr> + createActivation(const std::string& activationType, int dims) + { + if(activationType == "tanh") + return std::make_unique>(dims); + + if(activationType == "relu") + return std::make_unique>(dims); + + if(activationType == "sigmoid") + return std::make_unique>(dims); + + if(activationType == "softmax") + return std::make_unique>(dims); + + if(activationType == "elu") + return std::make_unique>(dims); + + return {}; + } + + /** Checks that an Activation layer has the given dimensions */ + template + bool checkActivation(const LayerType& actLayer, const std::string& activationType, int dims, const bool debug) + { + if(dims != actLayer.out_size) + { + debug_print("Wrong layer size! Expected: " + std::to_string(actLayer.out_size), debug); + return false; + } + + if(activationType != actLayer.getName()) + { + debug_print("Wrong layer type! Expected: " + actLayer.getName(), debug); + return false; + } + + return true; + } + + /** Creates a neural network model from a json stream. */ + template + std::unique_ptr> parseJson(const nlohmann::json& parent, const bool debug = false) + { + auto shape = parent.at("in_shape"); + auto layers = parent.at("layers"); + + if(!shape.is_array() || !layers.is_array()) + return {}; + + const int nDims = shape.size() == 4 ? shape[2].get() * shape[3].get() : shape.back().get(); + + debug_print("# dimensions: " + std::to_string(nDims), debug); + + auto model = std::make_unique>(nDims); + + for(const auto& l : layers) + { + const auto type = l.at("type").get(); + debug_print("Layer: " + type, debug); + + const auto layerShape = l.at("shape"); + + // In case of 4 dimensional input (conv2d): multiply channel axis and feature axis to get layer dim + const int layerDims = layerShape.size() == 4 ? layerShape[2].get() * layerShape[3].get() : layerShape.back().get(); + + debug_print(" Dims: " + std::to_string(layerDims), debug); + + const auto weights = l.at("weights"); + + auto add_activation = [=](std::unique_ptr>& _model, const nlohmann::json& _l) + { + if(_l.contains("activation")) + { + const auto activationType = _l["activation"].get(); + if(!activationType.empty()) + { + debug_print(" activation: " + activationType, debug); + auto activation = createActivation(activationType, layerDims); + _model->addLayer(activation.release()); + } + } + }; + + if(type == "dense" || type == "time-distributed-dense") + { + auto dense = createDense(model->getNextInSize(), layerDims, weights); + model->addLayer(dense.release()); + add_activation(model, l); + } + else if(type == "conv1d") + { + const auto kernel_size = l.at("kernel_size").back().get(); + const auto dilation = l.at("dilation").back().get(); + const auto groups = l.value("groups", 1); + + auto conv = createConv1D(model->getNextInSize(), layerDims, kernel_size, dilation, groups, weights); + model->addLayer(conv.release()); + add_activation(model, l); + } + else if(type == "conv2d") + { + const auto kernel_size_time = l.at("kernel_size_time").back().get(); + const auto kernel_size_feature = l.at("kernel_size_feature").back().get(); + const auto dilation = l.at("dilation").back().get(); + const auto stride = l.at("strides").back().get(); + const auto num_filters_in = l.at("num_filters_in").back().get(); + const auto num_features_in = l.at("num_features_in").back().get(); + const auto num_filters_out = l.at("num_filters_out").back().get(); + const bool valid_pad = l.at("padding").get() == "valid"; + + auto conv = createConv2D(num_filters_in, num_features_in, num_filters_out, kernel_size_time, kernel_size_feature, dilation, stride, valid_pad, weights); + + // Check the layer + if(!checkConv2D(*conv, "conv2d", layerDims, kernel_size_time, kernel_size_feature, dilation, stride, valid_pad, debug)) + return {}; + + model->addLayer(conv.release()); + add_activation(model, l); + } + else if(type == "gru") + { + auto gru = createGRU(model->getNextInSize(), layerDims, weights); + model->addLayer(gru.release()); + } + else if(type == "lstm") + { + auto lstm = createLSTM(model->getNextInSize(), layerDims, weights); + model->addLayer(lstm.release()); + } + else if(type == "prelu") + { + auto prelu = createPReLU(model->getNextInSize(), weights); + model->addLayer(prelu.release()); + } + else if(type == "batchnorm") + { + auto batch_norm = createBatchNorm(model->getNextInSize(), weights, l.at("epsilon").get()); + model->addLayer(batch_norm.release()); + } + else if(type == "batchnorm2d") + { + auto batch_norm = createBatchNorm2D(l.at("num_filters_in"), l.at("num_features_in"), weights, l.at("epsilon").get()); + model->addLayer(batch_norm.release()); + } + else if(type == "activation") + { + add_activation(model, l); + } + } + + return std::move(model); + } + + /** Creates a neural network model from a json stream. */ + template + std::unique_ptr> parseJson(std::ifstream& jsonStream, const bool debug = false) + { + nlohmann::json parent; + jsonStream >> parent; + return parseJson(parent, debug); + } + +} // namespace json_parser +} // namespace RTNEURAL_NAMESPACE diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/torch_helpers.h b/JammLab/Transcription/Native/ThirdParty/RTNeural/torch_helpers.h new file mode 100644 index 0000000..25401fc --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/torch_helpers.h @@ -0,0 +1,151 @@ +#pragma once + +#include "model_loader.h" + +namespace RTNEURAL_NAMESPACE +{ +namespace torch_helpers +{ + namespace detail + { + /** Torch Conv1D layers store their kernel weights in reverse order. */ + template + void reverseKernels(std::vector>>& conv_weights) + { + for(auto& channel_weights : conv_weights) + { + for(auto& kernel : channel_weights) + { + std::reverse(kernel.begin(), kernel.end()); + } + } + } + + /** Transposes the rows and columns of a matrix stored as a 2D vector. */ + template + std::vector> transpose(const std::vector>& x) + { + auto outer_size = x.size(); + auto inner_size = x[0].size(); + std::vector> y(inner_size, std::vector(outer_size, (T)0)); + + for(size_t i = 0; i < outer_size; ++i) + { + for(size_t j = 0; j < inner_size; ++j) + y[j][i] = x[i][j]; + } + + return y; + } + + /** Swaps the "r" and "z" indexes of a GRU layer weights. */ + template + void swap_rz(std::vector>& vec2d, int size) + { + for(auto& vec : vec2d) + std::swap_ranges(vec.begin(), vec.begin() + size, vec.begin() + size); + } + } + + /** Loads a Dense layer from a JSON object containing a PyTorch state_dict. */ + template + void loadDense(const nlohmann::json& modelJson, const std::string& layerPrefix, DenseType& dense, bool hasBias = true) + { + const std::vector> dense_weights = modelJson.at(layerPrefix + "weight"); + dense.setWeights(dense_weights); + + if(hasBias) + { + const std::vector dense_bias = modelJson.at(layerPrefix + "bias"); + dense.setBias(dense_bias.data()); + } + else + { + const std::vector dense_bias((size_t)dense.out_size, (T)0); + dense.setBias(dense_bias.data()); + } + } + + /** Loads a Conv1D layer from a JSON object containing a PyTorch state_dict. */ + template + void loadConv1D(const nlohmann::json& modelJson, const std::string& layerPrefix, Conv1DType& conv, bool hasBias = true) + { + std::vector>> conv_weights = modelJson.at(layerPrefix + "weight"); + detail::reverseKernels(conv_weights); + conv.setWeights(conv_weights); + + if(hasBias) + { + std::vector conv_bias = modelJson.at(layerPrefix + "bias"); + conv.setBias(conv_bias); + } + else + { + std::vector conv_bias((size_t)conv.out_size, (T)0); + conv.setBias(conv_bias); + } + } + + /** Loads a GRU layer from a JSON object containing a PyTorch state_dict. */ + template + void loadGRU(const nlohmann::json& modelJson, const std::string& layerPrefix, GRUType& gru, bool hasBias = true) + { + // For the kernel and recurrent weights, PyTorch stores the weights similar to the + // Tensorflow format, but transposed, and with the "r" and "z" indexes swapped. + + const std::vector> gru_ih_weights = modelJson.at(layerPrefix + "weight_ih_l0"); + auto wVals = detail::transpose(gru_ih_weights); + detail::swap_rz(wVals, gru.out_size); + gru.setWVals(wVals); + + const std::vector> gru_hh_weights = modelJson.at(layerPrefix + "weight_hh_l0"); + auto uVals = detail::transpose(gru_hh_weights); + detail::swap_rz(uVals, gru.out_size); + gru.setUVals(uVals); + + // PyTorch stores the GRU bias pretty much the same as TensorFlow as well, + // just in two separate vectors. And again, we need to swap the "r" and "z" parts. + + if(hasBias) + { + const std::vector gru_ih_bias = modelJson.at(layerPrefix + "bias_ih_l0"); + const std::vector gru_hh_bias = modelJson.at(layerPrefix + "bias_hh_l0"); + std::vector> gru_bias { gru_ih_bias, gru_hh_bias }; + detail::swap_rz(gru_bias, gru.out_size); + gru.setBVals(gru_bias); + } + else + { + const std::vector gru_ih_bias((size_t)gru.out_size * 3, (T)0); + const std::vector gru_hh_bias((size_t)gru.out_size * 3, (T)0); + std::vector> gru_bias { gru_ih_bias, gru_hh_bias }; + gru.setBVals(gru_bias); + } + } + + /** Loads a LSTM layer from a JSON object containing a PyTorch state_dict. */ + template + void loadLSTM(const nlohmann::json& modelJson, const std::string& layerPrefix, LSTMType& lstm, bool hasBias = true) + { + const std::vector> lstm_weights_ih = modelJson.at(layerPrefix + "weight_ih_l0"); + lstm.setWVals(detail::transpose(lstm_weights_ih)); + + const std::vector> lstm_weights_hh = modelJson.at(layerPrefix + "weight_hh_l0"); + lstm.setUVals(detail::transpose(lstm_weights_hh)); + + if(hasBias) + { + std::vector lstm_bias_ih = modelJson.at(layerPrefix + "bias_ih_l0"); + std::vector lstm_bias_hh = modelJson.at(layerPrefix + "bias_hh_l0"); + for(size_t i = 0; i < lstm_bias_ih.size(); ++i) + lstm_bias_hh[i] += lstm_bias_ih[i]; + lstm.setBVals(lstm_bias_hh); + } + else + { + std::vector lstm_bias_hh((size_t)lstm.out_size * 4, (T)0); + lstm.setBVals(lstm_bias_hh); + } + } +} +} diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/xsimd-legacy/README.md b/JammLab/Transcription/Native/ThirdParty/RTNeural/xsimd-legacy/README.md new file mode 100644 index 0000000..c46749a --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/xsimd-legacy/README.md @@ -0,0 +1,7 @@ +algorithms.hpp used to exist, and some functions are used some functions +in RTNeural. Later on, xsimd removed this file from the public API as +they were alternative implementation for C++17/20 standard APIs. +We are not replacing those functions to maintain compatibility with +older C++ versions. Hence importing this file here. + +For more details, see: https://github.com/jatinchowdhury18/RTNeural/pull/81 diff --git a/JammLab/Transcription/Native/ThirdParty/RTNeural/xsimd-legacy/algorithms/algorithms.hpp b/JammLab/Transcription/Native/ThirdParty/RTNeural/xsimd-legacy/algorithms/algorithms.hpp new file mode 100644 index 0000000..8831c30 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/RTNeural/xsimd-legacy/algorithms/algorithms.hpp @@ -0,0 +1,201 @@ +/*************************************************************************** + * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and * + * Martin Renou * + * Copyright (c) QuantStack * + * Copyright (c) Serge Guelton * + * * + * Distributed under the terms of the BSD 3-Clause License. * + * * + * The full license is in the file LICENSE, distributed with this software. * + ****************************************************************************/ + +#ifndef XSIMD_ALGORITHMS_HPP +#define XSIMD_ALGORITHMS_HPP + +#include +#include +#include +#include + +#include + +namespace xsimd +{ + template + void transform(I1 first, I2 last, O1 out_first, UF&& f) noexcept + { + using value_type = typename std::decay::type; + using batch_type = batch; + + std::size_t size = static_cast(std::distance(first, last)); + std::size_t simd_size = batch_type::size; + + const auto* ptr_begin = &(*first); + auto* ptr_out = &(*out_first); + + std::size_t align_begin = xsimd::get_alignment_offset(ptr_begin, size, simd_size); + std::size_t out_align = xsimd::get_alignment_offset(ptr_out, size, simd_size); + std::size_t align_end = align_begin + ((size - align_begin) & ~(simd_size - 1)); + + if (align_begin == out_align) + { + for (std::size_t i = 0; i < align_begin; ++i) + { + out_first[i] = f(first[i]); + } + + for (std::size_t i = align_begin; i < align_end; i += simd_size) + { + batch_type batch = batch_type::load_aligned(&first[i]); + xsimd::store_aligned(&out_first[i], f(batch)); + } + + for (std::size_t i = align_end; i < size; ++i) + { + out_first[i] = f(first[i]); + } + } + else + { + for (std::size_t i = 0; i < align_begin; ++i) + { + out_first[i] = f(first[i]); + } + + for (std::size_t i = align_begin; i < align_end; i += simd_size) + { + batch_type batch = batch_type::load_aligned(&first[i]); + xsimd::store_unaligned(&out_first[i], f(batch)); + } + + for (std::size_t i = align_end; i < size; ++i) + { + out_first[i] = f(first[i]); + } + } + } + + template + void transform(I1 first_1, I2 last_1, I3 first_2, O1 out_first, UF&& f) noexcept + { + using value_type = typename std::decay::type; + using batch_type = batch; + + std::size_t size = static_cast(std::distance(first_1, last_1)); + std::size_t simd_size = batch_type::size; + + const auto* ptr_begin_1 = &(*first_1); + const auto* ptr_begin_2 = &(*first_2); + auto* ptr_out = &(*out_first); + + std::size_t align_begin_1 = xsimd::get_alignment_offset(ptr_begin_1, size, simd_size); + std::size_t align_begin_2 = xsimd::get_alignment_offset(ptr_begin_2, size, simd_size); + std::size_t out_align = xsimd::get_alignment_offset(ptr_out, size, simd_size); + std::size_t align_end = align_begin_1 + ((size - align_begin_1) & ~(simd_size - 1)); + +#define XSIMD_LOOP_MACRO(A1, A2, A3) \ + for (std::size_t i = 0; i < align_begin_1; ++i) \ + { \ + out_first[i] = f(first_1[i], first_2[i]); \ + } \ + \ + batch_type batch_1, batch_2; \ + for (std::size_t i = align_begin_1; i < align_end; i += simd_size) \ + { \ + batch_1 = batch_type::A1(&first_1[i]); \ + batch_2 = batch_type::A2(&first_2[i]); \ + xsimd::A3(&out_first[i], f(batch_1, batch_2)); \ + } \ + \ + for (std::size_t i = align_end; i < size; ++i) \ + { \ + out_first[i] = f(first_1[i], first_2[i]); \ + } + + if (align_begin_1 == out_align && align_begin_1 == align_begin_2) + { + XSIMD_LOOP_MACRO(load_aligned, load_aligned, store_aligned); + } + else if (align_begin_1 == out_align && align_begin_1 != align_begin_2) + { + XSIMD_LOOP_MACRO(load_aligned, load_unaligned, store_aligned); + } + else if (align_begin_1 != out_align && align_begin_1 == align_begin_2) + { + XSIMD_LOOP_MACRO(load_aligned, load_aligned, store_unaligned); + } + else if (align_begin_1 != out_align && align_begin_1 != align_begin_2) + { + XSIMD_LOOP_MACRO(load_aligned, load_unaligned, store_unaligned); + } + +#undef XSIMD_LOOP_MACRO + } + + // TODO: Remove this once we drop C++11 support + namespace detail + { + struct plus + { + template + auto operator()(X&& x, Y&& y) noexcept -> decltype(x + y) { return x + y; } + }; + } + + template + Init reduce(Iterator1 first, Iterator2 last, Init init, BinaryFunction&& binfun = detail::plus {}) noexcept + { + using value_type = typename std::decay::type; + using batch_type = batch; + + std::size_t size = static_cast(std::distance(first, last)); + constexpr std::size_t simd_size = batch_type::size; + + if (size < simd_size) + { + while (first != last) + { + init = binfun(init, *first++); + } + return init; + } + + const auto* const ptr_begin = &(*first); + + std::size_t align_begin = xsimd::get_alignment_offset(ptr_begin, size, simd_size); + std::size_t align_end = align_begin + ((size - align_begin) & ~(simd_size - 1)); + + // reduce initial unaligned part + for (std::size_t i = 0; i < align_begin; ++i) + { + init = binfun(init, first[i]); + } + + // reduce aligned part + auto ptr = ptr_begin + align_begin; + batch_type batch_init = batch_type::load_aligned(ptr); + ptr += simd_size; + for (auto const end = ptr_begin + align_end; ptr < end; ptr += simd_size) + { + batch_type batch = batch_type::load_aligned(ptr); + batch_init = binfun(batch_init, batch); + } + + // reduce across batch + alignas(batch_type) std::array arr; + xsimd::store_aligned(arr.data(), batch_init); + for (auto x : arr) + init = binfun(init, x); + + // reduce final unaligned part + for (std::size_t i = align_end; i < size; ++i) + { + init = binfun(init, first[i]); + } + + return init; + } + +} + +#endif diff --git a/JammLab/Transcription/Native/ThirdParty/nlohmann/json.hpp b/JammLab/Transcription/Native/ThirdParty/nlohmann/json.hpp new file mode 100644 index 0000000..beee013 --- /dev/null +++ b/JammLab/Transcription/Native/ThirdParty/nlohmann/json.hpp @@ -0,0 +1,24441 @@ +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + +/****************************************************************************\ + * Note on documentation: The source files contain links to the online * + * documentation of the public API at https://json.nlohmann.me. This URL * + * contains the most recent documentation and should also be applicable to * + * previous versions; documentation for deprecated functions is not * + * removed, but marked deprecated. See "Generate documentation" section in * + * file docs/README.md. * +\****************************************************************************/ + +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ + +#include // all_of, find, for_each +#include // nullptr_t, ptrdiff_t, size_t +#include // hash, less +#include // initializer_list +#ifndef JSON_NO_IO + #include // istream, ostream +#endif // JSON_NO_IO +#include // random_access_iterator_tag +#include // unique_ptr +#include // accumulate +#include // string, stoi, to_string +#include // declval, forward, move, pair, swap +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// This file contains all macro definitions affecting or depending on the ABI + +#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK + #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH) + #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 11 || NLOHMANN_JSON_VERSION_PATCH != 1 + #warning "Already included a different version of the library!" + #endif + #endif +#endif + +#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_MINOR 11 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_PATCH 1 // NOLINT(modernize-macro-to-enum) + +#ifndef JSON_DIAGNOSTICS + #define JSON_DIAGNOSTICS 0 +#endif + +#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0 +#endif + +#if JSON_DIAGNOSTICS + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag +#else + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS +#endif + +#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp +#else + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON +#endif + +#define NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch) \ + json_v ## major ## _ ## minor ## _ ## patch +#define NLOHMANN_JSON_ABI_PREFIX(major, minor, patch) \ + NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch) + +#define NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c) a ## b ## c +#define NLOHMANN_JSON_ABI_CONCAT(a, b, c) \ + NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c) + +#define NLOHMANN_JSON_ABI_STRING \ + NLOHMANN_JSON_ABI_CONCAT( \ + NLOHMANN_JSON_ABI_PREFIX( \ + NLOHMANN_JSON_VERSION_MAJOR, \ + NLOHMANN_JSON_VERSION_MINOR, \ + NLOHMANN_JSON_VERSION_PATCH), \ + NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \ + NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON) + +#ifndef NLOHMANN_JSON_NAMESPACE + #define NLOHMANN_JSON_NAMESPACE nlohmann::NLOHMANN_JSON_ABI_STRING +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN +#define NLOHMANN_JSON_NAMESPACE_BEGIN \ + namespace nlohmann \ + { \ + inline namespace NLOHMANN_JSON_ABI_STRING \ + { +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_END +#define NLOHMANN_JSON_NAMESPACE_END \ + } /* namespace (abi_string) */ \ + } /* namespace nlohmann */ +#endif + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // transform +#include // array +#include // forward_list +#include // inserter, front_inserter, end +#include // map +#include // string +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // unordered_map +#include // pair, declval +#include // valarray + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // nullptr_t +#include // exception +#include // runtime_error +#include // to_string +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // uint8_t +#include // string + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // declval, pair +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template struct make_void +{ + using type = void; +}; +template using void_t = typename make_void::type; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +// https://en.cppreference.com/w/cpp/experimental/is_detected +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template class Op, class... Args> +using is_detected = typename detector::value_t; + +template class Op, class... Args> +struct is_detected_lazy : is_detected { }; + +template class Op, class... Args> +using detected_t = typename detector::type; + +template class Op, class... Args> +using detected_or = detector; + +template class Op, class... Args> +using detected_or_t = typename detected_or::type; + +template class Op, class... Args> +using is_detected_exact = std::is_same>; + +template class Op, class... Args> +using is_detected_convertible = + std::is_convertible, To>; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + + +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-FileCopyrightText: 2016-2021 Evan Nemerson +// SPDX-License-Identifier: MIT + +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION +#endif +#define JSON_HEDLEY_VERSION 15 + +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x + +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) + +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT +#endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) + +#if defined(JSON_HEDLEY_CONCAT3_EX) + #undef JSON_HEDLEY_CONCAT3_EX +#endif +#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c + +#if defined(JSON_HEDLEY_CONCAT3) + #undef JSON_HEDLEY_CONCAT3 +#endif +#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c) + +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE +#endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION +#endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(JSON_HEDLEY_MSVC_VERSION) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #undef JSON_HEDLEY_INTEL_CL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL) + #define JSON_HEDLEY_INTEL_CL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_CL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if \ + defined(__TI_COMPILER_VERSION__) && \ + ( \ + defined(__TMS470__) || defined(__TI_ARM__) || \ + defined(__MSP430__) || \ + defined(__TMS320C2000__) \ + ) +#if (__TI_COMPILER_VERSION__ >= 16000000) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif +#endif + +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #undef JSON_HEDLEY_TI_CL2000_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) + #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #undef JSON_HEDLEY_TI_CL430_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) + #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #undef JSON_HEDLEY_TI_ARMCL_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) + #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK) + #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #undef JSON_HEDLEY_TI_CL6X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) + #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #undef JSON_HEDLEY_TI_CL7X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) + #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #undef JSON_HEDLEY_TI_CLPRU_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) + #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #undef JSON_HEDLEY_MCST_LCC_VERSION +#endif +#if defined(__LCC__) && defined(__LCC_MINOR__) + #define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK) + #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_MCST_LCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_CRAY_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL430_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \ + !defined(__COMPCERT__) && \ + !defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if \ + defined(__has_attribute) && \ + ( \ + (!defined(JSON_HEDLEY_IAR_VERSION) || JSON_HEDLEY_IAR_VERSION_CHECK(8,5,9)) \ + ) +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if \ + defined(__has_cpp_attribute) && \ + defined(__cplusplus) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#endif +#if !defined(__cplusplus) || !defined(__has_cpp_attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#elif \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) +#else + #define JSON_HEDLEY_PRAGMA(value) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP +#endif + +/* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat") +# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions") +# if JSON_HEDLEY_HAS_WARNING("-Wc++1z-extensions") +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# endif +#endif +#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x +#endif + +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast") +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ + ((T) (expr)) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0) +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("diag_suppress=Pe137") \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr)) +# endif +#else +# define JSON_HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunused-function") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(1,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif + +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED +#endif +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif \ + (JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif defined(__cplusplus) && (__cplusplus >= 201402L) + #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define JSON_HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) +#elif (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) +#elif defined(_Check_return_) /* SAL */ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ +#else + #define JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) +#endif + +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define JSON_HEDLEY_SENTINEL(position) +#endif + +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN +#endif +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define JSON_HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define JSON_HEDLEY_NO_RETURN +#endif + +#if defined(JSON_HEDLEY_NO_ESCAPE) + #undef JSON_HEDLEY_NO_ESCAPE +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape) + #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__)) +#else + #define JSON_HEDLEY_NO_ESCAPE +#endif + +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE +#endif +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN +#endif +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #if defined(__cplusplus) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif defined(JSON_HEDLEY_ASSUME) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif +#if !defined(JSON_HEDLEY_ASSUME) + #if defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1))) + #else + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr) + #endif +#endif +#if defined(JSON_HEDLEY_UNREACHABLE) + #if \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value)) + #else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() + #endif +#else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value) +#endif +#if !defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif + +JSON_HEDLEY_DIAGNOSTIC_PUSH +#if JSON_HEDLEY_HAS_WARNING("-Wpedantic") + #pragma clang diagnostic ignored "-Wpedantic" +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) + #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(JSON_HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define JSON_HEDLEY_NON_NULL(...) +#endif +JSON_HEDLEY_DIAGNOSTIC_POP + +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) + #endif +#endif +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR +#endif + +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT +#endif +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY +#endif +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY +#endif +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE +#endif +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(JSON_HEDLEY_PGI_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) +#elif \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) +#else + #define JSON_HEDLEY_MALLOC +#endif + +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) +# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data") +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ + ) +# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_CONST __attribute__((__const__)) +#elif \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_CONST _Pragma("no_side_effect") +#else + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT restrict +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict +#else + #define JSON_HEDLEY_RESTRICT +#endif + +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define JSON_HEDLEY_INLINE inline +#elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_INLINE __inline +#else + #define JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) +# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ + ) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define JSON_HEDLEY_NEVER_INLINE +#endif + +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE +#endif +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC +#endif +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC __declspec(dllexport) +# define JSON_HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + ( \ + defined(__TI_EABI__) && \ + ( \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ + ) \ + ) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC +# endif +# define JSON_HEDLEY_IMPORT extern +#endif + +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) +#else + #define JSON_HEDLEY_NO_THROW +#endif + +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) +#elif defined(__fallthrough) /* SAL */ + #define JSON_HEDLEY_FALL_THROUGH __fallthrough +#else + #define JSON_HEDLEY_FALL_THROUGH +#endif + +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define JSON_HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) +#else + #define JSON_HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT +#endif +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#endif +/* JSON_HEDLEY_IS_CONSTEXPR_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #undef JSON_HEDLEY_IS_CONSTEXPR_ +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + ( \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ + !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION)) || \ + (JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ + defined(JSON_HEDLEY_TI_CL2000_VERSION) || \ + defined(JSON_HEDLEY_TI_CL6X_VERSION) || \ + defined(JSON_HEDLEY_TI_CL7X_VERSION) || \ + defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \ + defined(__clang__) +# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) +#else + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS +#endif +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS +#endif +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" +#else + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL +#endif + +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + (JSON_HEDLEY_HAS_FEATURE(c_static_assert) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) +#else +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(JSON_HEDLEY_NULL) + #undef JSON_HEDLEY_NULL +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL + #else + #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) + #endif +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL +#else + #define JSON_HEDLEY_NULL ((void*) 0) +#endif + +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE +#endif +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE(expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), #expr, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), msg, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) +# endif +#else +# define JSON_HEDLEY_REQUIRE(expr) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) +#endif + +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || JSON_HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion")) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#else + #define JSON_HEDLEY_FLAGS +#endif + +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST +#endif +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) +#endif + +#if defined(JSON_HEDLEY_EMPTY_BASES) + #undef JSON_HEDLEY_EMPTY_BASES +#endif +#if \ + (JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases) +#else + #define JSON_HEDLEY_EMPTY_BASES +#endif + +/* Remaining macros are deprecated. */ + +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#endif +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) + +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE +#endif +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) + +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#endif +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) + +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING +#endif +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ + + +// This file contains all internal macro definitions (except those affecting ABI) +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// #include + + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// C++ language standard detection +// if the user manually specified the used c++ version this is skipped +#if !defined(JSON_HAS_CPP_20) && !defined(JSON_HAS_CPP_17) && !defined(JSON_HAS_CPP_14) && !defined(JSON_HAS_CPP_11) + #if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 + #endif + // the cpp 11 flag is always specified because it is the minimal required version + #define JSON_HAS_CPP_11 +#endif + +#ifdef __has_include + #if __has_include() + #include + #endif +#endif + +#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM) + #ifdef JSON_HAS_CPP_17 + #if defined(__cpp_lib_filesystem) + #define JSON_HAS_FILESYSTEM 1 + #elif defined(__cpp_lib_experimental_filesystem) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif !defined(__has_include) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #endif + + // std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/ + #if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before GCC 8: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before Clang 7: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__clang_major__) && __clang_major__ < 7 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before MSVC 19.14: https://en.cppreference.com/w/cpp/compiler_support + #if defined(_MSC_VER) && _MSC_VER < 1914 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before iOS 13 + #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before macOS Catalina + #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + #endif +#endif + +#ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_FILESYSTEM + #define JSON_HAS_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_THREE_WAY_COMPARISON + #if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L \ + && defined(__cpp_lib_three_way_comparison) && __cpp_lib_three_way_comparison >= 201907L + #define JSON_HAS_THREE_WAY_COMPARISON 1 + #else + #define JSON_HAS_THREE_WAY_COMPARISON 0 + #endif +#endif + +#ifndef JSON_HAS_RANGES + // ranges header shipping in GCC 11.1.0 (released 2021-04-27) has syntax error + #if defined(__GLIBCXX__) && __GLIBCXX__ == 20210427 + #define JSON_HAS_RANGES 0 + #elif defined(__cpp_lib_ranges) + #define JSON_HAS_RANGES 1 + #else + #define JSON_HAS_RANGES 0 + #endif +#endif + +#ifdef JSON_HAS_CPP_17 + #define JSON_INLINE_VARIABLE inline +#else + #define JSON_INLINE_VARIABLE +#endif + +#if JSON_HEDLEY_HAS_ATTRIBUTE(no_unique_address) + #define JSON_NO_UNIQUE_ADDRESS [[no_unique_address]] +#else + #define JSON_NO_UNIQUE_ADDRESS +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdocumentation" + #pragma clang diagnostic ignored "-Wdocumentation-unknown-command" +#endif + +// allow disabling exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +// allow overriding assert +#if !defined(JSON_ASSERT) + #include // assert + #define JSON_ASSERT(x) assert(x) +#endif + +// allow to access some private functions (needed by the test suite) +#if defined(JSON_TESTS_PRIVATE) + #define JSON_PRIVATE_UNLESS_TESTED public +#else + #define JSON_PRIVATE_UNLESS_TESTED private +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [&j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template class ObjectType, \ + template class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template class AllocatorType, \ + template class JSONSerializer, \ + class BinaryType> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json + +// Macros to simplify conversion from/to types + +#define NLOHMANN_JSON_EXPAND( x ) x +#define NLOHMANN_JSON_GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, NAME,...) NAME +#define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \ + NLOHMANN_JSON_PASTE64, \ + NLOHMANN_JSON_PASTE63, \ + NLOHMANN_JSON_PASTE62, \ + NLOHMANN_JSON_PASTE61, \ + NLOHMANN_JSON_PASTE60, \ + NLOHMANN_JSON_PASTE59, \ + NLOHMANN_JSON_PASTE58, \ + NLOHMANN_JSON_PASTE57, \ + NLOHMANN_JSON_PASTE56, \ + NLOHMANN_JSON_PASTE55, \ + NLOHMANN_JSON_PASTE54, \ + NLOHMANN_JSON_PASTE53, \ + NLOHMANN_JSON_PASTE52, \ + NLOHMANN_JSON_PASTE51, \ + NLOHMANN_JSON_PASTE50, \ + NLOHMANN_JSON_PASTE49, \ + NLOHMANN_JSON_PASTE48, \ + NLOHMANN_JSON_PASTE47, \ + NLOHMANN_JSON_PASTE46, \ + NLOHMANN_JSON_PASTE45, \ + NLOHMANN_JSON_PASTE44, \ + NLOHMANN_JSON_PASTE43, \ + NLOHMANN_JSON_PASTE42, \ + NLOHMANN_JSON_PASTE41, \ + NLOHMANN_JSON_PASTE40, \ + NLOHMANN_JSON_PASTE39, \ + NLOHMANN_JSON_PASTE38, \ + NLOHMANN_JSON_PASTE37, \ + NLOHMANN_JSON_PASTE36, \ + NLOHMANN_JSON_PASTE35, \ + NLOHMANN_JSON_PASTE34, \ + NLOHMANN_JSON_PASTE33, \ + NLOHMANN_JSON_PASTE32, \ + NLOHMANN_JSON_PASTE31, \ + NLOHMANN_JSON_PASTE30, \ + NLOHMANN_JSON_PASTE29, \ + NLOHMANN_JSON_PASTE28, \ + NLOHMANN_JSON_PASTE27, \ + NLOHMANN_JSON_PASTE26, \ + NLOHMANN_JSON_PASTE25, \ + NLOHMANN_JSON_PASTE24, \ + NLOHMANN_JSON_PASTE23, \ + NLOHMANN_JSON_PASTE22, \ + NLOHMANN_JSON_PASTE21, \ + NLOHMANN_JSON_PASTE20, \ + NLOHMANN_JSON_PASTE19, \ + NLOHMANN_JSON_PASTE18, \ + NLOHMANN_JSON_PASTE17, \ + NLOHMANN_JSON_PASTE16, \ + NLOHMANN_JSON_PASTE15, \ + NLOHMANN_JSON_PASTE14, \ + NLOHMANN_JSON_PASTE13, \ + NLOHMANN_JSON_PASTE12, \ + NLOHMANN_JSON_PASTE11, \ + NLOHMANN_JSON_PASTE10, \ + NLOHMANN_JSON_PASTE9, \ + NLOHMANN_JSON_PASTE8, \ + NLOHMANN_JSON_PASTE7, \ + NLOHMANN_JSON_PASTE6, \ + NLOHMANN_JSON_PASTE5, \ + NLOHMANN_JSON_PASTE4, \ + NLOHMANN_JSON_PASTE3, \ + NLOHMANN_JSON_PASTE2, \ + NLOHMANN_JSON_PASTE1)(__VA_ARGS__)) +#define NLOHMANN_JSON_PASTE2(func, v1) func(v1) +#define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2) +#define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3) +#define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4) +#define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5) +#define NLOHMANN_JSON_PASTE7(func, v1, v2, v3, v4, v5, v6) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE6(func, v2, v3, v4, v5, v6) +#define NLOHMANN_JSON_PASTE8(func, v1, v2, v3, v4, v5, v6, v7) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE7(func, v2, v3, v4, v5, v6, v7) +#define NLOHMANN_JSON_PASTE9(func, v1, v2, v3, v4, v5, v6, v7, v8) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE8(func, v2, v3, v4, v5, v6, v7, v8) +#define NLOHMANN_JSON_PASTE10(func, v1, v2, v3, v4, v5, v6, v7, v8, v9) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE9(func, v2, v3, v4, v5, v6, v7, v8, v9) +#define NLOHMANN_JSON_PASTE11(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE10(func, v2, v3, v4, v5, v6, v7, v8, v9, v10) +#define NLOHMANN_JSON_PASTE12(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE11(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) +#define NLOHMANN_JSON_PASTE13(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE12(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) +#define NLOHMANN_JSON_PASTE14(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE13(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) +#define NLOHMANN_JSON_PASTE15(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE14(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) +#define NLOHMANN_JSON_PASTE16(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE15(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) +#define NLOHMANN_JSON_PASTE17(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE16(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) +#define NLOHMANN_JSON_PASTE18(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE17(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) +#define NLOHMANN_JSON_PASTE19(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE18(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) +#define NLOHMANN_JSON_PASTE20(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE19(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) +#define NLOHMANN_JSON_PASTE21(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE20(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) +#define NLOHMANN_JSON_PASTE22(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE21(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) +#define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE22(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) +#define NLOHMANN_JSON_PASTE24(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE23(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) +#define NLOHMANN_JSON_PASTE25(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE24(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) +#define NLOHMANN_JSON_PASTE26(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE25(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) +#define NLOHMANN_JSON_PASTE27(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE26(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) +#define NLOHMANN_JSON_PASTE28(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE27(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) +#define NLOHMANN_JSON_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE28(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) +#define NLOHMANN_JSON_PASTE30(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE29(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) +#define NLOHMANN_JSON_PASTE31(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE30(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) +#define NLOHMANN_JSON_PASTE32(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE31(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) +#define NLOHMANN_JSON_PASTE33(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE32(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) +#define NLOHMANN_JSON_PASTE34(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE33(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) +#define NLOHMANN_JSON_PASTE35(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE34(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) +#define NLOHMANN_JSON_PASTE36(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE35(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) +#define NLOHMANN_JSON_PASTE37(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE36(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) +#define NLOHMANN_JSON_PASTE38(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE37(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) +#define NLOHMANN_JSON_PASTE39(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE38(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) +#define NLOHMANN_JSON_PASTE40(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE39(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) +#define NLOHMANN_JSON_PASTE41(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE40(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) +#define NLOHMANN_JSON_PASTE42(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE41(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) +#define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE42(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) +#define NLOHMANN_JSON_PASTE44(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE43(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) +#define NLOHMANN_JSON_PASTE45(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE44(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) +#define NLOHMANN_JSON_PASTE46(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE45(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) +#define NLOHMANN_JSON_PASTE47(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE46(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) +#define NLOHMANN_JSON_PASTE48(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE47(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) +#define NLOHMANN_JSON_PASTE49(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE48(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) +#define NLOHMANN_JSON_PASTE50(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE49(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) +#define NLOHMANN_JSON_PASTE51(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE50(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) +#define NLOHMANN_JSON_PASTE52(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE51(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) +#define NLOHMANN_JSON_PASTE53(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE52(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) +#define NLOHMANN_JSON_PASTE54(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE53(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) +#define NLOHMANN_JSON_PASTE55(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE54(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) +#define NLOHMANN_JSON_PASTE56(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE55(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) +#define NLOHMANN_JSON_PASTE57(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE56(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) +#define NLOHMANN_JSON_PASTE58(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE57(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) +#define NLOHMANN_JSON_PASTE59(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE58(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) +#define NLOHMANN_JSON_PASTE60(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE59(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) +#define NLOHMANN_JSON_PASTE61(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE60(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) +#define NLOHMANN_JSON_PASTE62(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE61(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) +#define NLOHMANN_JSON_PASTE63(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE62(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) +#define NLOHMANN_JSON_PASTE64(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE63(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) + +#define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1; +#define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1); +#define NLOHMANN_JSON_FROM_WITH_DEFAULT(v1) nlohmann_json_t.v1 = nlohmann_json_j.value(#v1, nlohmann_json_default_obj.v1); + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \ + friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { Type nlohmann_json_default_obj; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \ + inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { Type nlohmann_json_default_obj; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + + +// inspired from https://stackoverflow.com/a/26745591 +// allows to call any std function as if (e.g. with begin): +// using std::begin; begin(x); +// +// it allows using the detected idiom to retrieve the return type +// of such an expression +#define NLOHMANN_CAN_CALL_STD_FUNC_IMPL(std_name) \ + namespace detail { \ + using std::std_name; \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + } \ + \ + namespace detail2 { \ + struct std_name##_tag \ + { \ + }; \ + \ + template \ + std_name##_tag std_name(T&&...); \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + \ + template \ + struct would_call_std_##std_name \ + { \ + static constexpr auto const value = ::nlohmann::detail:: \ + is_detected_exact::value; \ + }; \ + } /* namespace detail2 */ \ + \ + template \ + struct would_call_std_##std_name : detail2::would_call_std_##std_name \ + { \ + } + +#ifndef JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_USE_IMPLICIT_CONVERSIONS 1 +#endif + +#if JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_EXPLICIT +#else + #define JSON_EXPLICIT explicit +#endif + +#ifndef JSON_DISABLE_ENUM_SERIALIZATION + #define JSON_DISABLE_ENUM_SERIALIZATION 0 +#endif + +#ifndef JSON_USE_GLOBAL_UDLS + #define JSON_USE_GLOBAL_UDLS 1 +#endif + +#if JSON_HAS_THREE_WAY_COMPARISON + #include // partial_ordering +#endif + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/////////////////////////// +// JSON type enumeration // +/////////////////////////// + +/*! +@brief the JSON type enumeration + +This enumeration collects the different JSON types. It is internally used to +distinguish the stored values, and the functions @ref basic_json::is_null(), +@ref basic_json::is_object(), @ref basic_json::is_array(), +@ref basic_json::is_string(), @ref basic_json::is_boolean(), +@ref basic_json::is_number() (with @ref basic_json::is_number_integer(), +@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), +@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and +@ref basic_json::is_structured() rely on it. + +@note There are three enumeration entries (number_integer, number_unsigned, and +number_float), because the library distinguishes these three types for numbers: +@ref basic_json::number_unsigned_t is used for unsigned integers, +@ref basic_json::number_integer_t is used for signed integers, and +@ref basic_json::number_float_t is used for floating-point numbers or to +approximate integers which do not fit in the limits of their respective type. + +@sa see @ref basic_json::basic_json(const value_t value_type) -- create a JSON +value with the default value for a given type + +@since version 1.0.0 +*/ +enum class value_t : std::uint8_t +{ + null, ///< null value + object, ///< object (unordered set of name/value pairs) + array, ///< array (ordered collection of values) + string, ///< string value + boolean, ///< boolean value + number_integer, ///< number value (signed integer) + number_unsigned, ///< number value (unsigned integer) + number_float, ///< number value (floating-point) + binary, ///< binary array (ordered collection of bytes) + discarded ///< discarded by the parser callback function +}; + +/*! +@brief comparison operator for JSON types + +Returns an ordering that is similar to Python: +- order: null < boolean < number < object < array < string < binary +- furthermore, each type is not smaller than itself +- discarded values are not comparable +- binary is represented as a b"" string in python and directly comparable to a + string; however, making a binary array directly comparable with a string would + be surprising behavior in a JSON file. + +@since version 1.0.0 +*/ +#if JSON_HAS_THREE_WAY_COMPARISON + inline std::partial_ordering operator<=>(const value_t lhs, const value_t rhs) noexcept // *NOPAD* +#else + inline bool operator<(const value_t lhs, const value_t rhs) noexcept +#endif +{ + static constexpr std::array order = {{ + 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, + 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, + 6 /* binary */ + } + }; + + const auto l_index = static_cast(lhs); + const auto r_index = static_cast(rhs); +#if JSON_HAS_THREE_WAY_COMPARISON + if (l_index < order.size() && r_index < order.size()) + { + return order[l_index] <=> order[r_index]; // *NOPAD* + } + return std::partial_ordering::unordered; +#else + return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; +#endif +} + +// GCC selects the built-in operator< over an operator rewritten from +// a user-defined spaceship operator +// Clang, MSVC, and ICC select the rewritten candidate +// (see GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105200) +#if JSON_HAS_THREE_WAY_COMPARISON && defined(__GNUC__) +inline bool operator<(const value_t lhs, const value_t rhs) noexcept +{ + return std::is_lt(lhs <=> rhs); // *NOPAD* +} +#endif + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/*! +@brief replace all occurrences of a substring by another string + +@param[in,out] s the string to manipulate; changed so that all + occurrences of @a f are replaced with @a t +@param[in] f the substring to replace with @a t +@param[in] t the string to replace @a f + +@pre The search string @a f must not be empty. **This precondition is +enforced with an assertion.** + +@since version 2.0.0 +*/ +template +inline void replace_substring(StringType& s, const StringType& f, + const StringType& t) +{ + JSON_ASSERT(!f.empty()); + for (auto pos = s.find(f); // find first occurrence of f + pos != StringType::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} +} + +/*! + * @brief string escaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to escape + * @return escaped string + * + * Note the order of escaping "~" to "~0" and "/" to "~1" is important. + */ +template +inline StringType escape(StringType s) +{ + replace_substring(s, StringType{"~"}, StringType{"~0"}); + replace_substring(s, StringType{"/"}, StringType{"~1"}); + return s; +} + +/*! + * @brief string unescaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to unescape + * @return unescaped string + * + * Note the order of escaping "~1" to "/" and "~0" to "~" is important. + */ +template +static void unescape(StringType& s) +{ + replace_substring(s, StringType{"~1"}, StringType{"/"}); + replace_substring(s, StringType{"~0"}, StringType{"~"}); +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // size_t + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-FileCopyrightText: 2018 The Abseil Authors +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +#include // index_sequence, make_index_sequence, index_sequence_for + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +using uncvref_t = typename std::remove_cv::type>::type; + +#ifdef JSON_HAS_CPP_14 + +// the following utilities are natively available in C++14 +using std::enable_if_t; +using std::index_sequence; +using std::make_index_sequence; +using std::index_sequence_for; + +#else + +// alias templates to reduce boilerplate +template +using enable_if_t = typename std::enable_if::type; + +// The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h +// which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0. + +//// START OF CODE FROM GOOGLE ABSEIL + +// integer_sequence +// +// Class template representing a compile-time integer sequence. An instantiation +// of `integer_sequence` has a sequence of integers encoded in its +// type through its template arguments (which is a common need when +// working with C++11 variadic templates). `absl::integer_sequence` is designed +// to be a drop-in replacement for C++14's `std::integer_sequence`. +// +// Example: +// +// template< class T, T... Ints > +// void user_function(integer_sequence); +// +// int main() +// { +// // user_function's `T` will be deduced to `int` and `Ints...` +// // will be deduced to `0, 1, 2, 3, 4`. +// user_function(make_integer_sequence()); +// } +template +struct integer_sequence +{ + using value_type = T; + static constexpr std::size_t size() noexcept + { + return sizeof...(Ints); + } +}; + +// index_sequence +// +// A helper template for an `integer_sequence` of `size_t`, +// `absl::index_sequence` is designed to be a drop-in replacement for C++14's +// `std::index_sequence`. +template +using index_sequence = integer_sequence; + +namespace utility_internal +{ + +template +struct Extend; + +// Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency. +template +struct Extend, SeqSize, 0> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >; +}; + +template +struct Extend, SeqSize, 1> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >; +}; + +// Recursion helper for 'make_integer_sequence'. +// 'Gen::type' is an alias for 'integer_sequence'. +template +struct Gen +{ + using type = + typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type; +}; + +template +struct Gen +{ + using type = integer_sequence; +}; + +} // namespace utility_internal + +// Compile-time sequences of integers + +// make_integer_sequence +// +// This template alias is equivalent to +// `integer_sequence`, and is designed to be a drop-in +// replacement for C++14's `std::make_integer_sequence`. +template +using make_integer_sequence = typename utility_internal::Gen::type; + +// make_index_sequence +// +// This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`, +// and is designed to be a drop-in replacement for C++14's +// `std::make_index_sequence`. +template +using make_index_sequence = make_integer_sequence; + +// index_sequence_for +// +// Converts a typename pack into an index sequence of the same length, and +// is designed to be a drop-in replacement for C++14's +// `std::index_sequence_for()` +template +using index_sequence_for = make_index_sequence; + +//// END OF CODE FROM GOOGLE ABSEIL + +#endif + +// dispatch utility (taken from ranges-v3) +template struct priority_tag : priority_tag < N - 1 > {}; +template<> struct priority_tag<0> {}; + +// taken from ranges-v3 +template +struct static_const +{ + static JSON_INLINE_VARIABLE constexpr T value{}; +}; + +#ifndef JSON_HAS_CPP_17 + template + constexpr T static_const::value; +#endif + +template +inline constexpr std::array make_array(Args&& ... args) +{ + return std::array {{static_cast(std::forward(args))...}}; +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // numeric_limits +#include // false_type, is_constructible, is_integral, is_same, true_type +#include // declval +#include // tuple + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // random_access_iterator_tag + +// #include + +// #include + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +struct iterator_types {}; + +template +struct iterator_types < + It, + void_t> +{ + using difference_type = typename It::difference_type; + using value_type = typename It::value_type; + using pointer = typename It::pointer; + using reference = typename It::reference; + using iterator_category = typename It::iterator_category; +}; + +// This is required as some compilers implement std::iterator_traits in a way that +// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. +template +struct iterator_traits +{ +}; + +template +struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> + : iterator_types +{ +}; + +template +struct iterator_traits::value>> +{ + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = ptrdiff_t; + using pointer = T*; + using reference = T&; +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); + +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); + +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.1 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann +// SPDX-License-Identifier: MIT + +#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ + #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + #include // int64_t, uint64_t + #include // map + #include // allocator + #include // string + #include // vector + + // #include + + + /*! + @brief namespace for Niels Lohmann + @see https://github.com/nlohmann + @since version 1.0.0 + */ + NLOHMANN_JSON_NAMESPACE_BEGIN + + /*! + @brief default JSONSerializer template argument + + This serializer ignores the template arguments and uses ADL + ([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) + for serialization. + */ + template + struct adl_serializer; + + /// a class to store JSON values + /// @sa https://json.nlohmann.me/api/basic_json/ + template class ObjectType = + std::map, + template class ArrayType = std::vector, + class StringType = std::string, class BooleanType = bool, + class NumberIntegerType = std::int64_t, + class NumberUnsignedType = std::uint64_t, + class NumberFloatType = double, + template class AllocatorType = std::allocator, + template class JSONSerializer = + adl_serializer, + class BinaryType = std::vector> + class basic_json; + + /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document + /// @sa https://json.nlohmann.me/api/json_pointer/ + template + class json_pointer; + + /*! + @brief default specialization + @sa https://json.nlohmann.me/api/json/ + */ + using json = basic_json<>; + + /// @brief a minimal map-like container that preserves insertion order + /// @sa https://json.nlohmann.me/api/ordered_map/ + template + struct ordered_map; + + /// @brief specialization that maintains the insertion order of object keys + /// @sa https://json.nlohmann.me/api/ordered_json/ + using ordered_json = basic_json; + + NLOHMANN_JSON_NAMESPACE_END + +#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + +NLOHMANN_JSON_NAMESPACE_BEGIN +/*! +@brief detail namespace with internal helper functions + +This namespace collects functions that should not be exposed, +implementations of some @ref basic_json methods, and meta-programming helpers. + +@since version 2.1.0 +*/ +namespace detail +{ + +///////////// +// helpers // +///////////// + +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + +template struct is_basic_json : std::false_type {}; + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +struct is_basic_json : std::true_type {}; + +// used by exceptions create() member functions +// true_type for pointer to possibly cv-qualified basic_json or std::nullptr_t +// false_type otherwise +template +struct is_basic_json_context : + std::integral_constant < bool, + is_basic_json::type>::type>::value + || std::is_same::value > +{}; + +////////////////////// +// json_ref helpers // +////////////////////// + +template +class json_ref; + +template +struct is_json_ref : std::false_type {}; + +template +struct is_json_ref> : std::true_type {}; + +////////////////////////// +// aliases for detected // +////////////////////////// + +template +using mapped_type_t = typename T::mapped_type; + +template +using key_type_t = typename T::key_type; + +template +using value_type_t = typename T::value_type; + +template +using difference_type_t = typename T::difference_type; + +template +using pointer_t = typename T::pointer; + +template +using reference_t = typename T::reference; + +template +using iterator_category_t = typename T::iterator_category; + +template +using to_json_function = decltype(T::to_json(std::declval()...)); + +template +using from_json_function = decltype(T::from_json(std::declval()...)); + +template +using get_template_function = decltype(std::declval().template get()); + +// trait checking if JSONSerializer::from_json(json const&, udt&) exists +template +struct has_from_json : std::false_type {}; + +// trait checking if j.get is valid +// use this trait instead of std::is_constructible or std::is_convertible, +// both rely on, or make use of implicit conversions, and thus fail when T +// has several constructors/operator= (see https://github.com/nlohmann/json/issues/958) +template +struct is_getable +{ + static constexpr bool value = is_detected::value; +}; + +template +struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if JSONSerializer::from_json(json const&) exists +// this overload is used for non-default-constructible user-defined-types +template +struct has_non_default_from_json : std::false_type {}; + +template +struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if BasicJsonType::json_serializer::to_json exists +// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion. +template +struct has_to_json : std::false_type {}; + +template +struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +template +using detect_key_compare = typename T::key_compare; + +template +struct has_key_compare : std::integral_constant::value> {}; + +// obtains the actual object key comparator +template +struct actual_object_comparator +{ + using object_t = typename BasicJsonType::object_t; + using object_comparator_t = typename BasicJsonType::default_object_comparator_t; + using type = typename std::conditional < has_key_compare::value, + typename object_t::key_compare, object_comparator_t>::type; +}; + +template +using actual_object_comparator_t = typename actual_object_comparator::type; + +/////////////////// +// is_ functions // +/////////////////// + +// https://en.cppreference.com/w/cpp/types/conjunction +template struct conjunction : std::true_type { }; +template struct conjunction : B { }; +template +struct conjunction +: std::conditional(B::value), conjunction, B>::type {}; + +// https://en.cppreference.com/w/cpp/types/negation +template struct negation : std::integral_constant < bool, !B::value > { }; + +// Reimplementation of is_constructible and is_default_constructible, due to them being broken for +// std::pair and std::tuple until LWG 2367 fix (see https://cplusplus.github.io/LWG/lwg-defects.html#2367). +// This causes compile errors in e.g. clang 3.5 or gcc 4.9. +template +struct is_default_constructible : std::is_default_constructible {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + + +template +struct is_constructible : std::is_constructible {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + + +template +struct is_iterator_traits : std::false_type {}; + +template +struct is_iterator_traits> +{ + private: + using traits = iterator_traits; + + public: + static constexpr auto value = + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value; +}; + +template +struct is_range +{ + private: + using t_ref = typename std::add_lvalue_reference::type; + + using iterator = detected_t; + using sentinel = detected_t; + + // to be 100% correct, it should use https://en.cppreference.com/w/cpp/iterator/input_or_output_iterator + // and https://en.cppreference.com/w/cpp/iterator/sentinel_for + // but reimplementing these would be too much work, as a lot of other concepts are used underneath + static constexpr auto is_iterator_begin = + is_iterator_traits>::value; + + public: + static constexpr bool value = !std::is_same::value && !std::is_same::value && is_iterator_begin; +}; + +template +using iterator_t = enable_if_t::value, result_of_begin())>>; + +template +using range_value_t = value_type_t>>; + +// The following implementation of is_complete_type is taken from +// https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expression-sfinae-in-vs-2015-update-1/ +// and is written by Xiang Fan who agreed to using it in this library. + +template +struct is_complete_type : std::false_type {}; + +template +struct is_complete_type : std::true_type {}; + +template +struct is_compatible_object_type_impl : std::false_type {}; + +template +struct is_compatible_object_type_impl < + BasicJsonType, CompatibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + // macOS's is_constructible does not play well with nonesuch... + static constexpr bool value = + is_constructible::value && + is_constructible::value; +}; + +template +struct is_compatible_object_type + : is_compatible_object_type_impl {}; + +template +struct is_constructible_object_type_impl : std::false_type {}; + +template +struct is_constructible_object_type_impl < + BasicJsonType, ConstructibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + static constexpr bool value = + (is_default_constructible::value && + (std::is_move_assignable::value || + std::is_copy_assignable::value) && + (is_constructible::value && + std::is_same < + typename object_t::mapped_type, + typename ConstructibleObjectType::mapped_type >::value)) || + (has_from_json::value || + has_non_default_from_json < + BasicJsonType, + typename ConstructibleObjectType::mapped_type >::value); +}; + +template +struct is_constructible_object_type + : is_constructible_object_type_impl {}; + +template +struct is_compatible_string_type +{ + static constexpr auto value = + is_constructible::value; +}; + +template +struct is_constructible_string_type +{ + // launder type through decltype() to fix compilation failure on ICPC +#ifdef __INTEL_COMPILER + using laundered_type = decltype(std::declval()); +#else + using laundered_type = ConstructibleStringType; +#endif + + static constexpr auto value = + conjunction < + is_constructible, + is_detected_exact>::value; +}; + +template +struct is_compatible_array_type_impl : std::false_type {}; + +template +struct is_compatible_array_type_impl < + BasicJsonType, CompatibleArrayType, + enable_if_t < + is_detected::value&& + is_iterator_traits>>::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 + !std::is_same>::value >> +{ + static constexpr bool value = + is_constructible>::value; +}; + +template +struct is_compatible_array_type + : is_compatible_array_type_impl {}; + +template +struct is_constructible_array_type_impl : std::false_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t::value >> + : std::true_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t < !std::is_same::value&& + !is_compatible_string_type::value&& + is_default_constructible::value&& +(std::is_move_assignable::value || + std::is_copy_assignable::value)&& +is_detected::value&& +is_iterator_traits>>::value&& +is_detected::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 +!std::is_same>::value&& + is_complete_type < + detected_t>::value >> +{ + using value_type = range_value_t; + + static constexpr bool value = + std::is_same::value || + has_from_json::value || + has_non_default_from_json < + BasicJsonType, + value_type >::value; +}; + +template +struct is_constructible_array_type + : is_constructible_array_type_impl {}; + +template +struct is_compatible_integer_type_impl : std::false_type {}; + +template +struct is_compatible_integer_type_impl < + RealIntegerType, CompatibleNumberIntegerType, + enable_if_t < std::is_integral::value&& + std::is_integral::value&& + !std::is_same::value >> +{ + // is there an assert somewhere on overflows? + using RealLimits = std::numeric_limits; + using CompatibleLimits = std::numeric_limits; + + static constexpr auto value = + is_constructible::value && + CompatibleLimits::is_integer && + RealLimits::is_signed == CompatibleLimits::is_signed; +}; + +template +struct is_compatible_integer_type + : is_compatible_integer_type_impl {}; + +template +struct is_compatible_type_impl: std::false_type {}; + +template +struct is_compatible_type_impl < + BasicJsonType, CompatibleType, + enable_if_t::value >> +{ + static constexpr bool value = + has_to_json::value; +}; + +template +struct is_compatible_type + : is_compatible_type_impl {}; + +template +struct is_constructible_tuple : std::false_type {}; + +template +struct is_constructible_tuple> : conjunction...> {}; + +template +struct is_json_iterator_of : std::false_type {}; + +template +struct is_json_iterator_of : std::true_type {}; + +template +struct is_json_iterator_of : std::true_type +{}; + +// checks if a given type T is a template specialization of Primary +template