3cee81f6d6f9637d21aad32d360844f6ce7a90c4,framework/Optimizers/GradientBasedOptimizer.py,GradientBasedOptimizer,_removeRedundantTraj,#GradientBasedOptimizer#Any#Any#,294

Before Change


          inp = copy.deepcopy(self.optVarsHist[traj][updateKey]) //FIXME deepcopy needed?
          removeLocalFlag = True
          for var in self.optVars:
            if abs(inp[var] - currentInput[var]) > self.thresholdTrajRemoval:
              removeLocalFlag = False
              break
          if removeLocalFlag:
            removeFlag = True
            break
        if removeFlag:

After Change


        //FIXME this can be quite an expensive operation, looping through each other trajectory
        for updateKey in self.optVarsHist[traj].keys():
          inp = copy.deepcopy(self.optVarsHist[traj][updateKey]) //FIXME deepcopy needed?
          if len(inp) < 1: //empty
            continue
          removeLocalFlag = True
          dist = np.sqrt(np.sum(list((inp[var] - currentInput[var])**2 for var in self.getOptVars())))
          if dist < self.thresholdTrajRemoval:
            self.raiseADebug("Halting trajectory "{}" because it is following trajectory "{}"".format(trajToRemove,traj))
            self.trajectoriesKilled[traj].append(trajToRemove)
            //TODO the trajectory to remove should be chosen more carefully someday, for example, the one that has the smallest steps or lower loss value currently
            removeFlag = True
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: idaholab/raven
Commit Name: 3cee81f6d6f9637d21aad32d360844f6ce7a90c4
Time: 2017-06-21
Author: paul.talbot@inl.gov
File Name: framework/Optimizers/GradientBasedOptimizer.py
Class Name: GradientBasedOptimizer
Method Name: _removeRedundantTraj


Project Name: elfi-dev/elfi
Commit Name: b19e3080dba989e2e7e08c74877f8396790f83d2
Time: 2016-12-05
Author: jarno.lintusaari@aalto.fi
File Name: elfi/graph.py
Class Name: Node
Method Name: remove_parent


Project Name: vatlab/SoS
Commit Name: 4c42e24634ceb06a562f127d512ace1301c70058
Time: 2017-04-21
Author: ben.bog@gmail.com
File Name: sos/utils.py
Class Name:
Method Name: PrettyRelativeTime