Struct fetish_lib::embedding_space::EmbeddingSpace[][src]

pub struct EmbeddingSpace<'a> {
    pub type_id: TypeId,
    pub model_prior_specification: &'a dyn PriorSpecification,
    pub elaborator: Elaborator<'a>,
    pub models: HashMap<TermIndex, TermModel<'a>>,
    pub ctxt: &'a Context,
}
Expand description

Collection of all learned information about embeddings for a given type in and EmbedderState. This comprises the learned Elaborators and the learned TermModels for the type.

Fields

type_id: TypeIdmodel_prior_specification: &'a dyn PriorSpecification
Expand description

PriorSpecification to use for any newly-created TermModels.

elaborator: Elaborator<'a>models: HashMap<TermIndex, TermModel<'a>>ctxt: &'a Context

Implementations

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

pub fn sample(&self, rng: &mut ThreadRng) -> SampledEmbeddingSpace<'a>[src]

Draws a sample from the distribution defined by this EmbeddingSpace over collections of TermModels of the same type, to yield a corresponding SampledEmbeddingSpace containing information about sampled embeddings.

pub fn schmear_to_prior(
    &self,
    embedder_state: &EmbedderState<'_>,
    elaborator_func_schmear: &FuncSchmear,
    func_ptr: TermPointer,
    in_schmear: &Schmear
) -> NormalInverseWishart
[src]

pub fn add_model(&mut self, model_key: TermIndex)[src]

Adds a new TermModel with the assigned TermIndex.

pub fn get_model_mut(&mut self, model_key: TermIndex) -> &mut TermModel<'a>[src]

Gets a handle to the TermModel with the given TermIndex.

pub fn get_model(&self, model_key: TermIndex) -> &TermModel<'a>[src]

Gets a reference to the TermModel with the given TermIndex.

pub fn has_model(&self, model_key: TermIndex) -> bool[src]

Determines if a TermModel exists with the given TermIndex.

pub fn new(
    type_id: TypeId,
    model_prior_specification: &'a dyn PriorSpecification,
    elaborator_prior_specification: &dyn PriorSpecification,
    ctxt: &'a Context
) -> EmbeddingSpace<'a>
[src]

Constructs a new embedding space with the given PriorSpecifications for TermModels and for the Elaborator, respectively, and occurring within the given Context.

Auto Trait Implementations

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

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

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

impl<'a> Unpin for EmbeddingSpace<'a>

impl<'a> !UnwindSafe for EmbeddingSpace<'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