pub struct AedHead {
pub state: WeightState,
}Expand description
Learned acoustic-event detection head. Fail-closed: Absent state ⇒ inference abstains.
Fields§
§state: WeightStateImplementations§
Source§impl AedHead
impl AedHead
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct with no weights — fails closed until AedHead::load succeeds.
Sourcepub fn load(&mut self, bytes: &[u8]) -> Result<(), AudioError>
pub fn load(&mut self, bytes: &[u8]) -> Result<(), AudioError>
Load weights from a P64 blob (cold path). On success the head leaves fail-closed mode.
Sourcepub fn infer(
&self,
features: &[f32],
out_events: &mut [AuditoryEvent],
) -> Result<usize, AudioError>
pub fn infer( &self, features: &[f32], out_events: &mut [AuditoryEvent], ) -> Result<usize, AudioError>
Infer at most one low-assurance event proposal from features into out_events.
- No weights ⇒
Err(BackendUnavailable)(abstain; nothing written). features.len()must equal the blob’snum_features, elseInvalidParameter.out_eventsmust have room for ≥1 event, elseOutputBufferTooSmall.
Returns the number of events written (0 or 1). Hot path: no allocation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AedHead
impl RefUnwindSafe for AedHead
impl Send for AedHead
impl Sync for AedHead
impl Unpin for AedHead
impl UnsafeUnpin for AedHead
impl UnwindSafe for AedHead
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more