Example #1
0
 def __init__(self, dim, name=None):
     NeuronLayer.__init__(self, dim, name)
     # initialize sigmas to 0
     ParameterContainer.__init__(self, dim, stdParams = 0)
     # if autoalpha is set to True, alpha_sigma = alpha_mu = alpha*sigma^2
     self.autoalpha = False
     self.enabled = True
Example #2
0
    def __init__(self, dim, module, name=None, onesigma=True):
        NeuronLayer.__init__(self, dim, name)
        self.exploration = zeros(dim, float)
        self.state = None
        self.onesigma = onesigma

        if self.onesigma:
            # one single parameter: sigma
            ParameterContainer.__init__(self, 1)
        else:
            # sigmas for all parameters in the exploration module
            ParameterContainer.__init__(self, module.paramdim)

        # a module for the exploration
        assert module.outdim == dim, "Passed module does not have right dimension"
        self.module = module
        self.autoalpha = False
        self.enabled = True
 def __init__(self, dim, module, name=None, onesigma=True):
     NeuronLayer.__init__(self, dim, name)
     self.exploration = zeros(dim, float)
     self.state = None
     self.onesigma = onesigma
     
     if self.onesigma:
         # one single parameter: sigma
         ParameterContainer.__init__(self, 1)
     else:
         # sigmas for all parameters in the exploration module
         ParameterContainer.__init__(self, module.paramdim)
     
     # a module for the exploration
     assert module.outdim == dim, (
         "Passed module does not have right dimension")
     self.module = module
     self.autoalpha = False
     self.enabled = True
 def __init__(self, dim, name=None, threshold=0.5):
     NeuronLayer.__init__(self, dim, name)
     self.t = threshold