6e5cf676b113af8d70e34224f23bc8eace618856,mloop/nnlearner.py,SingleNeuralNet,fit,#SingleNeuralNet#Any#Any#,120
Before Change
self.log.debug("Fit neural network with total training cost "
+ str(self.tf_session.run(
self.loss_func,
feed_dict={self.input_placeholder: params,
self.output_placeholder: [[c] for c in costs],
self.regularisation_coefficient_placeholder: self.regularisation_coefficient,
} ))
+ ", with unregularized cost "
+ str(self.tf_session.run(
self.loss_func,
feed_dict={self.input_placeholder: params,
self.output_placeholder: [[c] for c in costs],
self.regularisation_coefficient_placeholder: 0,
} )))
def cross_validation_loss(self, params, costs):
"""
After Change
// - if the new loss is greater than the threshold then we haven"t improved much, so stop
// - else start from the top
while True:
threshold = 0.8 * self._loss(params, costs)[0]
for i in range(self.train_epochs):
// Split the data into random batches, and train on each batch
indices = np.random.permutation(len(params))
for j in range(math.ceil(len(params) / self.batch_size)):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: michaelhush/M-LOOP
Commit Name: 6e5cf676b113af8d70e34224f23bc8eace618856
Time: 2017-05-02
Author: harry.slatyer@gmail.com
File Name: mloop/nnlearner.py
Class Name: SingleNeuralNet
Method Name: fit
Project Name: michaelhush/M-LOOP
Commit Name: 6e5cf676b113af8d70e34224f23bc8eace618856
Time: 2017-05-02
Author: harry.slatyer@gmail.com
File Name: mloop/nnlearner.py
Class Name: SingleNeuralNet
Method Name: fit
Project Name: dpressel/mead-baseline
Commit Name: 6aad1de658a933d3fa376f7fe9abf419da8a8bd2
Time: 2018-11-26
Author: blester125@users.noreply.github.com
File Name: python/baseline/dy/seq2seq/train.py
Class Name: Seq2SeqTrainerDynet
Method Name: test
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 64764718080b11c8fb91df34c12e0ce8ac54aa4e
Time: 2018-05-15
Author: M.N.Tran@ibm.com
File Name: art/classifiers/pytorch.py
Class Name: PyTorchClassifier
Method Name: fit