pub struct TabFMModel { /* private fields */ }Implementations§
Source§impl TabFMModel
impl TabFMModel
Sourcepub fn builder(gguf_path: impl Into<PathBuf>) -> TabFMModelBuilder
pub fn builder(gguf_path: impl Into<PathBuf>) -> TabFMModelBuilder
Start building a TabFMModel — see TabFMModelBuilder.
pub fn load(gguf_path: &Path, config: InferConfig) -> Result<Self>
pub fn is_classifier(&self) -> bool
Sourcepub fn predict(
&self,
x: &[Vec<f32>],
y: &[f32],
train_size: usize,
cat_mask: Option<&[bool]>,
d: Option<usize>,
) -> Result<Vec<Vec<f32>>>
pub fn predict( &self, x: &[Vec<f32>], y: &[f32], train_size: usize, cat_mask: Option<&[bool]>, d: Option<usize>, ) -> Result<Vec<Vec<f32>>>
Run one table (train rows followed by test rows) through TabFM. A thin B=1 wrapper
around predict_batch — see that method to run many tables (e.g. ensemble members) in
one forward pass.
x: [T][H] padded feature matrix (numeric; categorical columns are pre-encoded to
floats by the caller). y: [T] labels (any finite placeholder at test-row positions is
fine — it’s masked internally and never influences the output). train_size: number of
leading rows that are training rows. cat_mask: [H], which columns are categorical
(defaults to all-false). d: actual (unpadded) feature count (defaults to H).
Returns [T][out_dim] raw logits (classification, out_dim = max_classes) or a
[T][1] scalar (regression) — only rows >= train_size are meaningful predictions.
Sourcepub fn predict_batch(
&self,
x_batch: &[Vec<Vec<f32>>],
y_batch: &[Vec<f32>],
train_size: usize,
cat_mask_batch: &[Vec<bool>],
d: Option<usize>,
) -> Result<Vec<Vec<Vec<f32>>>>
pub fn predict_batch( &self, x_batch: &[Vec<Vec<f32>>], y_batch: &[Vec<f32>], train_size: usize, cat_mask_batch: &[Vec<bool>], d: Option<usize>, ) -> Result<Vec<Vec<Vec<f32>>>>
Runs B independent tables through one forward pass, sharing the fixed cost of the
24-block ICL stage (and every other stage) across all of them instead of paying it once
per table. Every table must share the same row count T and feature count H, and
train_size/d are shared scalars across the whole batch — this holds for TabFM’s
ensemble members, which only differ in cell values (per-member feature
permutation/scaling) and cat_mask (which position is categorical shifts with the
permutation), never in table shape. Returns [B][T][out_dim].
Auto Trait Implementations§
impl !RefUnwindSafe for TabFMModel
impl !UnwindSafe for TabFMModel
impl Freeze for TabFMModel
impl Send for TabFMModel
impl Sync for TabFMModel
impl Unpin for TabFMModel
impl UnsafeUnpin for TabFMModel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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