Sleipnir
|
Inverts an underlying measure using a sigmoid function. More...
#include <measure.h>
Public Member Functions | |
CMeasureSigmoid (const IMeasure *pMeasure, bool fMemory, float dMultiplier) | |
Construct a new sigmoid measure wrapping the given underlying measure with the specified multiplier. | |
const char * | GetName () const |
Return the human-readable unique identifier of the measure type. | |
bool | IsRank () const |
Return true if the measure requires rank-based integer inputs. | |
IMeasure * | Clone () const |
Create a copy of the current measure object. | |
double | Measure (const float *adX, size_t iM, const float *adY, size_t iN, EMap eMap, const float *adWX, const float *adWY) const |
Calculate the measure between two given vectors with optional element weights. |
Inverts an underlying measure using a sigmoid function.
Inverts and transforms the result of an underlying measure to the range [0, 1] by calculating:
2 * (1 - (1 / (1 + exp(-result * dMultiplier))))
Sleipnir::CMeasureSigmoid::CMeasureSigmoid | ( | const IMeasure * | pMeasure, |
bool | fMemory, | ||
float | dMultiplier | ||
) | [inline] |
Construct a new sigmoid measure wrapping the given underlying measure with the specified multiplier.
pMeasure | Measure whose result should be sigmoid transformed. |
fMemory | If true, the new sigmoid measure is responsible for releasing the underlying measure's memory. |
dMultiplier | Multiplier used when calculating the sigmoid function. |
Definition at line 181 of file measure.h.
Referenced by Clone().
IMeasure* Sleipnir::CMeasureSigmoid::Clone | ( | ) | const [inline, virtual] |
Create a copy of the current measure object.
Implements Sleipnir::IMeasure.
Definition at line 192 of file measure.h.
References Sleipnir::IMeasure::Clone(), and CMeasureSigmoid().
const char* Sleipnir::CMeasureSigmoid::GetName | ( | ) | const [inline, virtual] |
Return the human-readable unique identifier of the measure type.
Implements Sleipnir::IMeasure.
Definition at line 184 of file measure.h.
References Sleipnir::IMeasure::GetName().
bool Sleipnir::CMeasureSigmoid::IsRank | ( | ) | const [inline, virtual] |
Return true if the measure requires rank-based integer inputs.
Implements Sleipnir::IMeasure.
Definition at line 188 of file measure.h.
References Sleipnir::IMeasure::IsRank().
double Sleipnir::CMeasureSigmoid::Measure | ( | const float * | adX, |
size_t | iN, | ||
const float * | adY, | ||
size_t | iM, | ||
EMap | eMap, | ||
const float * | adWX, | ||
const float * | adWY | ||
) | const [inline, virtual] |
Calculate the measure between two given vectors with optional element weights.
adX | First array of values. |
iN | Length of first array. |
adY | Second array of values. |
iM | Length of second array. |
eMap | Way in which returned value should be centered (implementation-specific). |
adWX | If non-null, weights of elements in the first array. |
adWY | If non-null, weights of elements in the second array. |
Implements Sleipnir::IMeasure.
Definition at line 196 of file measure.h.
References Sleipnir::IMeasure::Measure().