def __init__(self, module, maxComplexity=None, **args):
     """ the default maxComplexity is the number of parameters in the module. """
     Evolvable.__init__(self, module)
     if maxComplexity == None:
         self.maxComplexity = self.module.paramdim
     else:
         self.maxComplexity = maxComplexity
     self.randomize(**args)
 def __init__(self, module, maxComplexity = None, **args):
     """ the default maxComplexity is the number of parameters in the module. """
     Evolvable.__init__(self, module)
     if maxComplexity == None:
         self.maxComplexity = self.module.paramdim
     else:
         self.maxComplexity = maxComplexity
     self.randomize(**args)
Beispiel #3
0
    def __init__(self, spokes=..., angle=0):
        Evolvable.__init__(self)

        self.spokeProjFrac = np.cos(2 * np.pi / 60)
        #print(self.spokeProjFrac)
        if spokes is ...:
            self.randomize()
        else:
            self.spokes = spokes
            self.sangle = angle
        self.spokes = np.clip(self.spokes, 0, 1)
Beispiel #4
0
 def copy(self, keepBuffers=False):
     if not keepBuffers:
         self._resetBuffers()
     cp = Evolvable.copy(self)
     if self.paramdim > 0:
         cp._setParameters(self.params.copy())
     return cp
Beispiel #5
0
 def copy(self):
     """ copy everything, except the pcontainer """
     # CHECKME: is this correct, or might it be misleading?
     tmp = self.pcontainer
     self.pcontainer = None
     cp = Evolvable.copy(self)
     cp.pcontainer = tmp
     self.pcontainer = tmp
     return cp