Ejemplo n.º 1
0
    def __init__(self, X, y=[], hotstart_tradeoff=0.01, state_dims_map=[]):
        SOInterface.__init__(self, X, y)
        self.hotstart_tradeoff = hotstart_tradeoff
        print 'number of dims: '
        print self.dims

        if (state_dims_map == []):
            print 'Create default state-dimension-map.'
            # generate a default state-dimension map (every state uses all avail dims)
            self.state_dims_map = []
            for s in range(self.states):
                self.state_dims_map.append(range(self.dims))
        else:
            self.state_dims_map = state_dims_map

        print 'Calculating jfm dimension indices..'
        cnt = self.transitions
        for s in range(self.states):
            foo = matrix(0, (1, self.dims))
            for d in self.state_dims_map[s]:
                foo[d] = cnt
                cnt += 1
            self.state_dims_jfm_inds.append(foo)
        self.state_dims_entries = cnt - self.transitions

        for s in range(self.states):
            print self.state_dims_jfm_inds[s]

        print self.state_dims_entries
        print self.state_dims_map
        print self.state_dims_jfm_inds
Ejemplo n.º 2
0
	def __init__(self, X, y=[], hotstart_tradeoff=0.01, state_dims_map=[]):
		SOInterface.__init__(self, X, y)	
		self.hotstart_tradeoff = hotstart_tradeoff
		print 'number of dims: '
		print self.dims
		
		if (state_dims_map==[]):
			print 'Create default state-dimension-map.'
			# generate a default state-dimension map (every state uses all avail dims)
			self.state_dims_map = []
			for s in range(self.states):
				self.state_dims_map.append(range(self.dims))
		else:
			self.state_dims_map = state_dims_map

		print 'Calculating jfm dimension indices..'
		cnt = self.transitions
		for s in range(self.states):
			foo = matrix(0, (1, self.dims))
			for d in self.state_dims_map[s]:
				foo[d] = cnt
				cnt += 1
			self.state_dims_jfm_inds.append(foo)
		self.state_dims_entries = cnt - self.transitions

		for s in range(self.states):
			print self.state_dims_jfm_inds[s]

		print self.state_dims_entries
		print self.state_dims_map
		print self.state_dims_jfm_inds
Ejemplo n.º 3
0
 def __init__(self, X, y=[], num_states=2, hotstart_tradeoff=0.1):
     SOInterface.__init__(self, X, y)
     self.states = num_states
     self.start_p = matrix(1.0, (self.states, 1))
     #self.start_p[0] = 0.2
     self.hotstart_tradeoff = hotstart_tradeoff
     print('Number of states = {0}'.format(num_states))
Ejemplo n.º 4
0
 def __init__(self, X, classes, y=None):
     # the class also acts as indices therefore: y >= 0!
     SOInterface.__init__(self, X, y)
     self.num_classes = classes
     self.dims = self.feats
Ejemplo n.º 5
0
 def __init__(self, X, y=None, num_states=2, hotstart_tradeoff=0.1):
     SOInterface.__init__(self, X, y)
     self.states = num_states
     self.start_p = np.ones(self.states)
     self.hotstart_tradeoff = hotstart_tradeoff
Ejemplo n.º 6
0
	def __init__(self, X, y=[], hotstart_tradeoff=0.01):
		SOInterface.__init__(self, X, y)	
		self.hotstart_tradeoff = hotstart_tradeoff
Ejemplo n.º 7
0
 def __init__(self, X, y=[], num_states=2, hotstart_tradeoff=0.1):
     SOInterface.__init__(self, X, y)
     self.states = num_states
     self.start_p = matrix(1.0, (self.states, 1))
     #self.start_p[0] = 0.0
     self.hotstart_tradeoff = hotstart_tradeoff
Ejemplo n.º 8
0
	def __init__(self, X, y=[], num_states=2, hotstart_tradeoff=0.1):
		SOInterface.__init__(self, X, y)	
		self.states = num_states
		self.start_p = matrix(1.0, (self.states, 1))
		#self.start_p[0] = 0.0
		self.hotstart_tradeoff = hotstart_tradeoff
Ejemplo n.º 9
0
 def __init__(self, X, classes, y=[]):
     # the class also acts as indices therefore:
     # y >= 0!
     SOInterface.__init__(self, X, y)
     self.num_classes = classes