Esempio n. 1
0
import lasagne as L
import lasagne.layers as LL
import lasagne.objectives as LO
from lasagne.layers.normalization import batch_norm

sys.path.extend(['/home/mabbasloo/ShapeNet/'])
from icnn import utils_lasagne, dataset, snapshotter
''' Data loading '''

base_path = '/home/mabbasloo/ShapeNet/carData/data/'

ds = dataset.ClassificationDatasetPatchesMinimal(
    '/home/mabbasloo/ShapeNet/carData_train.txt',
    '/home/mabbasloo/ShapeNet/carData_test.txt',
    os.path.join(base_path, 'geovec'),
    os.path.join(base_path, 'disk'),
    None,
    os.path.join(base_path, 'labels'),
    epoch_size=50)
''' Network definition '''

nin = 100
nclasses = 1714
l2_weight = 1e-5


def get_model(inp, patch_op):
    icnn = LL.DenseLayer(inp, 16)
    icnn = batch_norm(
        utils_lasagne.GCNNLayer([icnn, patch_op], 16, nrings=4, nrays=8))
    icnn = batch_norm(
import theano.tensor as T
import theano.sparse as Tsp

import lasagne as L
import lasagne.layers as LL
import lasagne.objectives as LO
from lasagne.layers.normalization import batch_norm

sys.path.append('..')
from icnn import utils_lasagne, dataset, snapshotter

base_path = '../data/'
ds = dataset.ClassificationDatasetPatchesMinimal(
    'train.txt', 'test.txt',
    os.path.join(base_path, 'descs'),
    os.path.join(base_path, 'patch'),
    None,
    os.path.join(base_path, 'labels'),
    epoch_size=100)

nin =795
nclasses = 6890
l2_weight = 1e-5

def get_model(inp, patch_op):

    icnn1 = batch_norm(utils_lasagne.GCNNLayer([icnn, patch_op], 16, nrings=5, nrays=16))
    ffn1 = icnn1

    icnn2 = batch_norm(utils_lasagne.GCNNLayer([icnn1, patch_op], 32, nrings=5, nrays=16))
    ffn2 = icnn2