Skip to content

Commit

Permalink
Merge pull request #826 from null-a/remove-checkpoint-params
Browse files Browse the repository at this point in the history
Remove checkpointParams option from Optimize.
  • Loading branch information
stuhlmueller committed Apr 19, 2017
2 parents 4fb7296 + 79018bc commit 254c200
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions src/inference/optimize.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ module.exports = function(env) {

logProgress: false,
logProgressFilename: 'optimizeProgress.csv',
logProgressThrottle: 200,

checkpointParams: false,
checkpointParamsFilename: 'optimizeParams.json',
checkpointParamsThrottle: 10000
logProgressThrottle: 200
});

// Create a (cps) function 'estimator' which computes gradient
Expand Down Expand Up @@ -104,15 +100,6 @@ module.exports = function(env) {
}, options.logProgressThrottle, { trailing: false });
}

// For checkpointing params to disk
var saveParams, checkpointParams;
if (options.checkpointParams) {
saveParams = function() {
params.save(options.checkpointParamsFilename);
};
checkpointParams = _.throttle(saveParams, options.checkpointParamsThrottle, { trailing: false });
}

// Weight decay.
var decayWeights = weightDecay.parseOptions(options.weightDecay, options.verbose);

Expand All @@ -139,9 +126,6 @@ module.exports = function(env) {
if (options.logProgress) {
logProgress(i, objective);
}
if (options.checkpointParams) {
checkpointParams();
}

history.push(objective);

Expand Down Expand Up @@ -180,10 +164,6 @@ module.exports = function(env) {
if (options.logProgress) {
fs.closeSync(logFile);
}
if (options.checkpointParams) {
// Save final params
saveParams();
}
return k(s);
}, a, {history: history});
});
Expand Down

0 comments on commit 254c200

Please sign in to comment.