Esempio n. 1
0
 def setUp(self):
     self.encoder = OneDDepthEncoder(name="one_d_depth",
                                     positions=range(36),
                                     radius=3,
                                     wrapAround=False,
                                     nPerPosition=57,
                                     wPerPosition=3,
                                     minVal=0,
                                     maxVal=1)
Esempio n. 2
0
    def __init__(self, position):
        self.encoder = OneDDepthEncoder(positions=positions,
                                        radius=5,
                                        wrapAround=True,
                                        nPerPosition=28,
                                        wPerPosition=3,
                                        minVal=0,
                                        maxVal=1)
        self.plotter = Plotter(self.encoder)
        self.learner = QLearner(ACTIIONS, n=1008)

        self.lastState = None
        self.lastAction = None
Esempio n. 3
0
def prepareDepthData(inputDir, encoder_params):
    depthDir = os.path.join(os.path.dirname(__file__), inputDir)
    SDRs = []

    encoder = OneDDepthEncoder(**encoder_params)

    for f in os.listdir(depthDir):
        if f.endswith(".txt"):
            print "Loading ", f
            dataPath = os.path.join(depthDir, f)
            depthData = np.loadtxt(dataPath)
            SDR = encoder.encode(depthData)
            SDRs.append(SDR)

    return SDRs