|
SOMHunter Core
|
#include <scores.h>
Public Member Functions | |
| ScoreModel (const DatasetFrames &p) | |
| bool | operator== (const ScoreModel &other) const |
| float | operator[] (FrameId i) const |
| void | reset (float val=1.0F) |
| float | adjust (FrameId i, float prob) |
| Multiplies the relevance score with the provided value. More... | |
| float | adjust (size_t temp, FrameId i, float prob) |
| Multiplies the relevance score of temporal part with the provided value. More... | |
| float | set (FrameId i, float prob) |
| Hard-sets the score with the provided value (normalization required). More... | |
| const float * | v () const |
| Pointer to the begin of the data. More... | |
| const float * | temp (size_t temp) const |
| size_t | size () const |
| Returns number of scores stored. More... | |
| void | apply_temporals (size_t depth, const DatasetFrames &_dataset_frames, const float power) |
| Transforms temporal inverse score into temporal scores and aggregates into full image scores. More... | |
| void | normalize (size_t depth=MAX_TEMPORAL_SIZE) |
| Normalizes the score distribution. More... | |
| void | normalize (float *scores, size_t size) |
| void | invalidate_cache () |
| void | reset_mask () |
| bool | is_masked (FrameId ID) const |
| Returns the current value for the frame. More... | |
| bool | set_mask (FrameId ID, bool val) |
| Sets the mask value for the frame. More... | |
| void | apply_bayes (std::set< FrameId > likes, const std::set< FrameId > &screen, const PrimaryFrameFeatures &features) |
| Applies relevance feedback rescore based on the Bayesian update rule. More... | |
| const std::vector< FrameId > & | top_n (const DatasetFrames &_dataset_frames, size_t _size, size_t from_vid_limit=0, size_t from_shot_limit=0) const |
| Gets the images with the highest scores but respecting the provided limits. More... | |
| std::vector< FrameId > | top_n_with_context (const DatasetFrames &_dataset_frames, size_t _size, size_t from_vid_limit, size_t from_shot_limit) const |
| Gets the images with the highest scores while respecting the provided limits and each frame is wrapped by it's context based on the number of frames per line. More... | |
| std::vector< FrameId > | weighted_sample (size_t _size, float pow=1) const |
Samples n random frames from the current scores distribution. More... | |
| FrameId | weighted_example (const std::vector< FrameId > &subset) const |
| Samples a random frame from the current scores distribution. More... | |
| size_t | frame_rank (FrameId i) const |
| Returns the current rank of the provided frame (starts from 0). More... | |
Static Public Member Functions | |
| static StdVector< std::pair< FrameId, float > > | sort_by_score (const StdVector< float > &scores) |
| Sorts images by given score vector. More... | |
Private Attributes | |
| std::vector< float > | _scores |
| Current score distribution for the frames. More... | |
| StdMatrix< float > | _temporal_scores |
| std::vector< bool > | _mask |
| Frames mask telling what frames should be placed inside the results. More... | |
| std::vector< FrameId > | _topn_cache |
| bool | _cache_dirty |
| std::vector< FrameId > | _topn_ctx_cache |
| bool | _cache_ctx_dirty |
|
inline |
| float ScoreModel::adjust | ( | FrameId | i, |
| float | prob | ||
| ) |
Multiplies the relevance score with the provided value.
Does not update temporal scores.

| float ScoreModel::adjust | ( | size_t | temp, |
| FrameId | i, | ||
| float | prob | ||
| ) |
Multiplies the relevance score of temporal part with the provided value.

| void ScoreModel::apply_bayes | ( | std::set< FrameId > | likes, |
| const std::set< FrameId > & | screen, | ||
| const PrimaryFrameFeatures & | features | ||
| ) |
Applies relevance feedback rescore based on the Bayesian update rule.

| void ScoreModel::apply_temporals | ( | size_t | depth, |
| const DatasetFrames & | _dataset_frames, | ||
| const float | power | ||
| ) |
Transforms temporal inverse score into temporal scores and aggregates into full image scores.
Depth parameter defines depth of temporal query

| size_t ScoreModel::frame_rank | ( | FrameId | i | ) | const |
Returns the current rank of the provided frame (starts from 0).
|
inline |
|
inline |
Returns the current value for the frame.
| void ScoreModel::normalize | ( | float * | scores, |
| size_t | size | ||
| ) |

| void ScoreModel::normalize | ( | size_t | depth = MAX_TEMPORAL_SIZE | ) |
Normalizes the score distribution.

| bool ScoreModel::operator== | ( | const ScoreModel & | other | ) | const |
|
inline |
| void ScoreModel::reset | ( | float | val = 1.0F | ) |

|
inline |

| float ScoreModel::set | ( | FrameId | i, |
| float | prob | ||
| ) |
Hard-sets the score with the provided value (normalization required).

|
inline |
Sets the mask value for the frame.

|
inline |
Returns number of scores stored.
|
static |
Sorts images by given score vector.
|
inline |

| const std::vector< FrameId > & ScoreModel::top_n | ( | const DatasetFrames & | _dataset_frames, |
| size_t | _size, | ||
| size_t | from_vid_limit = 0, |
||
| size_t | from_shot_limit = 0 |
||
| ) | const |
Gets the images with the highest scores but respecting the provided limits.

| std::vector< FrameId > ScoreModel::top_n_with_context | ( | const DatasetFrames & | _dataset_frames, |
| size_t | _size, | ||
| size_t | from_vid_limit, | ||
| size_t | from_shot_limit | ||
| ) | const |
Gets the images with the highest scores while respecting the provided limits and each frame is wrapped by it's context based on the number of frames per line.

|
inline |
Pointer to the begin of the data.
Samples a random frame from the current scores distribution.
| std::vector< FrameId > ScoreModel::weighted_sample | ( | size_t | _size, |
| float | pow = 1 |
||
| ) | const |
Samples n random frames from the current scores distribution.
|
mutableprivate |
|
mutableprivate |
|
private |
Frames mask telling what frames should be placed inside the results.
true <=> present in the result set false <=> filtered out
|
private |
Current score distribution for the frames.
|
private |
|
mutableprivate |
|
mutableprivate |