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 SampledModelEmbedding
s
Fields
embedding_spaces: HashMap<TypeId, SampledEmbeddingSpace<'a>>
ctxt: &'a Context
Implementations
impl<'a> SampledEmbedderState<'a>
[src]
impl<'a> SampledEmbedderState<'a>
[src]pub fn has_embedding(&self, term_ptr: TermPointer) -> bool
[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]
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]
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]
pub fn evaluate_term_application(
&self,
term_application: &TermApplication
) -> TypedVector
[src]Given a TermApplication
, evaluates the result that the SampledModelEmbedding
s
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,