Esempio n. 1
0
def trainNeuralNetwork(MyNeuralNetwork):
    error = float(input('Input target error(0.1)\n>>>'))
    epochs = int(input('Input max epochs(-1)\n>>>'))
    print('Getting Datas...')
    Datas = IO.getDatas()
    print('Datas getted')
    if IO.getProfile(MyNeuralNetwork) == None:
        print('You must have training profile first!')
        editNeuralNetworkProfile(MyNeuralNetwork)
    Profile = IO.getProfile(MyNeuralNetwork)
    # Get Input/OutputData to matrix
    if IO.getValuefromConfigfile('setting.json', 'Verbose') != None:
        verbose = int(IO.getValuefromConfigfile('setting.json', 'Verbose'))
    else:
        verbose = p.VERBOSE_DEFAULT
    if IO.getValuefromConfigfile('setting.json', 'Loop_per_N_times') != None:
        loop = int(IO.getValuefromConfigfile('setting.json', 'Loop_per_N_times'))
    else:
        loop = p.VERBOSE_PER_LOOP_DEFAULT
    # Setting from config file
    TrainingType.trainbyBatch(MyNeuralNetwork, Datas, error, epochs, Profile, verbose, loop)
Esempio n. 2
0
def printNeuralNetworkProfile(MyNeuralNetwork):
    print(MyNeuralNetwork.Name + ' neuralnet\'s training profile:')
    print(IO.getProfile(MyNeuralNetwork))