def __init__(self, numStates, numActions, env, name=None): Module.__init__(self, 1, 1, name) ParameterContainer.__init__(self, numStates * numActions) self.numRows = numStates self.numColumns = numActions #self.allowed_actions = range(numActions) self.env = env
def __init__(self, dim, nNeurons, mNeurons=1, name=None, outputFullMap=False): if outputFullMap: outdim = nNeurons * mNeurons else: outdim = 2 Module.__init__(self, dim, outdim, name) # switch modes self.outputFullMap = outputFullMap # create neurons self.neurons = random.random((nNeurons, mNeurons, dim)) self.difference = zeros(self.neurons.shape) self.winner = zeros(2) self.nInput = dim self.nNeurons = nNeurons self.mNeurons = mNeurons self.neighbours = min(nNeurons, mNeurons) self.neighbourdist = min(nNeurons, mNeurons) self.learningrate = 0.001 self.neighbourdecay = 0.9999 self.winner_error = maxint # distance matrix distx, disty = mgrid[0:self.nNeurons, 0:self.mNeurons] self.distmatrix = zeros((self.nNeurons, self.mNeurons, 2)) self.distmatrix[:, :, 0] = distx self.distmatrix[:, :, 1] = disty
def __init__(self, dimState, numActions, name=None): Module.__init__(self, dimState, 1, name) self.network = buildNetwork(dimState + numActions, dimState + numActions, 1) self.numActions = numActions self.numStates = dimState self.bn = BN() self.bn.numActions = numActions
def __init__(self, dimState, numActions, name=None, id2action=None): Module.__init__(self, dimState, 1, name) #self.network = buildNetwork(8,8,1, hiddenclass = ReluLayer ) self.network = buildNetwork(dimState + numActions, dimState + numActions, int((dimState + numActions) / 2), 1, hiddenclass=ReluLayer) self.numActions = numActions self.id2action = id2action
def __init__(self, dimState, numActions, name=None): Module.__init__(self, dimState, 1, name) self.network = buildNetwork(dimState + numActions, dimState + numActions, 1) self.numActions = numActions
def __init__(self, numStates, numActions, name=None): Module.__init__(self, 1, 1, name) ParameterContainer.__init__(self, numStates * numActions) self.numRows = numStates self.numColumns = numActions