100 [[nodiscard]]
std::vector<
float>
process(
std::span<const
float> samples);
116 [[nodiscard]] ProbabilityBuffer probability_buffer();
131 [[nodiscard]]
size_t record(std::span<const float> samples);
134 [[nodiscard]]
size_t resident_count() const noexcept;
145 [[nodiscard]] ProbabilityBuffer hidden_buffer();
151 void keep_hidden(
bool keep);
157 [[nodiscard]]
std::vector<
float> take_hidden();
163 [[nodiscard]]
std::vector<
float> flush();
171 [[nodiscard]]
size_t pending() const noexcept;
Non-template base that owns all type-independent GPU dispatch logic.
Shared command buffer for GPU dispatch work.
static constexpr uint32_t sample_rate
Sample rate in Hz the network was trained and runs at.
std::unique_ptr< Impl > m_impl
static std::string diagnose(const Kakshya::TensorSet &weights)
Check that a tensor set holds the weights the network needs.
static constexpr uint32_t hidden_width
Width of the recurrent state the network holds for each chunk.
static constexpr uint32_t context_samples
SileroVadModel(const Kakshya::TensorSet &weights)
Upload the weights and prepare the GPU resources.
std::vector< float > process(std::span< const float > samples)
Append samples and run every chunk they complete.
static StreamFraming framing() noexcept
The framing of this network.
static constexpr uint32_t chunk_samples
std::pair< std::shared_ptr< Kriya::BufferPipeline >, std::shared_ptr< Buffers::AudioBuffer > > record(const std::shared_ptr< Kakshya::DynamicSoundStream > &stream, uint32_t input_channel, double seconds, std::optional< uint32_t > monitor, uint32_t channel)
Record a live input channel into a stream for a number of seconds.
const GpuDispatchCore * context
Where the probabilities of the latest run are on the device.
uint32_t chunk_samples
Samples in one chunk, one output per chunk.
uint32_t context_samples
Samples before a chunk that are carried in as context.
uint32_t sample_rate
Sample rate in Hz the network runs at.
uint32_t hidden_width
Width of the recurrent state kept for each chunk.
How a stream classifier cuts its input: sample rate, chunk length, the context carried into each chun...