66 void reset(
float val = 1.0F);
81 const float*
v()
const {
return _scores.data(); }
105 std::transform(
_mask.begin(),
_mask.end(),
_mask.begin(), [](
const bool&) { return true; });
114 return _mask[ID] = val;
125 const std::vector<FrameId>&
top_n(
const DatasetFrames& _dataset_frames,
size_t _size,
size_t from_vid_limit = 0,
126 size_t from_shot_limit = 0)
const;
133 size_t from_shot_limit)
const;
136 std::vector<FrameId>
weighted_sample(
size_t _size,
float pow = 1)
const;
Definition: dataset-frames.h:162
float set(FrameId i, float prob)
Hard-sets the score with the provided value (normalization required).
Definition: scores.cpp:109
std::vector< float > _scores
Current score distribution for the frames.
Definition: scores.h:36
void normalize(size_t depth=MAX_TEMPORAL_SIZE)
Normalizes the score distribution.
Definition: scores.cpp:368
bool operator==(const ScoreModel &other) const
Definition: scores.cpp:86
void invalidate_cache()
Definition: scores.h:98
static StdVector< std::pair< FrameId, float > > sort_by_score(const StdVector< float > &scores)
Sorts images by given score vector.
Definition: scores.cpp:404
std::vector< FrameId > _topn_cache
Definition: scores.h:50
void reset(float val=1.0F)
Definition: scores.cpp:88
size_t size() const
Returns number of scores stored.
Definition: scores.h:86
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.
Definition: scores.cpp:269
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.
Definition: scores.cpp:146
StdMatrix< float > _temporal_scores
Definition: scores.h:38
const float * temp(size_t temp) const
Definition: scores.h:83
std::vector< bool > _mask
Frames mask telling what frames should be placed inside the results.
Definition: scores.h:47
std::vector< FrameId > weighted_sample(size_t _size, float pow=1) const
Samples n random frames from the current scores distribution.
Definition: scores.cpp:197
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 wrappe...
Definition: scores.cpp:115
bool is_masked(FrameId ID) const
Returns the current value for the frame.
Definition: scores.h:109
bool set_mask(FrameId ID, bool val)
Sets the mask value for the frame.
Definition: scores.h:112
std::vector< FrameId > _topn_ctx_cache
Definition: scores.h:52
size_t frame_rank(FrameId i) const
Returns the current rank of the provided frame (starts from 0).
Definition: scores.cpp:395
bool _cache_dirty
Definition: scores.h:51
ScoreModel(const DatasetFrames &p)
Definition: scores.h:56
const float * v() const
Pointer to the begin of the data.
Definition: scores.h:81
float adjust(FrameId i, float prob)
Multiplies the relevance score with the provided value.
Definition: scores.cpp:97
void reset_mask()
Definition: scores.h:103
float operator[](FrameId i) const
Definition: scores.h:64
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.
Definition: scores.cpp:328
bool _cache_ctx_dirty
Definition: scores.h:53
FrameId weighted_example(const std::vector< FrameId > &subset) const
Samples a random frame from the current scores distribution.
Definition: scores.cpp:259
Definition: common-types.h:33
constexpr int MAX_TEMPORAL_SIZE
Maximal size of temporal query.
Definition: static-config.h:94
std::vector< std::vector< T_ > > StdMatrix
Definition: common-types.h:81
std::vector< T_ > StdVector
Definition: common-types.h:84
unsigned long FrameId
Definition: common-types.h:75