public ParallelSGDFactorizer(IDataModel dataModel, int numFeatures, double lambda, int numEpochs) : base(dataModel)
        {
            this.dataModel = dataModel;
            this.rank      = numFeatures + FEATURE_OFFSET;
            this.lambda    = lambda;
            this.numEpochs = numEpochs;

            shuffler = new PreferenceShuffler(dataModel);

            //max thread num set to n^0.25 as suggested by hogwild! paper
            numThreads = Math.Min(Environment.ProcessorCount, (int)Math.Pow((double)shuffler.size(), 0.25));
        }
Exemplo n.º 2
0
 public ParallelSGDFactorizer(DataModel dataModel, int numFeatures, double lambda, int numEpochs)
     : base(dataModel)
 {
     this.mu0                = 0.01;
     this.decayFactor        = 1.0;
     this.stepOffset         = 0;
     this.forgettingExponent = 0.0;
     this.biasMuRatio        = 0.5;
     this.biasLambdaRatio    = 0.1;
     this.epoch              = 1;
     this.dataModel          = dataModel;
     this.rank               = numFeatures + FEATURE_OFFSET;
     this.lambda             = lambda;
     this.numEpochs          = numEpochs;
     this.shuffler           = new PreferenceShuffler(dataModel);
     this.numThreads         = Math.Min(Environment.ProcessorCount, (int)Math.Pow((double)this.shuffler.size(), 0.25));
 }
  public ParallelSGDFactorizer(IDataModel dataModel, int numFeatures, double lambda, int numEpochs) : base(dataModel)
    {
    this.dataModel = dataModel;
    this.rank = numFeatures + FEATURE_OFFSET;
    this.lambda = lambda;
    this.numEpochs = numEpochs;

    shuffler = new PreferenceShuffler(dataModel);

    //max thread num set to n^0.25 as suggested by hogwild! paper
    numThreads = Math.Min(Environment.ProcessorCount, (int) Math.Pow((double) shuffler.size(), 0.25));
  }