Esempio n. 1
0
def _init(port):
    connection = Connection.Connection(ip='localhost', port=port, server=False)
    status, data = connection.readMessage()
    assert status == STATUS_INIT_MODEL

    modelAsBytes, trainerSettings = data
    modelAbsPath = _writeModelToDiskAsBytes(modelAsBytes)
    Hyperparameters.REPLAY_BUFFER_LENGTH = trainerSettings[0]
    Hyperparameters.SLIDING_WINDOW_TURNS_TO_FULL = trainerSettings[1]

    # Used for naming the runtime analasys log
    if ("Y" in input("Use old training data (Y/N):").upper()):
        MemoryBuffers.loadOldTrainingDataFromDisk()

    return connection, modelAbsPath
Esempio n. 2
0
def benchmark():
    import RootDir

    print("Loading training data...")
    MemoryBuffers.loadOldTrainingDataFromDisk()
    absPath = RootDir.getAbsolutePath(input("ModelName: "))
    gpuSettings = input("Gpu Settings: ")
    t1 = time.time()

    dStates, dEvals, dPolics = MemoryBuffers.getDistinctTrainingData()
    print("Data pre-processing finished:", time.time() - t1)

    useMultipleModels = MachineSpecificSettings.AMOUNT_OF_GPUS > 1
    _fitModelProc(absPath, useMultipleModels, gpuSettings, 0, dStates, dEvals,
                  dPolics, t1)
    print("Full training finished:", time.time() - t1)