How often each feature fires, and how long since it last did. A feature that hasn't fired in a long window is dead: it no longer learns, and wastes capacity. One that fires on most inputs is dense, usually a sign it encodes a bias, not a feature.
More...
#include <featurizer.hpp>
|
| | FeatureActivityTracker (int64_t num_features) |
| |
| void | observe (const std::vector< float > &codes, float threshold=0.0f) |
| | Records a batch of codes, row-major (N, num_features); a code above threshold in magnitude counts as firing.
|
| |
| int64_t | inputs_seen () const |
| | Inputs observed so far.
|
| |
| std::vector< double > | firing_rates () const |
| | The share of observed inputs each feature fired on.
|
| |
| std::vector< int64_t > | dead (int64_t window) const |
| | Features that haven't fired in the last window inputs (or ever, if fewer were seen), in index order.
|
| |
| double | dead_fraction (int64_t window) const |
| | dead(window)'s share of all features.
|
| |
| std::vector< int64_t > | dense (double rate=0.1) const |
| | Features firing on more than rate of the inputs observed.
|
| |
| void | reset () |
| | Forgets everything observed.
|
| |
How often each feature fires, and how long since it last did. A feature that hasn't fired in a long window is dead: it no longer learns, and wastes capacity. One that fires on most inputs is dense, usually a sign it encodes a bias, not a feature.
◆ FeatureActivityTracker()
| pulsatrix::FeatureActivityTracker::FeatureActivityTracker |
( |
int64_t |
num_features | ) |
|
|
explicit |
- Exceptions
-
| std::invalid_argument | if num_features < 1. |
◆ dead()
| std::vector< int64_t > pulsatrix::FeatureActivityTracker::dead |
( |
int64_t |
window | ) |
const |
Features that haven't fired in the last window inputs (or ever, if fewer were seen), in index order.
◆ dead_fraction()
| double pulsatrix::FeatureActivityTracker::dead_fraction |
( |
int64_t |
window | ) |
const |
dead(window)'s share of all features.
◆ dense()
| std::vector< int64_t > pulsatrix::FeatureActivityTracker::dense |
( |
double |
rate = 0.1 | ) |
const |
Features firing on more than rate of the inputs observed.
◆ firing_rates()
| std::vector< double > pulsatrix::FeatureActivityTracker::firing_rates |
( |
| ) |
const |
The share of observed inputs each feature fired on.
◆ inputs_seen()
| int64_t pulsatrix::FeatureActivityTracker::inputs_seen |
( |
| ) |
const |
|
inline |
◆ observe()
| void pulsatrix::FeatureActivityTracker::observe |
( |
const std::vector< float > & |
codes, |
|
|
float |
threshold = 0.0f |
|
) |
| |
Records a batch of codes, row-major (N, num_features); a code above threshold in magnitude counts as firing.
- Exceptions
-
| std::invalid_argument | for a size that isn't a whole number of rows. |
◆ reset()
| void pulsatrix::FeatureActivityTracker::reset |
( |
| ) |
|
Forgets everything observed.
The documentation for this class was generated from the following file: