pub struct PoolingConfig {
    pub word_embedding_dimension: i64,
    pub pooling_mode_cls_token: bool,
    pub pooling_mode_max_tokens: bool,
    pub pooling_mode_mean_tokens: bool,
    pub pooling_mode_mean_sqrt_len_tokens: bool,
}
Expand description

Configuration for Pooling layer.

Fields

word_embedding_dimension: i64

Dimensions for the word embeddings

pooling_mode_cls_token: bool

Use the first token (CLS token) as text representations

pooling_mode_max_tokens: bool

Use max in each dimension over all tokens

pooling_mode_mean_tokens: bool

Perform mean-pooling

pooling_mode_mean_sqrt_len_tokens: bool

Perform mean-pooling, but devide by sqrt(input_length)

Trait Implementations

Loads a Config object from a JSON file. The format is expected to be aligned with the Transformers library configuration files for each model. The parsing will fail if non-optional keys expected by the model are missing. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.