Struct fetish_lib::sampled_embedder_state::SampledEmbedderState[][src]

pub struct SampledEmbedderState<'a> {
    pub embedding_spaces: HashMap<TypeId, SampledEmbeddingSpace<'a>>,
    pub ctxt: &'a Context,
}
Expand description

A sampled possible state for embeddings drawn from an crate::embedder_state::EmbedderState. This SampledEmbedderState has one SampledEmbeddingSpace for every function TypeId in the given Context, which in turn contains a sampled crate::elaborator::Elaborator and SampledModelEmbeddings

Fields

embedding_spaces: HashMap<TypeId, SampledEmbeddingSpace<'a>>ctxt: &'a Context

Implementations

impl<'a> SampledEmbedderState<'a>[src]

pub fn has_embedding(&self, term_ptr: TermPointer) -> bool[src]

Determines whether this SampledEmbedderState has an embedding for the given TermPointer.

pub fn get_model_embedding(
    &self,
    term_ptr: TermPointer
) -> &SampledModelEmbedding
[src]

Gets the SampledModelEmbedding for the given TermPointer.

pub fn expand_compressed_function(
    &self,
    compressed_vec: &TypedVector
) -> Array2<f32>
[src]

Given a compressed TypedVector for a function type, expands the compressed vector using this SampledEmbedderState’s corresponding elaborator sample and inflates it to yield a linear transformation from the feature space of the input space to the compressed space of the output.

pub fn evaluate_term_application(
    &self,
    term_application: &TermApplication
) -> TypedVector
[src]

Given a TermApplication, evaluates the result that the SampledModelEmbeddings in this SampledEmbedderState would yield for the expression. The result will be in the compressed space of the output type.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for SampledEmbedderState<'a>

impl<'a> !Send for SampledEmbedderState<'a>

impl<'a> !Sync for SampledEmbedderState<'a>

impl<'a> Unpin for SampledEmbedderState<'a>

impl<'a> !UnwindSafe for SampledEmbedderState<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V