artefactual.scoring.FunctionPooling#

class artefactual.scoring.FunctionPooling(fn)[source]#

Bases: Pooling

A plain function f(x, axis) as a Pooling, named after the function.

A lambda or a functools.partial is named “pooling”; define the function with def to name it.

Parameters:

fn (callable) – fn(x, axis) pooling the axis of x, whose last axis is the rank axis, to (…, n_features).

Methods

feature_names

One name per feature, given the rank column names.

width

Features the pooling returns for k candidates per token.

fn: Callable#
property name: str#

fn.__name__, or “pooling” for a lambda or a functools.partial.