예제 #1
0
def verify_model(single_model,dataset):
    is_verify = True

    if isinstance(single_model,dict):
        single_model = get_original_format(single_model)

    single_model = format_into_normal_form(single_model)

    if dataset =="cifar10":
        train_model_cifar10(single_model,is_verify)
    elif dataset == 'mnist':
        train_model_mnist(single_model,is_verify)
def verify_model(single_model,dataset):
    ############################################################################
    # FUNCTION DESCRIPTION:  function to test single model
    ############################################################################
    is_verify = True

    if isinstance(single_model,dict):
        single_model = get_original_format(single_model)

    single_model = format_into_normal_form(single_model)

    if dataset =="cifar10":
        train_model_cifar10(single_model,is_verify)
    elif dataset == 'mnist':
        train_model_mnist(single_model,is_verify)
예제 #3
0
def train_new_model(data,action_array,dataset):
    #print("______________________________________________________")
    #print("_________________ CANNOT FIND A MATCH ________________")
    #print("______________________________________________________")
    # num_model = NUM_MODEL_FROM_EXPERIENCE_REPLAY
    # if UPDATE_FROM_MEM_REPLAY:
    #     update_qtable_from_mem_replay(data,num_model,dataset)
    # return 1

    if dataset == "cifar10":
        return train_model_cifar10(action_array)
    elif dataset == "mnist":
        return train_model_mnist(action_array)
예제 #4
0
def train_new_model(data,action_array,dataset):
    ############################################################################
    # FUNCTION DESCRIPTION: function to train new model if Q agent unable to find
    #                       from the experience replay.
    ############################################################################

    if UPDATE_AFTER_FIND_NEW_MODEL:
        update_qtable_from_mem_replay(data,NUM_MODEL_AFTER_FIND_NEW_MODEL,dataset)

    if dataset == "cifar10":
        return train_model_cifar10(action_array)
    elif dataset == "mnist":
        return train_model_mnist(action_array)
예제 #5
0
def train_new_model(data,action_array,dataset):
    print("_________________ CANNOT FIND A MATCH _______________")
    print("______________________________________________________")

    # num_model = 5
    # update_qtable_from_mem_replay(data,num_model,dataset)

    # print("LENGTH_DATA :::::::::::::::::::: ", len(data))
    # return 1
    # return random.uniform(0.70,0.75)
    # print("action_array: ",action_array)
    # return get_from_mem_replay(data,action_array)
    if dataset == "cifar10":
        return train_model_cifar10(action_array)
    elif dataset == "mnist":
        return train(action_array)