コード例 #1
0
ファイル: model.py プロジェクト: rewonc/queequeg



if __name__ == '__main__':

    trial_name = 'whale_segmentation'
    snippets = [
        ["data", "dataset.py"],
    ]
    with dslib.trial.run_trial(trial_name=trial_name,
                               trials_dir=trials_dir,
                               description=[],
                               snippets=snippets) as trial:

        train_ds, valid_ds = dataset.get_train_test_gens()

        with train_ds as train_gen, valid_ds as valid_gen:

            valid_chunk = valid_gen.next()
            import theano
            import treeano
            import canopy
            import canopy.sandbox.monitor_ui


            print "Making new model."
            model = make_model(params)
            print(model)
            network = model.network()
コード例 #2
0
import dataset
import tflib

'''
CONSTANTS
'''

BATCH_SIZE = 4
IMWIDTH = 200
IMHEIGHT = 280
TESTSPLIT = 0.20
TRIAL_NAME = 'whale1'

tr, te = dataset.get_train_test_gens(
    anno_type='Head', rel_img_path='../imgs/',
    desired_output_size=(IMWIDTH, IMHEIGHT),
    test_split_percentage=TESTSPLIT,
    annotations_dir='../code/right_whale_hunt/annotations/',
    chunk_size=BATCH_SIZE)

# input / output placeholders
x_in = tf.placeholder("float", [BATCH_SIZE, IMWIDTH, IMHEIGHT, 3])
y_in = tf.placeholder("float", [BATCH_SIZE, IMWIDTH, IMHEIGHT, 1])
# keep probability for dropout
keep_prob = tf.placeholder("float")

conv1a = tflib.conv_bn_relu(x_in,
                            kernel_size=[3, 3],
                            out_filters=32,
                            scope="conv1a",
                            summarize=True)
conv1a_do = tflib.dropout(conv1a, keep_prob)