438b2a63d195c8f5ccecae35d577d8bfde354406,framework/Optimizers/GeneticAlgorithm.py,GeneticAlgorithm,_useRealization,#GeneticAlgorithm#Any#Any#,352
Before Change
//// IN THIS CASE we will have 3 children
//// TODO: This is to be removed
size = self._nChildren if self.counter > 1 else self._populationSize
populationRlz = xr.concat((rlz for _ in range(size)))//((rlz, rlz, rlz))
population = xr.DataArray(populationRlz[list(self.toBeSampled)].to_array().transpose(),
dims=["chromosome","Gene"],
coords={"chromosome": np.arange(size),
"Gene":list(self.toBeSampled)})//np.arange(len(self.toBeSampled))
// TODO: This is to be removed once the rlz is consistent with the expected batch
for i in range(1,size):
population[i,:] = randomUtils.randomPermutation(list(population[0,:].data), self)//np.random.choice(population[0,:],len(self.toBeSampled), replace=False)
//// TODO the whole skeleton should be here, this should be calling all classes and _private methods.
traj = info["traj"]
// info["optVal"] = rlz[self._objectiveVar]
self.incrementIteration(traj)
info["step"] = self.counter
After Change
// self._submitRun(newRlz, traj, self.getIteration(traj))
// childrenDict = children.to_dict()
// newRlz = children.to_dataset(name="data")
d = {"dims":["chromosome","Gene"],
"coords":{"chromosome": np.arange(size),
"Gene":np.arange(len(self.toBeSampled))},
"data":children.data}
// newRlz = xr.Dataset.from_dict(d)
// children.to_dataset(name = "children")
newRlz = xr.Dataset({("chromosome","Gene"):children.data})
// newRlz = xr.Dataset(({"chromosome":[1,2,3,4,5,6,7,8,9,10],"Gene":[0,1,2,3,4,5]},children.data))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: idaholab/raven
Commit Name: 438b2a63d195c8f5ccecae35d577d8bfde354406
Time: 2020-08-22
Author: mohammad.abdo@inl.gov
File Name: framework/Optimizers/GeneticAlgorithm.py
Class Name: GeneticAlgorithm
Method Name: _useRealization
Project Name: Qiskit/qiskit-aqua
Commit Name: 9907fc0aecba835c529ca7de1f6067eecebbb000
Time: 2020-05-11
Author: jules.gacon@googlemail.com
File Name: test/aqua/test_vqc.py
Class Name: TestVQC
Method Name: setUp
Project Name: ray-project/ray
Commit Name: 57544b1ff9f97d4da9f64d25c8ea5a3d8d247ffc
Time: 2020-05-11
Author: sven@anyscale.io
File Name: rllib/examples/nested_action_spaces.py
Class Name:
Method Name: