tastoids/taste

Tastes, broadly are any indexable sentiment (or lack thereof), able to participate in the Tastoid algebra

Apart from the 0-ideal/Nil taste (tasteless), Tastes must share a given index(-space) i.e. strings, Ints, or sets/combinations thereof

More algebraically:

Consider that the set of all Vectors are a field ℝⁿ (aka 𝕍), AND i is an enumerable (countable) set of indices (ⅈ) with imbed(a ∈ 𝔸) -> aᵢ (a bijective imbedding of ‘a’ subject into 𝕍/ⅈ)

Then, 𝛂aᵢ ∈ 𝔸 are the set of all ‘unit’ tastes (scaled by 𝛂)

Types

A Taste of a given index with values sharing the same types.

pub opaque type Taste

Values

pub fn add(taste t: Taste, to u: Taste) -> Taste

Combine two tastes, linearly adding their sentiments (per index) a la ‘scalar addition’

pub fn condense(taste: Taste) -> Taste

Returns a combined taste, where n taste indices become one set of its indices, with its value representing the sum of their sentiments.

pub fn from_dense_embedding(values: List(Float)) -> Taste
pub fn from_one(of index: String) -> Taste

Return a singular of ‘index’, a la Taste(index, 1.0)

pub fn from_sparse_embedding(
  values: List(Float),
  by indices: List(Int),
) -> Taste
pub fn from_tuples(from tastes: List(#(String, Float))) -> Taste

Return a Tastes(index) consisting of the provided #(index, value: Float) tuples.

pub fn length(of taste: Taste) -> Float

Returns the combined sentiments of the entire Taste.

pub fn multiply(t: Taste, by u: Taste) -> Taste

Return the and-ish product of two tastes. Multiplying the indices between—possibly sparse—amplifying shared indices and nullifying ones they don’t (i.e. they were multiplied by zero).

pub fn negate(t: Taste) -> Taste

Returns the ‘negative’ of a taste (like <-> dislike)

pub fn scale(taste: Taste, by weight: Float) -> Taste

Scale the given tastes by a portion (weight)–relative to its ‘natural’ values–a la scalar multiplication.

_Note from Avery: While this could be accomplished via a Tastoid’s cardinality, I wanted keep the notion of a signal’s ‘worth’ (the scale of its impression) distinct from its quantity.

pub const tasteless: Taste

Alias for Nil, the empty taste—sans index—shared by every embedding-space

Search Document