pub struct KstemitModel {
pub config: KstemitConfig,
pub temporal: TemporalGlu,
pub spatial: GraphSageLayer,
pub physics_proj: Linear,
pub alpha_logit: f32,
pub head: Linear,
}Expand description
K-STEMIT-style spatio-temporal GNN for sonobuoy arrays.
temporal window ──► TemporalGlu ──► h_t ──┐
│ α
node feats + AGG ─► GraphSAGE ───► h_s ───┼──► fuse ──► Linear head ──► logits
│
physics priors ───► Linear ──────► h_p ───┘ (γ residual)Fields§
§config: KstemitConfig§temporal: TemporalGlu§spatial: GraphSageLayer§physics_proj: Linear§alpha_logit: f32Unconstrained logit; α = sigmoid(alpha_logit).
head: LinearImplementations§
Source§impl KstemitModel
impl KstemitModel
Sourcepub fn new(config: KstemitConfig) -> Self
pub fn new(config: KstemitConfig) -> Self
Construct a freshly initialized model.
Sourcepub fn forward_node(
&self,
graph: &SensorGraph,
node_idx: usize,
) -> ForwardOutput
pub fn forward_node( &self, graph: &SensorGraph, node_idx: usize, ) -> ForwardOutput
Forward for one node index on a SensorGraph.
Sourcepub fn inputs_for(
&self,
graph: &SensorGraph,
node_idx: usize,
) -> (Vec<f32>, Vec<f32>, Vec<f32>, Vec<f32>)
pub fn inputs_for( &self, graph: &SensorGraph, node_idx: usize, ) -> (Vec<f32>, Vec<f32>, Vec<f32>, Vec<f32>)
Build model inputs for a node (public for training caches).
Sourcepub fn forward_tensors(
&self,
x_self: &[f32],
x_agg: &[f32],
series: &[f32],
physics: &[f32],
) -> ForwardOutput
pub fn forward_tensors( &self, x_self: &[f32], x_agg: &[f32], series: &[f32], physics: &[f32], ) -> ForwardOutput
Forward from pre-built tensors.
Sourcepub fn predict(&self, graph: &SensorGraph, node_idx: usize) -> usize
pub fn predict(&self, graph: &SensorGraph, node_idx: usize) -> usize
Predicted class (argmax).
Sourcepub fn loss_node(
&self,
graph: &SensorGraph,
node_idx: usize,
label: usize,
) -> f32
pub fn loss_node( &self, graph: &SensorGraph, node_idx: usize, label: usize, ) -> f32
Loss for one labelled node.
Sourcepub fn train_step(
&mut self,
graph: &SensorGraph,
node_idx: usize,
label: usize,
lr: f32,
weight_decay: f32,
) -> f32
pub fn train_step( &mut self, graph: &SensorGraph, node_idx: usize, label: usize, lr: f32, weight_decay: f32, ) -> f32
One SGD step on a single (graph, node, label) sample.
Analytical gradients through GLU, GraphSAGE, fusion α, and head.
Trait Implementations§
Source§impl Clone for KstemitModel
impl Clone for KstemitModel
Auto Trait Implementations§
impl Freeze for KstemitModel
impl RefUnwindSafe for KstemitModel
impl Send for KstemitModel
impl Sync for KstemitModel
impl Unpin for KstemitModel
impl UnsafeUnpin for KstemitModel
impl UnwindSafe for KstemitModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more