示例#1
0
    def __init__(self, value=None, N=1, proposal=numpy.eye(1)):
        #print numpy.array([0.0]*N), [prposal
        if value is None:
            value = numpy.random.multivariate_normal(numpy.array([0.0] * N),
                                                     proposal)
        Hypothesis.__init__(self, value=value)

        self.__dict__.update(locals())
示例#2
0
 def __init__(self, value=None, n=1, proposal=None):
     if proposal is None:
         proposal = numpy.eye(n)
     if value is None:
         value = numpy.random.multivariate_normal(numpy.array([0.0]*n), proposal)
     Hypothesis.__init__(self, value=value)
     self.n = n
     self.proposal = proposal
     self.__dict__.update(locals())
示例#3
0
	def __init__(self, value=None, f=None, args=['x']):
		"""
			value - the value of this hypothesis
			f - defaultly None, in which case this uses self.value2function
			args - the argumetns to the function
		"""
		self.args = args # must come first since below calls value2function
		Hypothesis.__init__(self,value) # this initializes prior and likleihood variables, so keep it here!
		self.set_value(value,f)
示例#4
0
 def __init__(self, value=None, n=1, proposal=None, propose_scale=1.0, propose_n=1):
     self.n = n
     self.propose_n = propose_n
     if value is None:
         value = np.random.multivariate_normal(np.array([0.0] * n), proposal)
     if proposal is None:
         proposal = np.eye(n) * propose_scale
     propose_mask = self.get_propose_mask()
     proposal = proposal * propose_mask
     self.proposal = proposal
     Hypothesis.__init__(self, value=value)
     self_update(self, locals())
示例#5
0
    def __init__(self, value=None, f=None, args=['x'], **kwargs):
        """
                *value* - the value of this hypothesis

                *f* - defaultly None, in which case this uses self.value2function

                *args* - the arguments to the function
        """
        self.args = args  # must come first since below calls value2function
        Hypothesis.__init__(
            self, value, **kwargs
        )  # this initializes prior and likleihood variables, so keep it here!
        self.set_value(value, f)
示例#6
0
    def __init__(self, value=None, f=None, display="lambda x: %s", **kwargs):
        """
                *value* - the value of this hypothesis

                *f* - defaultly None, in which case this uses self.value2function

                *args* - the arguments to the function
        """
        # this initializes prior and likleihood variables, so keep it here!
        # However, don't give it value, since then it calls set_value with no f argument!
        Hypothesis.__init__(self, None, display=display, **kwargs)

        # And set our value
        self.set_value(value, f=f)
示例#7
0
    def __init__(self, value=None, f=None, args=['x'], **kwargs):
        """
                *value* - the value of this hypothesis

                *f* - defaultly None, in which case this uses self.value2function

                *args* - the arguments to the function
        """
        self.args = args  # must come first since below calls value2function

        # this initializes prior and likleihood variables, so keep it here!
        # However, don't give it value, since then it calls set_value with no f argument!
        Hypothesis.__init__(self, None, **kwargs)

        # And set our value
        self.set_value(value, f=f)
示例#8
0
    def __init__(self, value=None, f=None, args=['x'], **kwargs):
        """
                *value* - the value of this hypothesis

                *f* - defaultly None, in which case this uses self.value2function

                *args* - the arguments to the function
        """
        self.args = args # must come first since below calls value2function

        # this initializes prior and likleihood variables, so keep it here!
        # However, don't give it value, since then it calls set_value with no f argument!
        Hypothesis.__init__(self, None, **kwargs)

        # And set our value
        self.set_value(value, f=f)
示例#9
0
 def __init__(self,
              value=None,
              n=1,
              proposal=None,
              propose_scale=1.0,
              propose_n=1):
     self.n = n
     self.propose_n = propose_n
     if value is None:
         value = np.random.multivariate_normal(np.array([0.0] * n),
                                               proposal)
     if proposal is None:
         proposal = np.eye(n) * propose_scale
     propose_mask = self.get_propose_mask()
     proposal = proposal * propose_mask
     self.proposal = proposal
     Hypothesis.__init__(self, value=value)
     self_update(self, locals())
示例#10
0
    def __init__(self,value=None, N=1, proposal=numpy.eye(1)):
        #print numpy.array([0.0]*N), [prposal
        if value is None: value = numpy.random.multivariate_normal(numpy.array([0.0]*N), proposal)
        Hypothesis.__init__(self, value=value)

        self.__dict__.update(locals())