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 ContextImplementations§
Source§impl<'a> SampledEmbedderState<'a>
impl<'a> SampledEmbedderState<'a>
Sourcepub fn has_embedding(&self, term_ptr: TermPointer) -> bool
pub fn has_embedding(&self, term_ptr: TermPointer) -> bool
Determines whether this SampledEmbedderState has an embedding for the
given TermPointer.
Sourcepub fn get_model_embedding(
&self,
term_ptr: TermPointer,
) -> &SampledModelEmbedding
pub fn get_model_embedding( &self, term_ptr: TermPointer, ) -> &SampledModelEmbedding
Gets the SampledModelEmbedding for the given TermPointer.
Sourcepub fn expand_compressed_function(
&self,
compressed_vec: &TypedVector,
) -> Array2<f32>
pub fn expand_compressed_function( &self, compressed_vec: &TypedVector, ) -> Array2<f32>
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.
Sourcepub fn evaluate_term_application(
&self,
term_application: &TermApplication,
) -> TypedVector
pub fn evaluate_term_application( &self, term_application: &TermApplication, ) -> TypedVector
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.