Sleipnir
Public Member Functions
Sleipnir::CMeasureSigmoid Class Reference

Inverts an underlying measure using a sigmoid function. More...

#include <measure.h>

Inheritance diagram for Sleipnir::CMeasureSigmoid:
Sleipnir::CMeasureSigmoidImpl Sleipnir::IMeasure

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.
IMeasureClone () 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.

Detailed Description

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))))
See also:
CMeasureNegate | CMeasureInvert

Definition at line 162 of file measure.h.


Constructor & Destructor Documentation

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.

Parameters:
pMeasureMeasure whose result should be sigmoid transformed.
fMemoryIf true, the new sigmoid measure is responsible for releasing the underlying measure's memory.
dMultiplierMultiplier used when calculating the sigmoid function.
Remarks:
If fMemory is true, the sigmoid measure will delete pMeasure when it is destroyed; otherwise, it will only hold a reference.

Definition at line 181 of file measure.h.

Referenced by Clone().


Member Function Documentation

IMeasure* Sleipnir::CMeasureSigmoid::Clone ( ) const [inline, virtual]

Create a copy of the current measure object.

Returns:
Copy of the current measure object.
Remarks:
Caller is, of course, responsible for destroying the created 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.

Returns:
The string 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.

Returns:
True if the measure requires rank-based input vectors.
Remarks:
The input vectors for rank measures should contain only floating point values with no fractional part; behavior is undefined if they don't.

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.

Parameters:
adXFirst array of values.
iNLength of first array.
adYSecond array of values.
iMLength of second array.
eMapWay in which returned value should be centered (implementation-specific).
adWXIf non-null, weights of elements in the first array.
adWYIf non-null, weights of elements in the second array.
Returns:
Measure calculated between the two input vectors and, optionally, weights.
Remarks:
Pretty much every implementation will puke if given bad input; bounds checking etc. is minimal.

Implements Sleipnir::IMeasure.

Definition at line 196 of file measure.h.

References Sleipnir::IMeasure::Measure().


The documentation for this class was generated from the following file: