Exemplo n.º 1
0
def train_orientation(output_path):
    from jpcnn.core import JPCNN_Network, JPCNN_Data
    print('[orientation] Loading the Orientation training data')
    data_list, label_list = load_orientation()

    print('[orientation] Loading the data into a JPCNN_Data')
    data = JPCNN_Data()
    data.set_data_list(data_list)
    data.set_label_list(label_list)

    print('[orientation] Create the JPCNN_Model used for training')
    model = Orientation_Model()

    print('[orientation] Create the JPCNN_network and start training')
    net = JPCNN_Network(model, data)
    net.train(
        output_path,
        train_learning_rate=0.01,
        train_batch_size=128,
        train_max_epochs=100,
    )
Exemplo n.º 2
0
def train_orientation(output_path):
    from jpcnn.core import JPCNN_Network, JPCNN_Data
    print('[orientation] Loading the Orientation training data')
    data_list, label_list = load_orientation()

    print('[orientation] Loading the data into a JPCNN_Data')
    data = JPCNN_Data()
    data.set_data_list(data_list)
    data.set_label_list(label_list)

    print('[orientation] Create the JPCNN_Model used for training')
    model = Orientation_Model()

    print('[orientation] Create the JPCNN_network and start training')
    net = JPCNN_Network(model, data)
    net.train(
        output_path,
        train_learning_rate=0.01,
        train_batch_size=128,
        train_max_epochs=100,
    )
Exemplo n.º 3
0
def train_classifier(output_path, **kwargs):
    print('[classifier] Loading the classifier training data')
    data_list, label_list = load_classifier(**kwargs)

    print('[classifier] Loading the data into a JPCNN_Data')
    data = JPCNN_Data()
    data.set_data_list(data_list)
    data.set_label_list(label_list)

    print('[classifier] Create the JPCNN_Model used for training')
    model = Classifier_Model()

    print('[classifier] Create the JPCNN_network and start training')
    net = JPCNN_Network(model, data)
    model_path = net.train(
        output_path,
        train_learning_rate=0.01,
        train_batch_size=64,
        train_max_epochs=40,
        train_mini_batch_augment=False,
    )
    return model_path
Exemplo n.º 4
0
def train_labeler(output_path, **kwargs):
    print('[labeler] Loading the labeler training data')
    data_list, label_list = load_labeler(**kwargs)

    print('[labeler] Loading the data into a JPCNN_Data')
    data = JPCNN_Data()
    data.set_data_list(data_list)
    data.set_label_list(label_list)

    print('[labeler] Create the JPCNN_Model used for training')
    model = Labeler_Model()

    print('[labeler] Create the JPCNN_network and start training')
    net = JPCNN_Network(model, data)
    model_path = net.train(
        output_path,
        train_learning_rate=0.01,
        train_batch_size=64,
        train_max_epochs=5,
        train_mini_batch_augment=False,
    )
    return model_path