Esempio n. 1
0
def makeFilenames(data_name, cell_size, epoch, batch_size, timesteps, offset):
    label_name = gue.tasksize_extractor(data_name)
    rep_number = gue.rep_extractor(data_name)

    result_path = "./result/" + str(label_name) + "_" + str(rep_number) + "/"
    id = "c" + str(cell_size) + "_e" + str(epoch) + "_b" + str(
        batch_size) + "_ti" + str(timesteps) + "_o" + str(offset) + "l6"
    modelname = result_path + id + ".model"
    statname = result_path + id + ".json"

    return result_path, modelname, statname
Esempio n. 2
0
if __name__ == "__main__":

    trainSplit = 0.8

    cell_size = 32
    epoch = 20
    batchSize = 100
    timesteps = 100
    offset = 10000
    targetTask = 0

    fileNames = glob.glob('./data/*.data')

    for fileName in fileNames:

        label_card = gue.tasksize_extractor(fileName) + 1

        modelExists = False

        result_path, modelname, statname = makeFilenames(
            fileName, cell_size, epoch, batchSize, timesteps, offset)
        originalTrace = cvt.readTraceFile(fileName)
        originalTrace = originalTrace[100:100000]
        # originalTrace = cvt.cut_random(originalTrace, 0.1, 0.01, fileName)
        # trim the first couple of sequence of original trace
        _, inverse = get_priors(originalTrace)

        if gue.file_exists(modelname):
            modelExists = True

        train_X = []