Katzlab dd76ab1d12 Added PTL2 Scripts
These are PTL2 files from Auden 2/9
2023-02-14 11:20:52 -05:00

52 lines
912 B
C++

#ifndef __WeightUpdateStrategy_j
#define __WeightUpdateStrategy_j
#include <vector>
using namespace std;
class tWeightUpdate;
typedef vector<double> const& Weights_cl;
class WeightUpdateStrategy_cl {
public:
enum WeightUpdateType { None, Random, Adversarial, Prior };
WeightUpdateStrategy_cl( WeightUpdateType T,
double StartT,
double EndT,
double CoolFactor,
bool UsePartialSearch )
{
iStart = StartT;
iEnd = EndT;
iCool = CoolFactor;
iType = T;
iPartial = UsePartialSearch;
}
tWeightUpdate* NewWeights( Weights_cl OrigWeights ) const;
double NewTemp( double OldTemp ) const
{
double T = OldTemp*iCool;
if( T <= iEnd )
T = 0.0;
return T;
}
bool UsePartialSearch() const
{
return iPartial;
}
private:
double iStart;
double iEnd;
double iCool;
bool iPartial;
WeightUpdateType iType;
};
#endif