├── .gitignore ├── .gitmodules ├── .pre-commit-config.yaml ├── README.md ├── bin ├── browse_conv_weights ├── classification_report_npz ├── convert_to_npz_dataset ├── diff_monitor ├── download_binarized_mnist ├── download_cifar10 ├── download_gtzan ├── download_mnist ├── download_svhn ├── find_gpu_fields ├── fused_lasso_debug ├── get_splits ├── get_version ├── gpu_pkl_to_cpu_pkl ├── gpu_test ├── gsn_example ├── hist_weights ├── jobdispatch ├── jobman ├── jobman_sqlschedule ├── launcher.pbs ├── launcher.slurm ├── multi_best_plot ├── num_parameters ├── pkl_inspector ├── plot_activation_functions ├── plot_audio_tracks ├── plot_from_db ├── plot_from_predictions ├── plot_monitor ├── predict ├── print_channel_doc ├── print_model ├── print_monitor ├── print_monitor_cv ├── show_binocular_greyscale_examples ├── show_examples ├── show_weights ├── summarize_model ├── train ├── weights └── yaml_dryrun ├── experiments ├── dixon │ └── mlp.yaml ├── fused-lasso │ ├── README.md │ ├── gtzan-conv-base.yaml │ ├── gtzan-conv-fl-2d.yaml │ ├── gtzan-conv-fl-horiz.yaml │ ├── gtzan-conv-fl-vert.yaml │ ├── gtzan-conv-l1-base.yaml │ ├── gtzan-conv-l1-fl-2d.yaml │ ├── gtzan-conv-l1-fl-horiz.yaml │ ├── gtzan-conv-l1-fl-vert.yaml │ ├── gtzan-softmax-base.yaml │ ├── gtzan-softmax-fl-2d.yaml │ ├── gtzan-softmax-fl-horiz.yaml │ ├── gtzan-softmax-fl-vert.yaml │ ├── gtzan-softmax-l1-base.yaml │ ├── gtzan-softmax-l1-fl-2d.yaml │ ├── gtzan-softmax-l1-fl-horiz.yaml │ ├── gtzan-softmax-l1-fl-vert.yaml │ ├── hp │ │ ├── gtzan-conv-l1-base.yaml │ │ ├── gtzan-conv-l1-fl-2d.yaml │ │ ├── gtzan-conv-l1-fl-horiz.yaml │ │ ├── gtzan-conv-l1-fl-vert.yaml │ │ ├── gtzan-softmax-l1-base-bgd.yaml │ │ ├── gtzan-softmax-l1-fl-horiz-bgd-real.yaml │ │ ├── gtzan-softmax-l1-fl-horiz-bgd.yaml │ │ ├── mnist-softmax-l1-base-bgd.yaml │ │ └── mnist-softmax-l1-fl-2d-bgd-l1.yaml │ ├── mnist-conv-base.yaml │ ├── mnist-conv-fl-2d.yaml │ ├── mnist-conv-fl-horiz.yaml │ ├── mnist-conv-fl-vert.yaml │ ├── mnist-conv-l1-base.yaml │ ├── mnist-conv-l1-fl-2d.yaml │ ├── mnist-conv-l1-fl-horiz.yaml │ ├── mnist-conv-l1-fl-vert.yaml │ ├── mnist-softmax-base.yaml │ ├── mnist-softmax-fl-2d.yaml │ ├── mnist-softmax-fl-horiz.yaml │ ├── mnist-softmax-fl-vert.yaml │ ├── mnist-softmax-l1-base.yaml │ ├── mnist-softmax-l1-fl-2d-bgd.yaml │ ├── mnist-softmax-l1-fl-2d.yaml │ ├── mnist-softmax-l1-fl-horiz.yaml │ ├── mnist-softmax-l1-fl-vert.yaml │ └── models │ │ ├── gtzan-conv-l1-base.yaml │ │ ├── gtzan-conv-l1-fl-2d.yaml │ │ ├── gtzan-conv-l1-fl-horiz.yaml │ │ ├── gtzan-conv-l1-fl-vert.yaml │ │ ├── gtzan-softmax-l1-base-bgd.yaml │ │ ├── gtzan-softmax-l1-base.yaml │ │ ├── gtzan-softmax-l1-fl-horiz-bgd.yaml │ │ ├── gtzan-softmax-l1-fl-horiz.yaml │ │ ├── mnist-softmax-l1-base-bgd.yaml │ │ ├── mnist-softmax-l1-base.yaml │ │ ├── mnist-softmax-l1-fl-2d-bgd.yaml │ │ └── mnist-softmax-l1-fl-2d.yaml ├── gtzan-shape │ ├── gtzan-convnet10.yaml │ ├── gtzan-convnet5.yaml │ ├── hp │ │ ├── gtzan-convnet1.yaml │ │ └── gtzan-convnet2.yaml │ └── models │ │ ├── gtzan-conv-scale1.yaml │ │ ├── gtzan-convnet1.yaml │ │ └── gtzan-convnet2.yaml ├── jobman │ ├── hyperparameters │ │ ├── different_conv_shapes_l1reg.yaml │ │ ├── l1_regularization.yaml │ │ └── l1_regularization_bumpzoom.yaml │ └── models │ │ ├── conv_2relu.yaml │ │ ├── conv_3relu.yaml │ │ ├── conv_3relu_l1reg.yaml │ │ ├── conv_3relu_l1reg_small.yaml │ │ └── conv_simple_3relu.yaml ├── l1plot │ ├── hyperparameters │ │ ├── gtzan-simple.yaml │ │ └── mnist-simple.yaml │ └── models │ │ ├── gtzan-simple.yaml │ │ └── mnist-simple.yaml ├── mnist-test │ └── mnist.yaml ├── singlerun │ ├── conv_20150110A.yaml │ ├── conv_20150110B.yaml │ ├── conv_20150110C.yaml │ ├── conv_20150502.yaml │ ├── conv_20150917A.yaml │ ├── conv_4sec_20150501.yaml │ ├── conv_5sec_20150203A.yaml │ ├── conv_dropout_20150116A.yaml │ ├── conv_dropout_20150116B.yaml │ ├── conv_dropout_20150116C.yaml │ ├── conv_dropout_20150116D.yaml │ ├── conv_fast_20150119A.yaml │ ├── l1reg_conv_fast_20150130A.yaml │ ├── l1reg_conv_fast_20150130B.yaml │ ├── l1reg_conv_fast_20150130C.yaml │ ├── l1reg_conv_fast_20150130D.yaml │ ├── l1reg_conv_fast_20150130E.yaml │ ├── l1reg_conv_fast_20150130F.yaml │ ├── l1reg_conv_fast_20150130G.yaml │ ├── l1reg_conv_fast_20150130H.yaml │ ├── l1reg_conv_fast_20150130I.yaml │ ├── l1reg_conv_fast_20150209A.yaml │ ├── l1reg_conv_fast_20150209B.yaml │ ├── l1reg_conv_fast_20150209C.yaml │ ├── l1reg_conv_fast_20150209D.yaml │ ├── l1reg_conv_fast_20150209E.yaml │ ├── l1reg_conv_fast_20150209F.yaml │ ├── l1reg_conv_fast_20150209G.yaml │ ├── l1reg_conv_fast_20150209H.yaml │ ├── l1reg_conv_fast_20150209I.yaml │ ├── l1reg_conv_fast_20150209_2A.yaml │ ├── l1reg_conv_fast_20150209_2B.yaml │ ├── l1reg_conv_fast_20150209_2C.yaml │ ├── l1reg_conv_fast_20150209_2D.yaml │ ├── l1reg_conv_fast_20150209_2E.yaml │ ├── l1reg_conv_fast_20150209_2F.yaml │ ├── l1reg_conv_fast_20150209_2G.yaml │ ├── l1reg_conv_fast_20150209_2H.yaml │ ├── l1reg_conv_fast_20150209_2I.yaml │ ├── mlp_20150107A.yaml │ ├── mlp_20150107B.yaml │ ├── mlp_20150107C.yaml │ ├── mlp_20150107D.yaml │ ├── mlp_5sec_20150203A.yaml │ ├── mlp_5sec_20150203B.yaml │ ├── mlp_fie_20150112A.yaml │ ├── mlp_fie_20150112B.yaml │ ├── mlp_fie_20150112C.yaml │ └── mlp_fie_20150112D.yaml └── test │ ├── conv.yaml │ ├── conv_seed_test.yaml │ ├── conv_tw.yaml │ ├── conv_ws.yaml │ ├── conv_ws_fcl.yaml │ ├── conv_ws_fl.yaml │ ├── conv_ws_fl_many.yaml │ ├── conv_ws_fl_many_debug.yaml │ ├── conv_ws_fl_many_debug_horiz.yaml │ ├── conv_ws_fl_shape.yaml │ ├── conv_ws_fl_wd.yaml │ ├── cross_validation.yaml │ ├── logreg.yaml │ ├── mlp.yaml │ ├── mlp_tw.yaml │ ├── softmax.yaml │ ├── softmax_mnist.yaml │ └── softmax_ws.yaml ├── genretron ├── __init__.py ├── audio_dataset.py ├── audio_track.py ├── gtzan.py ├── jobman_utils.py ├── kfold.py ├── logistic_regression.py ├── preprocessors.py ├── spectrogram.py └── utils.py ├── requirements.txt ├── results └── .gitignore ├── setup.py └── tests ├── test_audio_dataset_splits.py └── test_audio_dataset_vectorspace.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # PyInstaller 26 | # Usually these files are written by a python script from a template 27 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 28 | *.manifest 29 | *.spec 30 | 31 | # Installer logs 32 | pip-log.txt 33 | pip-delete-this-directory.txt 34 | 35 | # Unit test / coverage reports 36 | htmlcov/ 37 | .tox/ 38 | .coverage 39 | .cache 40 | nosetests.xml 41 | coverage.xml 42 | 43 | # Translations 44 | *.mo 45 | *.pot 46 | 47 | # Django stuff: 48 | *.log 49 | 50 | # Sphinx documentation 51 | docs/_build/ 52 | 53 | # PyBuilder 54 | target/ 55 | 56 | # Saved results 57 | *.pkl 58 | jobman_*/ 59 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pylearn2"] 2 | path = pylearn2 3 | url = git@github.com:crmne/pylearn2.git 4 | [submodule "jobman"] 5 | path = jobman 6 | url = git@github.com:crmne/jobman.git 7 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | - repo: git://github.com/pre-commit/pre-commit-hooks 2 | sha: 64943e86417774b9d6ba63c74e00f8cc3e2119e0 3 | hooks: 4 | - id: trailing-whitespace 5 | - id: autopep8-wrapper 6 | - id: check-added-large-files 7 | - id: check-ast 8 | - id: check-case-conflict 9 | - id: check-docstring-first 10 | - id: check-json 11 | - id: check-merge-conflict 12 | - id: debug-statements 13 | - id: end-of-file-fixer 14 | - id: fix-encoding-pragma 15 | - id: flake8 16 | - id: name-tests-test 17 | - id: requirements-txt-fixer 18 | -------------------------------------------------------------------------------- /bin/browse_conv_weights: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/browse_conv_weights.py -------------------------------------------------------------------------------- /bin/convert_to_npz_dataset: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import argparse 3 | import numpy as np 4 | import matplotlib 5 | matplotlib.use('Agg') 6 | from pylearn2.utils import serial 7 | 8 | 9 | def parse_args(): 10 | parser = argparse.ArgumentParser() 11 | parser.add_argument("train_file") 12 | parser.add_argument("output_file") 13 | return parser.parse_args() 14 | 15 | 16 | def flatten(l): 17 | return [i for sl in l for i in sl] 18 | 19 | if __name__ == "__main__": 20 | args = parse_args() 21 | train_obj = serial.load_train_file(args.train_file) 22 | npz = {} 23 | for which_set, dataset in train_obj.algorithm.monitoring_dataset.items(): 24 | npz[which_set + "_X"] = dataset.get_topological_view() 25 | npz[which_set + "_y"] = dataset.y 26 | np.savez(args.output_file, **npz) 27 | -------------------------------------------------------------------------------- /bin/diff_monitor: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/diff_monitor.py -------------------------------------------------------------------------------- /bin/download_binarized_mnist: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/datasets/download_binarized_mnist.py -------------------------------------------------------------------------------- /bin/download_cifar10: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/datasets/download_cifar10.sh -------------------------------------------------------------------------------- /bin/download_mnist: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/datasets/download_mnist.py -------------------------------------------------------------------------------- /bin/download_svhn: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/datasets/download_svhn.sh -------------------------------------------------------------------------------- /bin/find_gpu_fields: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/find_gpu_fields.py -------------------------------------------------------------------------------- /bin/get_splits: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # saves the list of songs in each split for GTZAN in 3 | # three different files in the current directory 4 | 5 | import numpy 6 | import argparse 7 | from genretron.gtzan import GTZAN 8 | from pylearn2.config import yaml_parse 9 | 10 | 11 | def parse_args(): 12 | parser = argparse.ArgumentParser() 13 | parser.add_argument("dataset_yaml_src") 14 | parser.add_argument("which_sets", nargs='+') 15 | return parser.parse_args() 16 | 17 | if __name__ == "__main__": 18 | args = parse_args() 19 | 20 | dataset_proxy = yaml_parse.load_path( 21 | args.dataset_yaml_src, instantiate=False) 22 | dataset_params = dataset_proxy.keywords['dataset'].keywords 23 | # dataset_callable = dataset_proxy.keywords['dataset'].callable # useful 24 | # for non gtzan datasets 25 | 26 | for which_set in args.which_sets: 27 | dataset_params['which_set'] = which_set 28 | dataset = GTZAN(**dataset_params) 29 | set_tracks_id = dataset.get_track_ids(dataset.which_set) 30 | set_tracks = numpy.take(dataset.tracks, set_tracks_id).tolist() 31 | unique_track_paths = sorted(set([t.path for t in set_tracks])) 32 | 33 | outfile_name = which_set + '.txt' 34 | with open(outfile_name, 'w') as outfile: 35 | for track_path in unique_track_paths: 36 | outfile.write("{}\n".format(track_path)) 37 | -------------------------------------------------------------------------------- /bin/get_version: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/get_version.py -------------------------------------------------------------------------------- /bin/gpu_pkl_to_cpu_pkl: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/gpu_pkl_to_cpu_pkl.py -------------------------------------------------------------------------------- /bin/gpu_test: -------------------------------------------------------------------------------- 1 | from theano import function, config, shared, sandbox 2 | import theano.tensor as T 3 | import numpy 4 | import time 5 | 6 | vlen = 10 * 30 * 768 # 10 x #cores x # threads per core 7 | iters = 1000 8 | 9 | rng = numpy.random.RandomState(22) 10 | x = shared(numpy.asarray(rng.rand(vlen), config.floatX)) 11 | f = function([], T.exp(x)) 12 | print(f.maker.fgraph.toposort()) 13 | t0 = time.time() 14 | for i in xrange(iters): 15 | r = f() 16 | t1 = time.time() 17 | print("Looping %d times took %f seconds" % (iters, t1 - t0)) 18 | print("Result is %s" % (r,)) 19 | if numpy.any([isinstance(x.op, T.Elemwise) for x in f.maker.fgraph.toposort()]): 20 | print('Used the cpu') 21 | else: 22 | print('Used the gpu') 23 | -------------------------------------------------------------------------------- /bin/gsn_example: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/gsn_example.py -------------------------------------------------------------------------------- /bin/hist_weights: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Shows a histogram of the weights of the model. 4 | """ 5 | import argparse 6 | import pylab 7 | import cPickle as pickle 8 | 9 | __authors__ = "Carmine Paolino" 10 | __copyright__ = "Copyright 2015, Vrije Universiteit Amsterdam" 11 | __credits__ = ["Carmine Paolino"] 12 | __license__ = "3-clause BSD" 13 | __email__ = "carmine@paolino.me" 14 | 15 | 16 | def show_weights(model_path): 17 | """ 18 | Shows a histogram of the weights of the model. 19 | 20 | Parameters 21 | ---------- 22 | model_path : str 23 | Path of the model to show weights for 24 | """ 25 | pkl = pickle.load(open(model_path, 'rb')) 26 | w = pkl.get_weights_topo().flatten() 27 | n, bins, patches = pylab.hist(w, 50) 28 | pylab.show() 29 | 30 | 31 | def make_argument_parser(): 32 | """ 33 | Creates an ArgumentParser to read the options for this script from 34 | sys.argv 35 | """ 36 | parser = argparse.ArgumentParser() 37 | parser.add_argument("path") 38 | return parser 39 | 40 | if __name__ == "__main__": 41 | parser = make_argument_parser() 42 | args = parser.parse_args() 43 | show_weights(args.path) 44 | -------------------------------------------------------------------------------- /bin/jobdispatch: -------------------------------------------------------------------------------- 1 | ../jobman/bin/jobdispatch -------------------------------------------------------------------------------- /bin/jobman: -------------------------------------------------------------------------------- 1 | ../jobman/bin/jobman -------------------------------------------------------------------------------- /bin/jobman_sqlschedule: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | import argparse 4 | import jobman 5 | import itertools 6 | import yaml 7 | from pylearn2.scripts.jobman.experiment import ydict, train_experiment 8 | 9 | 10 | def generate_hyper_parameters(hyperparameters): 11 | dd = jobman.DD() 12 | fixed_hyperparameters = \ 13 | [(k, v) for k, v in hyperparameters.items() if not isinstance(v, list)] 14 | 15 | dd.update(fixed_hyperparameters) 16 | 17 | product_hyperparameters = \ 18 | [(k, v) for k, v in hyperparameters.items() if isinstance(v, list)] 19 | 20 | for p in itertools.product(*[i[1] for i in product_hyperparameters]): 21 | dd.update(zip([i[0] for i in product_hyperparameters], p)) 22 | yield dd 23 | 24 | 25 | def make_argument_parser(): 26 | parser = argparse.ArgumentParser() 27 | parser.add_argument('yaml_config_path') 28 | parser.add_argument('db_path') 29 | parser.add_argument('table_name') 30 | return parser 31 | 32 | if __name__ == '__main__': 33 | # parse arguments 34 | parser = make_argument_parser() 35 | args = parser.parse_args() 36 | 37 | # open connection to db 38 | full_db_path = "{0}?table={1}".format(args.db_path, args.table_name) 39 | db = jobman.api0.open_db(full_db_path) 40 | 41 | # read config 42 | with open(args.yaml_config_path) as f: 43 | config = yaml.load(f.read()) 44 | 45 | with open(config['yaml_template']) as f: 46 | yaml_template = f.read() 47 | 48 | extract_results_function = config['extract_results'] 49 | hyper_parameters = config['hyper_parameters'] 50 | 51 | sys.stdout.write('Generating experiments and sending them to the db') 52 | # generate experiments and put them in db 53 | for h in generate_hyper_parameters(hyper_parameters): 54 | state = jobman.DD() 55 | state.yaml_template = yaml_template 56 | state.hyper_parameters = \ 57 | jobman.expand(jobman.flatten(h), dict_type=ydict) 58 | state.extract_results = extract_results_function 59 | jobman.sql.insert_job( 60 | train_experiment, 61 | jobman.flatten(state), 62 | db) 63 | sys.stdout.write('.') 64 | sys.stdout.flush() 65 | print('') 66 | 67 | # create view 68 | view_db_path = "{0}view".format(args.table_name) 69 | db.createView(view_db_path) 70 | -------------------------------------------------------------------------------- /bin/launcher.pbs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #PBS -S /bin/bash 3 | 4 | function require_vars { 5 | for var in "$@"; do 6 | if [ -v "$var" ]; then 7 | eval value=\$$var 8 | echo "$var=$value" 9 | else 10 | echo "var $var was not found" 11 | exit 1 12 | fi 13 | done 14 | } 15 | 16 | source ~/.bashrc 17 | 18 | require_vars GENRETRON_PATH CONSECUTIVE_JOBS DB_TABLE PYLEARN2_DATA_PATH THEANO_FLAGS 19 | 20 | source $GENRETRON_PATH/env/bin/activate 21 | 22 | $GENRETRON_PATH/bin/jobman sql -n $CONSECUTIVE_JOBS $DB_TABLE $GENRETRON_PATH/results 23 | -------------------------------------------------------------------------------- /bin/launcher.slurm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function require_vars { 4 | for var in "$@"; do 5 | if [ -v "$var" ]; then 6 | eval value=\$$var 7 | echo "$var=$value" 8 | else 9 | echo "var $var was not found" 10 | exit 1 11 | fi 12 | done 13 | } 14 | 15 | . ~/.bashrc 16 | 17 | export CONSECUTIVE_JOBS=$1 18 | export DB_TABLE=$2 19 | 20 | . $GENRETRON_PATH/env/bin/activate 21 | 22 | COMMAND="$GENRETRON_PATH/bin/jobman sql -n $CONSECUTIVE_JOBS $DB_TABLE $GENRETRON_PATH/results" 23 | 24 | echo $COMMAND 25 | srun $COMMAND 26 | -------------------------------------------------------------------------------- /bin/multi_best_plot: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Plots the best training, test and validation values of all the models passed. 4 | """ 5 | import os 6 | import argparse 7 | import numpy 8 | import pylab 9 | import cPickle as pickle 10 | import pylearn2 11 | 12 | __authors__ = "Carmine Paolino" 13 | __copyright__ = "Copyright 2015, Vrije Universiteit Amsterdam" 14 | __credits__ = ["Carmine Paolino"] 15 | __license__ = "3-clause BSD" 16 | __email__ = "carmine@paolino.me" 17 | 18 | 19 | def extract_channels(model_path, channels): 20 | print("Extracting monitoring channels from %s" % 21 | os.path.basename(model_path)) 22 | pkl = pickle.load(open(model_path, 'rb')) 23 | chans = { 24 | channel: pkl.monitor.channels[channel].val_record[-1] 25 | for channel in channels 26 | } 27 | return chans 28 | 29 | 30 | def plot(models, channels, param=None): 31 | model_names = [] 32 | m_vals = [] 33 | for model in models: 34 | model_names.append(os.path.basename(model).replace("_best.pkl", '')) 35 | m_vals.append(extract_channels(model, channels)) 36 | x = numpy.arange(len(model_names)) 37 | 38 | for channel in channels: 39 | y = numpy.asarray([m[channel] for m in m_vals]) 40 | pylab.plot(x, y, label=channel, marker='.') 41 | 42 | pylab.legend(channels, loc='upper center') 43 | 44 | if param: 45 | params = [] 46 | for model_name in model_names: 47 | model = pylearn2.config.yaml_parse.load( 48 | open(model_name + '.yaml'), instantiate=False) 49 | # FIXME 50 | # extracting l1 regularization coefficient: 51 | # generalize to anything in the yaml file 52 | params.append( 53 | model[2]['algorithm'][2]['cost'][2] 54 | ['costs'][1][2]['coeffs']['h2'] 55 | ) 56 | x = numpy.asarray(params) 57 | pylab.xlabel(param) 58 | else: 59 | pylab.xticks(x, model_names, rotation=70) 60 | 61 | pylab.show() 62 | 63 | 64 | def make_argument_parser(): 65 | """ 66 | Creates an ArgumentParser to read the options for this script from 67 | sys.argv 68 | """ 69 | parser = argparse.ArgumentParser() 70 | parser.add_argument("model_paths", nargs='+') 71 | parser.add_argument("--channels", nargs='+') 72 | parser.add_argument("--param") 73 | return parser 74 | 75 | if __name__ == "__main__": 76 | parser = make_argument_parser() 77 | args = parser.parse_args() 78 | plot(args.model_paths, args.channels, args.param) 79 | -------------------------------------------------------------------------------- /bin/num_parameters: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/num_parameters.py -------------------------------------------------------------------------------- /bin/pkl_inspector: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/pkl_inspector.py -------------------------------------------------------------------------------- /bin/plot_activation_functions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import numpy 3 | import argparse 4 | import matplotlib.pyplot as plt 5 | 6 | 7 | def sigmoid(x): 8 | return 1 / (1 + numpy.exp(-x)) 9 | 10 | 11 | def tanh(x): 12 | return numpy.tanh(x) 13 | 14 | 15 | def relu(x): 16 | return numpy.maximum(0, x) 17 | 18 | 19 | def plot(x, y, xlabel, ylabel, legend, title): 20 | plt.title(title) 21 | plt.plot(x, y) 22 | plt.xlabel(xlabel) 23 | plt.ylabel(ylabel) 24 | plt.legend(legend, loc='best') 25 | 26 | 27 | def parse_args(): 28 | parser = argparse.ArgumentParser() 29 | parser.add_argument('--out', default=None) 30 | parser.add_argument('--figsize', nargs=2, type=int, default=[8, 6]) 31 | return parser.parse_args() 32 | 33 | if __name__ == '__main__': 34 | args = parse_args() 35 | 36 | title = "" 37 | 38 | x = numpy.arange(-4, 4, 0.01) 39 | xlabel = r"$z$" 40 | 41 | legend = ['tanh', 'sigmoid', 'rectifier linear'] 42 | 43 | y = numpy.array([tanh(x), sigmoid(x), relu(x)]).T 44 | ylabel = r"$f(z)$" 45 | 46 | plt.figure(figsize=tuple(args.figsize)) 47 | plt.style.use('ggplot') 48 | plot(x, y, xlabel, ylabel, legend, title) 49 | if args.out: 50 | plt.savefig(args.out, dpi=300, bbox_inches='tight') 51 | else: 52 | plt.show() 53 | -------------------------------------------------------------------------------- /bin/plot_audio_tracks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from genretron.gtzan import GTZAN 3 | 4 | if __name__ == '__main__': 5 | gtzan = GTZAN(which_set='all', seconds=30.) 6 | for track in gtzan.tracks: 7 | signalpdfpath = track.filename + ".signal.png" 8 | print("plotting " + signalpdfpath) 9 | track.plot_signal(out=signalpdfpath) 10 | spectrogrampdfpath = track.filename + ".spectrogram.png" 11 | print("plotting " + spectrogrampdfpath) 12 | track.plot_spectrogram(out=spectrogrampdfpath) 13 | -------------------------------------------------------------------------------- /bin/plot_monitor: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/plot_monitor.py -------------------------------------------------------------------------------- /bin/print_channel_doc: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/print_channel_doc.py -------------------------------------------------------------------------------- /bin/print_model: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/print_model.py -------------------------------------------------------------------------------- /bin/print_monitor: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/print_monitor.py -------------------------------------------------------------------------------- /bin/print_monitor_cv: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/print_monitor_cv.py -------------------------------------------------------------------------------- /bin/show_binocular_greyscale_examples: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/show_binocular_greyscale_examples.py -------------------------------------------------------------------------------- /bin/show_examples: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/show_examples.py -------------------------------------------------------------------------------- /bin/show_weights: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/show_weights.py -------------------------------------------------------------------------------- /bin/summarize_model: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/summarize_model.py -------------------------------------------------------------------------------- /bin/train: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/train.py -------------------------------------------------------------------------------- /bin/yaml_dryrun: -------------------------------------------------------------------------------- 1 | ../pylearn2/pylearn2/scripts/yaml_dryrun.py -------------------------------------------------------------------------------- /experiments/dixon/mlp.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 3 | which_set: 'train', 4 | space: 'vector', 5 | }, 6 | model: !obj:pylearn2.models.mlp.MLP { 7 | layers: [ 8 | !obj:pylearn2.models.mlp.RectifiedLinear { 9 | irange: .005, 10 | layer_name: 'h0', 11 | dim: 50, 12 | }, 13 | !obj:pylearn2.models.mlp.Softmax { 14 | irange: .005, 15 | layer_name: 'y', 16 | n_classes: 10, 17 | } 18 | ], 19 | input_space: !obj:pylearn2.space.VectorSpace { 20 | dim: 513, 21 | }, 22 | }, 23 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 24 | learning_rate: 0.01, 25 | batch_size: 62300, # 500 examples 26 | monitoring_dataset: 27 | { 28 | 'train' : *train, 29 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 30 | which_set: 'valid', 31 | space: 'vector', 32 | }, 33 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 34 | which_set: 'test', 35 | space: 'vector', 36 | } 37 | }, 38 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 39 | channel_name: "valid_y_misclass", 40 | prop_decrease: 0.01, 41 | N: 1000 42 | }, 43 | }, 44 | extensions: [ 45 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 46 | channel_name: 'valid_y_misclass', 47 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 48 | }, 49 | ], 50 | save_freq: 1, 51 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 52 | } 53 | -------------------------------------------------------------------------------- /experiments/fused-lasso/README.md: -------------------------------------------------------------------------------- 1 | # Experiments for the thesis 2 | 3 | ## Goals 4 | Understand the effect of Fused Lasso on: 5 | 6 | * MNIST 7 | * GTZAN 8 | * Softmax Regression 9 | * Convolutional Neural Networks 10 | * L1 11 | 12 | Therefore, we need the following experiments: 13 | 14 | 1) MNIST + l1, MNIST + l1+FL (logistic regression) 15 | 2) GTZAN + L1, GTZAN L1+FL (logistic regression) 16 | 3) GTZAN + L1, GTZAN L1+FL (convnet) 17 | 18 | within these I would do something like 19 | 20 | a) find best L1 over some range of values 21 | b) find best lambda FL over range (with 0 <= L1 <= best L1) (i.e. it may prefer a smaller l1 since the FL is also a type of regulariser). 22 | 23 | ## Experiments 24 | 25 | 1. Standard MNIST model + L1, softmax regression. Find best L1 over some range of values. 26 | 2. MNIST with horizontal FL + L1, softmax. See what is the effect of FL on the weights. Multiple experiments with different fl lambdas, where FL lambda >= L1 lambda. 27 | 3. MNIST with vertical FL + L1, softmax. See what is the effect of FL on the weights. Multiple experiments with different fl lambdas, where FL lambda >= L1 lambda. 28 | 4. MNIST with horizontal FL + L1, softmax. See what is the effect of FL on the weights. Multiple experiments with different fl lambdas, where FL lambda >= L1 lambda. 29 | 30 | 1. Standard GTZAN model + L1, softmax regression. Find best L1 over some range of values. 31 | 2. GTZAN with horizontal FL + L1, softmax. See what is the effect of FL on the weights. Multiple experiments with different fl lambdas, where FL lambda >= L1 lambda. 32 | 3. GTZAN with vertical FL + L1, softmax. See what is the effect of FL on the weights. Multiple experiments with different fl lambdas, where FL lambda >= L1 lambda. 33 | 4. GTZAN with horizontal FL + L1, softmax. See what is the effect of FL on the weights. Multiple experiments with different fl lambdas, where FL lambda >= L1 lambda. 34 | 35 | 1. Standard GTZAN model + L1, convnets. Find best L1 over some range of values. 36 | 2. GTZAN with horizontal FL + L1, convnets. See what is the effect of FL on the weights. Multiple experiments with different fl lambdas, where FL lambda >= L1 lambda. 37 | 3. GTZAN with vertical FL + L1, convnets. See what is the effect of FL on the weights. Multiple experiments with different fl lambdas, where FL lambda >= L1 lambda. 38 | 4. GTZAN with horizontal FL + L1, convnets. See what is the effect of FL on the weights. Multiple experiments with different fl lambdas, where FL lambda >= L1 lambda. 39 | -------------------------------------------------------------------------------- /experiments/fused-lasso/gtzan-softmax-base.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: .05, 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | learning_rate: .001, 14 | batch_size: 100, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 19 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 20 | key: "valid_X", 21 | target_key: "valid_y" 22 | }, 23 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 24 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 25 | key: "test_X", 26 | target_key: "test_y" 27 | }, 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 100, 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500, 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | ] 45 | }, 46 | }, 47 | extensions: [ 48 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 49 | channel_name: 'valid_y_misclass', 50 | save_path: "results/gtzan-softmax-base-best.pkl", 51 | }, 52 | ], 53 | save_freq: 1, 54 | save_path: "results/gtzan-softmax-base.pkl", 55 | } 56 | -------------------------------------------------------------------------------- /experiments/fused-lasso/gtzan-softmax-fl-2d.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: .05, 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | learning_rate: .001, 14 | batch_size: 100, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 19 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 20 | key: "valid_X", 21 | target_key: "valid_y" 22 | }, 23 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 24 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 25 | key: "test_X", 26 | target_key: "test_y" 27 | }, 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 100 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500, 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.FusedLasso { 45 | coeffs: { 46 | 'y': 0.0005, 47 | }, 48 | axes: { 49 | 'y': 0, 50 | }, 51 | }, 52 | !obj:pylearn2.costs.mlp.FusedLasso { 53 | coeffs: { 54 | 'y': 0.0005, 55 | }, 56 | axes: { 57 | 'y': 1, 58 | }, 59 | }, 60 | ] 61 | }, 62 | }, 63 | extensions: [ 64 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 65 | channel_name: 'valid_y_misclass', 66 | save_path: "results/gtzan-softmax-fl-2d-best.pkl", 67 | }, 68 | ], 69 | save_freq: 1, 70 | save_path: "results/gtzan-softmax-fl-2d.pkl" 71 | } 72 | -------------------------------------------------------------------------------- /experiments/fused-lasso/gtzan-softmax-fl-horiz.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: .05 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | learning_rate: .001, 14 | batch_size: 100, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 19 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 20 | key: "valid_X", 21 | target_key: "valid_y" 22 | }, 23 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 24 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 25 | key: "test_X", 26 | target_key: "test_y" 27 | }, 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 100 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.FusedLasso { 45 | coeffs: { 46 | 'y': 0.0005, 47 | }, 48 | axes: { 49 | 'y': 1 50 | }, 51 | }, 52 | ] 53 | }, 54 | }, 55 | extensions: [ 56 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 57 | channel_name: 'valid_y_misclass', 58 | save_path: "results/gtzan-softmax-fl-horiz-best.pkl" 59 | }, 60 | ], 61 | save_freq: 1, 62 | save_path: "results/gtzan-softmax-fl-horiz.pkl" 63 | } 64 | -------------------------------------------------------------------------------- /experiments/fused-lasso/gtzan-softmax-fl-vert.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: .05, 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | learning_rate: .001, 14 | batch_size: 100, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 19 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 20 | key: "valid_X", 21 | target_key: "valid_y" 22 | }, 23 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 24 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 25 | key: "test_X", 26 | target_key: "test_y" 27 | }, 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 100 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.FusedLasso { 45 | coeffs: { 46 | 'y': 0.0005, 47 | }, 48 | axes: { 49 | 'y': 0 50 | }, 51 | }, 52 | ] 53 | }, 54 | }, 55 | extensions: [ 56 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 57 | channel_name: 'valid_y_misclass', 58 | save_path: "results/gtzan-softmax-fl-vert-best.pkl" 59 | }, 60 | ], 61 | save_freq: 1, 62 | save_path: "results/gtzan-softmax-fl-vert.pkl" 63 | } 64 | -------------------------------------------------------------------------------- /experiments/fused-lasso/gtzan-softmax-l1-base.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: .05, 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | learning_rate: .001, 14 | batch_size: 100, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 19 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 20 | key: "valid_X", 21 | target_key: "valid_y" 22 | }, 23 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 24 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 25 | key: "test_X", 26 | target_key: "test_y" 27 | }, 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 100, 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500, 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.L1WeightDecay { 45 | coeffs: { 46 | 'y': 0.0005 47 | }, 48 | }, 49 | ] 50 | }, 51 | }, 52 | extensions: [ 53 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 54 | channel_name: 'valid_y_misclass', 55 | save_path: "results/gtzan-softmax-l1-base-best.pkl", 56 | }, 57 | ], 58 | save_freq: 1, 59 | save_path: "results/gtzan-softmax-l1-base.pkl", 60 | } 61 | -------------------------------------------------------------------------------- /experiments/fused-lasso/gtzan-softmax-l1-fl-2d.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: .05, 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | learning_rate: .001, 14 | batch_size: 100, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 19 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 20 | key: "valid_X", 21 | target_key: "valid_y" 22 | }, 23 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 24 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 25 | key: "test_X", 26 | target_key: "test_y" 27 | }, 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 35, 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500, 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.L1WeightDecay { 45 | coeffs: { 46 | 'y': 0.001 47 | }, 48 | }, 49 | !obj:pylearn2.costs.mlp.FusedLasso { 50 | coeffs: { 51 | 'y': 0.0005, 52 | }, 53 | axes: { 54 | 'y': 0 55 | }, 56 | }, 57 | !obj:pylearn2.costs.mlp.FusedLasso { 58 | coeffs: { 59 | 'y': 0.0005, 60 | }, 61 | axes: { 62 | 'y': 1 63 | }, 64 | }, 65 | ] 66 | }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/gtzan-softmax-l1-fl-2d-best.pkl", 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/gtzan-softmax-l1-fl-2d.pkl", 76 | } 77 | -------------------------------------------------------------------------------- /experiments/fused-lasso/gtzan-softmax-l1-fl-horiz.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: 0., 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.bgd.BGD { 13 | batch_size: 10000, 14 | line_search_mode: 'exhaustive', 15 | conjugate: 1, 16 | monitoring_dataset: 17 | { 18 | 'train' : *train, 19 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 20 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 21 | key: "valid_X", 22 | target_key: "valid_y" 23 | }, 24 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 25 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 26 | key: "test_X", 27 | target_key: "test_y" 28 | }, 29 | }, 30 | termination_criterion: !obj:pylearn2.termination_criteria.And { 31 | criteria: [ 32 | !obj:pylearn2.termination_criteria.MonitorBased { 33 | channel_name: "valid_y_misclass", 34 | prop_decrease: 0.001, 35 | N: 35, 36 | }, 37 | !obj:pylearn2.termination_criteria.EpochCounter { 38 | max_epochs: 500, 39 | }, 40 | ] 41 | }, 42 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 43 | costs: [ 44 | !obj:pylearn2.costs.mlp.Default {}, 45 | !obj:pylearn2.costs.mlp.L1WeightDecay { 46 | coeffs: { 47 | 'y': 0.0001125, 48 | }, 49 | }, 50 | !obj:pylearn2.costs.mlp.FusedLasso { 51 | coeffs: { 52 | 'y': 0.000738905609893065, 53 | }, 54 | axes: { 55 | 'y': 1 56 | }, 57 | }, 58 | ] 59 | }, 60 | }, 61 | extensions: [ 62 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 63 | channel_name: 'valid_y_misclass', 64 | save_path: "results/gtzan-softmax-l1-fl-horiz-bgd-best.pkl", 65 | }, 66 | ], 67 | save_freq: 1, 68 | save_path: "results/gtzan-softmax-l1-fl-horiz-bgd.pkl", 69 | } 70 | -------------------------------------------------------------------------------- /experiments/fused-lasso/gtzan-softmax-l1-fl-vert.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: .05, 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | learning_rate: .001, 14 | batch_size: 100, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 19 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 20 | key: "valid_X", 21 | target_key: "valid_y" 22 | }, 23 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 24 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 25 | key: "test_X", 26 | target_key: "test_y" 27 | }, 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 100 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.L1WeightDecay { 45 | coeffs: { 46 | 'y': 0.0005 47 | }, 48 | }, 49 | !obj:pylearn2.costs.mlp.FusedLasso { 50 | coeffs: { 51 | 'y': 0.0005, 52 | }, 53 | axes: { 54 | 'y': 0 55 | }, 56 | }, 57 | ] 58 | }, 59 | }, 60 | extensions: [ 61 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 62 | channel_name: 'valid_y_misclass', 63 | save_path: "results/gtzan-softmax-fl-vert-best.pkl" 64 | }, 65 | ], 66 | save_freq: 1, 67 | save_path: "results/gtzan-softmax-fl-vert.pkl" 68 | } 69 | -------------------------------------------------------------------------------- /experiments/fused-lasso/hp/gtzan-conv-l1-base.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/fused-lasso/models/gtzan-conv-l1-base.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | # [0.0] + [math.exp(i)/10000. for i in numpy.arange(0, 12, 0.5)] 5 | l1: [0.0, 0.0001, 0.0001648721270700128, 0.0002718281828459045, 0.00044816890703380644, 0.0007389056098930651, 0.0012182493960703473, 0.0020085536923187667, 0.0033115451958692314, 0.005459815003314423, 0.00900171313005218, 0.01484131591025766, 0.024469193226422038, 0.04034287934927351, 0.06651416330443619, 0.10966331584284585, 0.1808042414456063, 0.29809579870417285, 0.4914768840299134, 0.8103083927575384, 1.3359726829661873, 2.202646579480672, 3.6315502674246636, 5.987414171519782, 9.87157710107605] 6 | -------------------------------------------------------------------------------- /experiments/fused-lasso/hp/gtzan-conv-l1-fl-2d.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/fused-lasso/models/gtzan-conv-l1-fl-2d.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | l1: [0.0005, 0.001, 0.002] 5 | # [math.exp(i)/10000. for i in numpy.arange(0, 12, 0.5)] 6 | fl: [0.0001, 0.0001648721270700128, 0.0002718281828459045, 0.00044816890703380644, 0.0007389056098930651, 0.0012182493960703473, 0.0020085536923187667, 0.0033115451958692314, 0.005459815003314423, 0.00900171313005218, 0.01484131591025766, 0.024469193226422038, 0.04034287934927351, 0.06651416330443619, 0.10966331584284585, 0.1808042414456063, 0.29809579870417285, 0.4914768840299134, 0.8103083927575384, 1.3359726829661873, 2.202646579480672, 3.6315502674246636, 5.987414171519782, 9.87157710107605] 7 | -------------------------------------------------------------------------------- /experiments/fused-lasso/hp/gtzan-conv-l1-fl-horiz.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/fused-lasso/models/gtzan-conv-l1-fl-horiz.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | l1: [0.0005, 0.001, 0.002] 5 | # [math.exp(i)/10000. for i in numpy.arange(0, 12, 0.5)] 6 | fl: [0.0001, 0.0001648721270700128, 0.0002718281828459045, 0.00044816890703380644, 0.0007389056098930651, 0.0012182493960703473, 0.0020085536923187667, 0.0033115451958692314, 0.005459815003314423, 0.00900171313005218, 0.01484131591025766, 0.024469193226422038, 0.04034287934927351, 0.06651416330443619, 0.10966331584284585, 0.1808042414456063, 0.29809579870417285, 0.4914768840299134, 0.8103083927575384, 1.3359726829661873, 2.202646579480672, 3.6315502674246636, 5.987414171519782, 9.87157710107605] 7 | -------------------------------------------------------------------------------- /experiments/fused-lasso/hp/gtzan-conv-l1-fl-vert.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/fused-lasso/models/gtzan-conv-l1-fl-vert.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | l1: [0.0005, 0.001, 0.002] 5 | # [math.exp(i)/10000. for i in numpy.arange(0, 12, 0.5)] 6 | fl: [0.0001, 0.0001648721270700128, 0.0002718281828459045, 0.00044816890703380644, 0.0007389056098930651, 0.0012182493960703473, 0.0020085536923187667, 0.0033115451958692314, 0.005459815003314423, 0.00900171313005218, 0.01484131591025766, 0.024469193226422038, 0.04034287934927351, 0.06651416330443619, 0.10966331584284585, 0.1808042414456063, 0.29809579870417285, 0.4914768840299134, 0.8103083927575384, 1.3359726829661873, 2.202646579480672, 3.6315502674246636, 5.987414171519782, 9.87157710107605] 7 | -------------------------------------------------------------------------------- /experiments/fused-lasso/hp/gtzan-softmax-l1-base-bgd.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/fused-lasso/models/gtzan-softmax-l1-base-bgd.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | # [0.0] + [math.exp(i)/10000. for i in numpy.arange(0, 12, 0.5)] 5 | l1: [0.0, 0.0001, 0.0001648721270700128, 0.0002718281828459045, 0.00044816890703380644, 0.0007389056098930651, 0.0012182493960703473, 0.0020085536923187667, 0.0033115451958692314, 0.005459815003314423, 0.00900171313005218, 0.01484131591025766, 0.024469193226422038, 0.04034287934927351, 0.06651416330443619, 0.10966331584284585, 0.1808042414456063, 0.29809579870417285, 0.4914768840299134, 0.8103083927575384, 1.3359726829661873, 2.202646579480672, 3.6315502674246636, 5.987414171519782, 9.87157710107605] 6 | -------------------------------------------------------------------------------- /experiments/fused-lasso/hp/gtzan-softmax-l1-fl-horiz-bgd-real.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/fused-lasso/models/gtzan-softmax-l1-fl-horiz-bgd.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | l1: [0.0001125, 0.000225, 0.00045] 5 | # [math.exp(i)/10000. for i in numpy.arange(0, 12, 0.5)] 6 | fl: [0.0001, 0.0001648721270700128, 0.0002718281828459045, 0.00044816890703380644, 0.0007389056098930651, 0.0012182493960703473, 0.0020085536923187667, 0.0033115451958692314, 0.005459815003314423, 0.00900171313005218, 0.01484131591025766, 0.024469193226422038, 0.04034287934927351, 0.06651416330443619, 0.10966331584284585, 0.1808042414456063, 0.29809579870417285, 0.4914768840299134, 0.8103083927575384, 1.3359726829661873, 2.202646579480672, 3.6315502674246636, 5.987414171519782, 9.87157710107605] 7 | -------------------------------------------------------------------------------- /experiments/fused-lasso/hp/gtzan-softmax-l1-fl-horiz-bgd.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/fused-lasso/models/gtzan-softmax-l1-fl-horiz-bgd.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | l1: [0.0001125, 0.000225, 0.00045] 5 | # [math.exp(i)/10000. for i in numpy.arange(0, 12, 0.5)] 6 | fl: [0.0001, 0.0001648721270700128, 0.0002718281828459045, 0.00044816890703380644, 0.0007389056098930651, 0.0012182493960703473, 0.0020085536923187667, 0.0033115451958692314, 0.005459815003314423, 0.00900171313005218, 0.01484131591025766, 0.024469193226422038, 0.04034287934927351, 0.06651416330443619, 0.10966331584284585, 0.1808042414456063, 0.29809579870417285, 0.4914768840299134, 0.8103083927575384, 1.3359726829661873, 2.202646579480672, 3.6315502674246636, 5.987414171519782, 9.87157710107605] 7 | -------------------------------------------------------------------------------- /experiments/fused-lasso/hp/mnist-softmax-l1-base-bgd.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/fused-lasso/models/mnist-softmax-l1-base-bgd.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | # [0.0] + [math.exp(i)/10000. for i in numpy.arange(0, 12, 0.5)] 5 | l1: [0.0, 0.0001, 0.0001648721270700128, 0.0002718281828459045, 0.00044816890703380644, 0.0007389056098930651, 0.0012182493960703473, 0.0020085536923187667, 0.0033115451958692314, 0.005459815003314423, 0.00900171313005218, 0.01484131591025766, 0.024469193226422038, 0.04034287934927351, 0.06651416330443619, 0.10966331584284585, 0.1808042414456063, 0.29809579870417285, 0.4914768840299134, 0.8103083927575384, 1.3359726829661873, 2.202646579480672, 3.6315502674246636, 5.987414171519782, 9.87157710107605] 6 | 7 | -------------------------------------------------------------------------------- /experiments/fused-lasso/hp/mnist-softmax-l1-fl-2d-bgd-l1.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/fused-lasso/models/mnist-softmax-l1-fl-2d-bgd.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | l1: [0., 0.00005, 0.0001] 5 | # [math.exp(i)/10000. for i in numpy.arange(0, 12, 0.5)] 6 | fl: [0.0001, 0.0001648721270700128, 0.0002718281828459045, 0.00044816890703380644, 0.0007389056098930651, 0.0012182493960703473, 0.0020085536923187667, 0.0033115451958692314, 0.005459815003314423, 0.00900171313005218, 0.01484131591025766, 0.024469193226422038, 0.04034287934927351, 0.06651416330443619, 0.10966331584284585, 0.1808042414456063, 0.29809579870417285, 0.4914768840299134, 0.8103083927575384, 1.3359726829661873, 2.202646579480672, 3.6315502674246636, 5.987414171519782, 9.87157710107605] 7 | -------------------------------------------------------------------------------- /experiments/fused-lasso/mnist-softmax-base.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: 0. 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.bgd.BGD { 13 | batch_size: 10000, 14 | line_search_mode: 'exhaustive', 15 | conjugate: 1, 16 | monitoring_dataset: 17 | { 18 | 'train' : *train, 19 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 20 | which_set: 'train', 21 | start: 50000, 22 | stop: 60000 23 | }, 24 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 25 | which_set: 'test', 26 | stop: 10000 27 | } 28 | }, 29 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 30 | costs: [ 31 | !obj:pylearn2.costs.cost.MethodCost { 32 | method: 'cost_from_X' 33 | }, 34 | ] 35 | }, 36 | termination_criterion: !obj:pylearn2.termination_criteria.And { 37 | criteria: [ 38 | !obj:pylearn2.termination_criteria.MonitorBased { 39 | channel_name: "valid_y_misclass", 40 | prop_decrease: 0.001, 41 | N: 35 42 | }, 43 | !obj:pylearn2.termination_criteria.EpochCounter { 44 | max_epochs: 500 45 | }, 46 | ] 47 | }, 48 | }, 49 | extensions: [ 50 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 51 | channel_name: 'valid_y_misclass', 52 | save_path: "results/mnist-softmax-base-best.pkl" 53 | }, 54 | ], 55 | save_freq: 1, 56 | save_path: "results/mnist-softmax-base.pkl" 57 | } 58 | -------------------------------------------------------------------------------- /experiments/fused-lasso/mnist-softmax-fl-2d.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: .05 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 62300, 14 | learning_rate: .01, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.And { 29 | criteria: [ 30 | !obj:pylearn2.termination_criteria.MonitorBased { 31 | channel_name: "valid_y_misclass", 32 | prop_decrease: 0.001, 33 | N: 50 34 | }, 35 | !obj:pylearn2.termination_criteria.EpochCounter { 36 | max_epochs: 500 37 | }, 38 | ] 39 | }, 40 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 41 | costs: [ 42 | !obj:pylearn2.costs.mlp.Default {}, 43 | !obj:pylearn2.costs.mlp.FusedLasso { 44 | coeffs: { 45 | 'y': 0.0005, 46 | }, 47 | axes: { 48 | 'y': 0 49 | }, 50 | }, 51 | !obj:pylearn2.costs.mlp.FusedLasso { 52 | coeffs: { 53 | 'y': 0.0005, 54 | }, 55 | axes: { 56 | 'y': 1 57 | }, 58 | }, 59 | ] 60 | }, 61 | }, 62 | extensions: [ 63 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 64 | channel_name: 'valid_y_misclass', 65 | save_path: "results/mnist-softmax-fl-2d-best.pkl" 66 | }, 67 | ], 68 | save_freq: 1, 69 | save_path: "results/mnist-softmax-fl-2d.pkl" 70 | } 71 | -------------------------------------------------------------------------------- /experiments/fused-lasso/mnist-softmax-fl-horiz.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: .05 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 62300, 14 | learning_rate: .01, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.And { 29 | criteria: [ 30 | !obj:pylearn2.termination_criteria.MonitorBased { 31 | channel_name: "valid_y_misclass", 32 | prop_decrease: 0.001, 33 | N: 50 34 | }, 35 | !obj:pylearn2.termination_criteria.EpochCounter { 36 | max_epochs: 500 37 | }, 38 | ] 39 | }, 40 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 41 | costs: [ 42 | !obj:pylearn2.costs.mlp.Default {}, 43 | !obj:pylearn2.costs.mlp.FusedLasso { 44 | coeffs: { 45 | 'y': 0.0005, 46 | }, 47 | axes: { 48 | 'y': 1 49 | }, 50 | }, 51 | ] 52 | }, 53 | }, 54 | extensions: [ 55 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 56 | channel_name: 'valid_y_misclass', 57 | save_path: "results/mnist-softmax-fl-horiz-best.pkl" 58 | }, 59 | ], 60 | save_freq: 1, 61 | save_path: "results/mnist-softmax-fl-horiz.pkl" 62 | } 63 | -------------------------------------------------------------------------------- /experiments/fused-lasso/mnist-softmax-fl-vert.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: .05 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 62300, 14 | learning_rate: .01, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.And { 29 | criteria: [ 30 | !obj:pylearn2.termination_criteria.MonitorBased { 31 | channel_name: "valid_y_misclass", 32 | prop_decrease: 0.001, 33 | N: 50 34 | }, 35 | !obj:pylearn2.termination_criteria.EpochCounter { 36 | max_epochs: 500 37 | }, 38 | ] 39 | }, 40 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 41 | costs: [ 42 | !obj:pylearn2.costs.mlp.Default {}, 43 | !obj:pylearn2.costs.mlp.FusedLasso { 44 | coeffs: { 45 | 'y': 0.0005, 46 | }, 47 | axes: { 48 | 'y': 0 49 | }, 50 | }, 51 | ] 52 | }, 53 | }, 54 | extensions: [ 55 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 56 | channel_name: 'valid_y_misclass', 57 | save_path: "results/mnist-softmax-fl-vert-best.pkl" 58 | }, 59 | ], 60 | save_freq: 1, 61 | save_path: "results/mnist-softmax-fl-vert.pkl" 62 | } 63 | -------------------------------------------------------------------------------- /experiments/fused-lasso/mnist-softmax-l1-base.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: .05 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 62300, 14 | learning_rate: .01, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.And { 29 | criteria: [ 30 | !obj:pylearn2.termination_criteria.MonitorBased { 31 | channel_name: "valid_y_misclass", 32 | prop_decrease: 0.001, 33 | N: 50 34 | }, 35 | !obj:pylearn2.termination_criteria.EpochCounter { 36 | max_epochs: 500 37 | }, 38 | ] 39 | }, 40 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 41 | costs: [ 42 | !obj:pylearn2.costs.mlp.Default {}, 43 | !obj:pylearn2.costs.mlp.L1WeightDecay { 44 | coeffs: { 45 | 'y': 0.0005 46 | }, 47 | }, 48 | ] 49 | }, 50 | }, 51 | extensions: [ 52 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 53 | channel_name: 'valid_y_misclass', 54 | save_path: "results/mnist-softmax-l1-base-best.pkl" 55 | }, 56 | ], 57 | save_freq: 1, 58 | save_path: "results/mnist-softmax-l1-base.pkl" 59 | } 60 | -------------------------------------------------------------------------------- /experiments/fused-lasso/mnist-softmax-l1-fl-2d-bgd.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: 0. 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.bgd.BGD { 13 | batch_size: 10000, 14 | line_search_mode: 'exhaustive', 15 | conjugate: 1, 16 | monitoring_dataset: 17 | { 18 | 'train' : *train, 19 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 20 | which_set: 'train', 21 | start: 50000, 22 | stop: 60000 23 | }, 24 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 25 | which_set: 'test', 26 | stop: 10000 27 | } 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 35 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.L1WeightDecay { 45 | coeffs: { 46 | 'y': 0.001, 47 | }, 48 | }, 49 | !obj:pylearn2.costs.mlp.FusedLasso { 50 | coeffs: { 51 | 'y': 0.0005, 52 | }, 53 | axes: { 54 | 'y': 0 55 | }, 56 | }, 57 | !obj:pylearn2.costs.mlp.FusedLasso { 58 | coeffs: { 59 | 'y': 0.0005, 60 | }, 61 | axes: { 62 | 'y': 1 63 | }, 64 | }, 65 | ] 66 | }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/mnist-softmax-l1-fl-2d-bgd-best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/mnist-softmax-l1-fl-2d-bgd.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/fused-lasso/mnist-softmax-l1-fl-2d.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: .05 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 62300, 14 | learning_rate: .01, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.And { 29 | criteria: [ 30 | !obj:pylearn2.termination_criteria.MonitorBased { 31 | channel_name: "valid_y_misclass", 32 | prop_decrease: 0.001, 33 | N: 50 34 | }, 35 | !obj:pylearn2.termination_criteria.EpochCounter { 36 | max_epochs: 500 37 | }, 38 | ] 39 | }, 40 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 41 | costs: [ 42 | !obj:pylearn2.costs.mlp.Default {}, 43 | !obj:pylearn2.costs.mlp.L1WeightDecay { 44 | coeffs: { 45 | 'y': 0.0005 46 | }, 47 | }, 48 | !obj:pylearn2.costs.mlp.FusedLasso { 49 | coeffs: { 50 | 'y': 0.0005, 51 | }, 52 | axes: { 53 | 'y': 0 54 | }, 55 | }, 56 | !obj:pylearn2.costs.mlp.FusedLasso { 57 | coeffs: { 58 | 'y': 0.0005, 59 | }, 60 | axes: { 61 | 'y': 1 62 | }, 63 | }, 64 | ] 65 | }, 66 | }, 67 | extensions: [ 68 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 69 | channel_name: 'valid_y_misclass', 70 | save_path: "results/mnist-softmax-l1-fl-2d-best.pkl" 71 | }, 72 | ], 73 | save_freq: 1, 74 | save_path: "results/mnist-softmax-l1-fl-2d.pkl" 75 | } 76 | -------------------------------------------------------------------------------- /experiments/fused-lasso/mnist-softmax-l1-fl-horiz.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: .05 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 62300, 14 | learning_rate: .01, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.And { 29 | criteria: [ 30 | !obj:pylearn2.termination_criteria.MonitorBased { 31 | channel_name: "valid_y_misclass", 32 | prop_decrease: 0.001, 33 | N: 50 34 | }, 35 | !obj:pylearn2.termination_criteria.EpochCounter { 36 | max_epochs: 500 37 | }, 38 | ] 39 | }, 40 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 41 | costs: [ 42 | !obj:pylearn2.costs.mlp.Default {}, 43 | !obj:pylearn2.costs.mlp.L1WeightDecay { 44 | coeffs: { 45 | 'y': 0.0005 46 | }, 47 | }, 48 | !obj:pylearn2.costs.mlp.FusedLasso { 49 | coeffs: { 50 | 'y': 0.0005, 51 | }, 52 | axes: { 53 | 'y': 1 54 | }, 55 | }, 56 | ] 57 | }, 58 | }, 59 | extensions: [ 60 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 61 | channel_name: 'valid_y_misclass', 62 | save_path: "results/mnist-softmax-l1-fl-horiz-best.pkl" 63 | }, 64 | ], 65 | save_freq: 1, 66 | save_path: "results/mnist-softmax-l1-fl-horiz.pkl" 67 | } 68 | -------------------------------------------------------------------------------- /experiments/fused-lasso/mnist-softmax-l1-fl-vert.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: .05 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 62300, 14 | learning_rate: .01, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.And { 29 | criteria: [ 30 | !obj:pylearn2.termination_criteria.MonitorBased { 31 | channel_name: "valid_y_misclass", 32 | prop_decrease: 0.001, 33 | N: 50 34 | }, 35 | !obj:pylearn2.termination_criteria.EpochCounter { 36 | max_epochs: 500 37 | }, 38 | ] 39 | }, 40 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 41 | costs: [ 42 | !obj:pylearn2.costs.mlp.Default {}, 43 | !obj:pylearn2.costs.mlp.L1WeightDecay { 44 | coeffs: { 45 | 'y': 0.0005 46 | }, 47 | }, 48 | !obj:pylearn2.costs.mlp.FusedLasso { 49 | coeffs: { 50 | 'y': 0.0005, 51 | }, 52 | axes: { 53 | 'y': 0 54 | }, 55 | }, 56 | ] 57 | }, 58 | }, 59 | extensions: [ 60 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 61 | channel_name: 'valid_y_misclass', 62 | save_path: "results/mnist-softmax-l1-fl-vert-best.pkl" 63 | }, 64 | ], 65 | save_freq: 1, 66 | save_path: "results/mnist-softmax-l1-fl-vert.pkl" 67 | } 68 | -------------------------------------------------------------------------------- /experiments/fused-lasso/models/gtzan-softmax-l1-base-bgd.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: 0., 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.bgd.BGD { 13 | batch_size: 10000, 14 | line_search_mode: 'exhaustive', 15 | conjugate: 1, 16 | monitoring_dataset: 17 | { 18 | 'train' : *train, 19 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 20 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 21 | key: "valid_X", 22 | target_key: "valid_y" 23 | }, 24 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 25 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 26 | key: "test_X", 27 | target_key: "test_y" 28 | }, 29 | }, 30 | termination_criterion: !obj:pylearn2.termination_criteria.And { 31 | criteria: [ 32 | !obj:pylearn2.termination_criteria.MonitorBased { 33 | channel_name: "valid_y_misclass", 34 | prop_decrease: 0.001, 35 | N: 35, 36 | }, 37 | !obj:pylearn2.termination_criteria.EpochCounter { 38 | max_epochs: 500, 39 | }, 40 | ] 41 | }, 42 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 43 | costs: [ 44 | !obj:pylearn2.costs.mlp.Default {}, 45 | !obj:pylearn2.costs.mlp.L1WeightDecay { 46 | coeffs: { 47 | 'y': %(l1)f 48 | }, 49 | }, 50 | ] 51 | }, 52 | }, 53 | extensions: [ 54 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 55 | channel_name: 'valid_y_misclass', 56 | save_path: "results/gtzan-softmax-l1-base-bgd-best.pkl", 57 | }, 58 | ], 59 | save_freq: 1, 60 | save_path: "results/gtzan-softmax-l1-base-bgd.pkl", 61 | } 62 | -------------------------------------------------------------------------------- /experiments/fused-lasso/models/gtzan-softmax-l1-base.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: 0., 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | learning_rate: .001, 14 | batch_size: 100, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 19 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 20 | key: "valid_X", 21 | target_key: "valid_y" 22 | }, 23 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 24 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 25 | key: "test_X", 26 | target_key: "test_y" 27 | }, 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 35, 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500, 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.L1WeightDecay { 45 | coeffs: { 46 | 'y': %(l1)f 47 | }, 48 | }, 49 | ] 50 | }, 51 | }, 52 | extensions: [ 53 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 54 | channel_name: 'valid_y_misclass', 55 | save_path: "results/gtzan-softmax-l1-base-best.pkl", 56 | }, 57 | ], 58 | save_freq: 1, 59 | save_path: "results/gtzan-softmax-l1-base.pkl", 60 | } 61 | -------------------------------------------------------------------------------- /experiments/fused-lasso/models/gtzan-softmax-l1-fl-horiz-bgd.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: 0., 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.bgd.BGD { 13 | batch_size: 10000, 14 | line_search_mode: 'exhaustive', 15 | conjugate: 1, 16 | monitoring_dataset: 17 | { 18 | 'train' : *train, 19 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 20 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 21 | key: "valid_X", 22 | target_key: "valid_y" 23 | }, 24 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 25 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 26 | key: "test_X", 27 | target_key: "test_y" 28 | }, 29 | }, 30 | termination_criterion: !obj:pylearn2.termination_criteria.And { 31 | criteria: [ 32 | !obj:pylearn2.termination_criteria.MonitorBased { 33 | channel_name: "valid_y_misclass", 34 | prop_decrease: 0.001, 35 | N: 35, 36 | }, 37 | !obj:pylearn2.termination_criteria.EpochCounter { 38 | max_epochs: 500, 39 | }, 40 | ] 41 | }, 42 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 43 | costs: [ 44 | !obj:pylearn2.costs.mlp.Default {}, 45 | !obj:pylearn2.costs.mlp.L1WeightDecay { 46 | coeffs: { 47 | 'y': %(l1)f 48 | }, 49 | }, 50 | !obj:pylearn2.costs.mlp.FusedLasso { 51 | coeffs: { 52 | 'y': %(fl)f, 53 | }, 54 | axes: { 55 | 'y': 1 56 | }, 57 | }, 58 | ] 59 | }, 60 | }, 61 | extensions: [ 62 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 63 | channel_name: 'valid_y_misclass', 64 | save_path: "results/gtzan-softmax-l1-fl-horiz-bgd-best.pkl", 65 | }, 66 | ], 67 | save_freq: 1, 68 | save_path: "results/gtzan-softmax-l1-fl-horiz-bgd.pkl", 69 | } 70 | -------------------------------------------------------------------------------- /experiments/fused-lasso/models/gtzan-softmax-l1-fl-horiz.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.npy_npz.NpzDataset { 3 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 4 | key: "train_X", 5 | target_key: "train_y" 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 513, 9 | n_classes: 10, 10 | irange: 0., 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | learning_rate: .001, 14 | batch_size: 100, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 19 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 20 | key: "valid_X", 21 | target_key: "valid_y" 22 | }, 23 | 'test' : !obj:pylearn2.datasets.npy_npz.NpzDataset { 24 | file: "${PYLEARN2_DATA_PATH}/gtzan-vector.npz", 25 | key: "test_X", 26 | target_key: "test_y" 27 | }, 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 35, 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500, 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.L1WeightDecay { 45 | coeffs: { 46 | 'y': %(l1)f 47 | }, 48 | }, 49 | !obj:pylearn2.costs.mlp.FusedLasso { 50 | coeffs: { 51 | 'y': %(fl)f, 52 | }, 53 | axes: { 54 | 'y': 1 55 | }, 56 | }, 57 | ] 58 | }, 59 | }, 60 | extensions: [ 61 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 62 | channel_name: 'valid_y_misclass', 63 | save_path: "results/gtzan-softmax-l1-fl-horiz-best.pkl", 64 | }, 65 | ], 66 | save_freq: 1, 67 | save_path: "results/gtzan-softmax-l1-fl-horiz.pkl", 68 | } 69 | -------------------------------------------------------------------------------- /experiments/fused-lasso/models/mnist-softmax-l1-base-bgd.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: 0. 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.bgd.BGD { 13 | batch_size: 10000, 14 | line_search_mode: 'exhaustive', 15 | conjugate: 1, 16 | monitoring_dataset: 17 | { 18 | 'train' : *train, 19 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 20 | which_set: 'train', 21 | start: 50000, 22 | stop: 60000 23 | }, 24 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 25 | which_set: 'test', 26 | stop: 10000 27 | } 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 35 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.L1WeightDecay { 45 | coeffs: { 46 | 'y': %(l1)f 47 | }, 48 | }, 49 | ] 50 | }, 51 | }, 52 | extensions: [ 53 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 54 | channel_name: 'valid_y_misclass', 55 | save_path: "results/mnist-softmax-l1-base-bgd-best.pkl" 56 | }, 57 | ], 58 | save_freq: 1, 59 | save_path: "results/mnist-softmax-l1-base-bgd.pkl" 60 | } 61 | -------------------------------------------------------------------------------- /experiments/fused-lasso/models/mnist-softmax-l1-base.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: 0. 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 100, 14 | learning_rate: .001, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.And { 29 | criteria: [ 30 | !obj:pylearn2.termination_criteria.MonitorBased { 31 | channel_name: "valid_y_misclass", 32 | prop_decrease: 0.001, 33 | N: 35 34 | }, 35 | !obj:pylearn2.termination_criteria.EpochCounter { 36 | max_epochs: 500 37 | }, 38 | ] 39 | }, 40 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 41 | costs: [ 42 | !obj:pylearn2.costs.mlp.Default {}, 43 | !obj:pylearn2.costs.mlp.L1WeightDecay { 44 | coeffs: { 45 | 'y': %(l1)f 46 | }, 47 | }, 48 | ] 49 | }, 50 | }, 51 | extensions: [ 52 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 53 | channel_name: 'valid_y_misclass', 54 | save_path: "results/mnist-softmax-l1-base-best.pkl" 55 | }, 56 | ], 57 | save_freq: 1, 58 | save_path: "results/mnist-softmax-l1-base.pkl" 59 | } 60 | -------------------------------------------------------------------------------- /experiments/fused-lasso/models/mnist-softmax-l1-fl-2d-bgd.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: 0. 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.bgd.BGD { 13 | batch_size: 10000, 14 | line_search_mode: 'exhaustive', 15 | conjugate: 1, 16 | monitoring_dataset: 17 | { 18 | 'train' : *train, 19 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 20 | which_set: 'train', 21 | start: 50000, 22 | stop: 60000 23 | }, 24 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 25 | which_set: 'test', 26 | stop: 10000 27 | } 28 | }, 29 | termination_criterion: !obj:pylearn2.termination_criteria.And { 30 | criteria: [ 31 | !obj:pylearn2.termination_criteria.MonitorBased { 32 | channel_name: "valid_y_misclass", 33 | prop_decrease: 0.001, 34 | N: 35 35 | }, 36 | !obj:pylearn2.termination_criteria.EpochCounter { 37 | max_epochs: 500 38 | }, 39 | ] 40 | }, 41 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 42 | costs: [ 43 | !obj:pylearn2.costs.mlp.Default {}, 44 | !obj:pylearn2.costs.mlp.L1WeightDecay { 45 | coeffs: { 46 | 'y': %(l1)f 47 | }, 48 | }, 49 | !obj:pylearn2.costs.mlp.FusedLasso { 50 | coeffs: { 51 | 'y': %(fl)f, 52 | }, 53 | axes: { 54 | 'y': 0 55 | }, 56 | }, 57 | !obj:pylearn2.costs.mlp.FusedLasso { 58 | coeffs: { 59 | 'y': %(fl)f, 60 | }, 61 | axes: { 62 | 'y': 1 63 | }, 64 | }, 65 | ] 66 | }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/mnist-softmax-l1-fl-2d-bgd-best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/mnist-softmax-l1-fl-2d-bgd.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/fused-lasso/models/mnist-softmax-l1-fl-2d.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: 0. 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 100, 14 | learning_rate: .001, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.And { 29 | criteria: [ 30 | !obj:pylearn2.termination_criteria.MonitorBased { 31 | channel_name: "valid_y_misclass", 32 | prop_decrease: 0.001, 33 | N: 35 34 | }, 35 | !obj:pylearn2.termination_criteria.EpochCounter { 36 | max_epochs: 500 37 | }, 38 | ] 39 | }, 40 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 41 | costs: [ 42 | !obj:pylearn2.costs.mlp.Default {}, 43 | !obj:pylearn2.costs.mlp.L1WeightDecay { 44 | coeffs: { 45 | 'y': %(l1)f 46 | }, 47 | }, 48 | !obj:pylearn2.costs.mlp.FusedLasso { 49 | coeffs: { 50 | 'y': %(fl)f, 51 | }, 52 | axes: { 53 | 'y': 0 54 | }, 55 | }, 56 | !obj:pylearn2.costs.mlp.FusedLasso { 57 | coeffs: { 58 | 'y': %(fl)f, 59 | }, 60 | axes: { 61 | 'y': 1 62 | }, 63 | }, 64 | ] 65 | }, 66 | }, 67 | extensions: [ 68 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 69 | channel_name: 'valid_y_misclass', 70 | save_path: "results/mnist-softmax-l1-base-best.pkl" 71 | }, 72 | ], 73 | save_freq: 1, 74 | save_path: "results/mnist-softmax-l1-base.pkl" 75 | } 76 | -------------------------------------------------------------------------------- /experiments/gtzan-shape/hp/gtzan-convnet1.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/gtzan-shape/models/gtzan-convnet1.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | kernel_shape_h0: [ 5, 10, 20, 40 ] 5 | -------------------------------------------------------------------------------- /experiments/gtzan-shape/hp/gtzan-convnet2.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/gtzan-shape/models/gtzan-convnet2.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | kernel_shape_h0: [ 5, 10, 20, 40 ] 5 | -------------------------------------------------------------------------------- /experiments/jobman/hyperparameters/different_conv_shapes_l1reg.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/jobman/models/conv_3relu_l1reg.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | learning_rate: [!!python/object/apply:jobman_utils.log_uniform [.0001, .01], !!python/object/apply:jobman_utils.log_uniform [.0001, .01], !!python/object/apply:jobman_utils.log_uniform [.0001, .01], !!python/object/apply:jobman_utils.log_uniform [.0001, .01]] 5 | h0_output_channels: [16, 64] 6 | h0_kernel_shape_x: 513 7 | h0_kernel_shape_y: [4, 32] 8 | h0_pool_shape_x: 1 9 | h0_pool_shape_y: 4 10 | h0_pool_stride_x: 1 11 | h0_pool_stride_y: 2 12 | h1_kernel_shape_x: 1 13 | h1_kernel_shape_y: [4, 32] 14 | h1_pool_shape_x: 1 15 | h1_pool_shape_y: 4 16 | h1_pool_stride_x: 1 17 | h1_pool_stride_y: 2 18 | h1_output_channels: [32, 64] 19 | h2_kernel_shape_x: 1 20 | h2_kernel_shape_y: [4, 32] 21 | h2_pool_shape_x: 1 22 | h2_pool_shape_y: 4 23 | h2_pool_stride_x: 1 24 | h2_pool_stride_y: 2 25 | h2_output_channels: 64 26 | l1_weight_decay: [!!python/object/apply:jobman_utils.log_uniform [.0001, .01], !!python/object/apply:jobman_utils.log_uniform [.0001, .01], !!python/object/apply:jobman_utils.log_uniform [.0001, .01], !!python/object/apply:jobman_utils.log_uniform [.0001, .01]] 27 | -------------------------------------------------------------------------------- /experiments/jobman/hyperparameters/l1_regularization.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/jobman/models/conv_3relu_l1reg.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | learning_rate: 0.01 5 | h0_output_channels: 64 6 | h0_kernel_shape_x: 513 7 | h0_kernel_shape_y: 32 8 | h0_pool_shape_x: 1 9 | h0_pool_shape_y: 4 10 | h0_pool_stride_x: 1 11 | h0_pool_stride_y: 2 12 | h1_kernel_shape_x: 1 13 | h1_kernel_shape_y: 4 14 | h1_pool_shape_x: 1 15 | h1_pool_shape_y: 4 16 | h1_pool_stride_x: 1 17 | h1_pool_stride_y: 2 18 | h1_output_channels: 32 19 | h2_kernel_shape_x: 1 20 | h2_kernel_shape_y: 4 21 | h2_pool_shape_x: 1 22 | h2_pool_shape_y: 4 23 | h2_pool_stride_x: 1 24 | h2_pool_stride_y: 2 25 | h2_output_channels: 64 26 | # [math.exp(i/4.)/10 for i in xrange(1,20)] 27 | l1_weight_decay: [0.12840254166877413, 0.1648721270700128, 0.21170000166126748, 0.2718281828459045, 0.34903429574618416, 0.44816890703380646, 0.5754602676005731, 0.7389056098930651, 0.9487735836358526, 1.2182493960703473, 1.5642631884188172, 2.008553692318767, 2.579033991719306, 3.3115451958692312, 4.252108200006278, 5.459815003314423, 7.010541234668786, 9.001713130052181, 11.558428452718767] 28 | -------------------------------------------------------------------------------- /experiments/jobman/hyperparameters/l1_regularization_bumpzoom.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/jobman/models/conv_3relu_l1reg_small.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | # numpy.linspace(1.2182493960703473, 2.008553692318767, num=10) 5 | l1_weight_decay: [1.2182494, 1.30606098, 1.39387257, 1.48168416, 1.56949575, 1.65730734, 1.74511893, 1.83293052, 1.9207421, 2.00855369] 6 | -------------------------------------------------------------------------------- /experiments/l1plot/hyperparameters/gtzan-simple.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/l1plot/models/gtzan-simple.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | # [math.exp(i/4.)/10 for i in xrange(1,20)] 5 | l1_weight_decay: [0.12840254166877413, 0.1648721270700128, 0.21170000166126748, 0.2718281828459045, 0.34903429574618416, 0.44816890703380646, 0.5754602676005731, 0.7389056098930651, 0.9487735836358526, 1.2182493960703473, 1.5642631884188172, 2.008553692318767, 2.579033991719306, 3.3115451958692312, 4.252108200006278, 5.459815003314423, 7.010541234668786, 9.001713130052181, 11.558428452718767] 6 | -------------------------------------------------------------------------------- /experiments/l1plot/hyperparameters/mnist-simple.yaml: -------------------------------------------------------------------------------- 1 | yaml_template: experiments/l1plot/models/mnist-simple.yaml 2 | extract_results: genretron.jobman_utils.results_extractor 3 | hyper_parameters: 4 | # [math.exp(i/4.)/10 for i in xrange(1,20)] 5 | l1_weight_decay: [0.12840254166877413, 0.1648721270700128, 0.21170000166126748, 0.2718281828459045, 0.34903429574618416, 0.44816890703380646, 0.5754602676005731, 0.7389056098930651, 0.9487735836358526, 1.2182493960703473, 1.5642631884188172, 2.008553692318767, 2.579033991719306, 3.3115451958692312, 4.252108200006278, 5.459815003314423, 7.010541234668786, 9.001713130052181, 11.558428452718767] 6 | -------------------------------------------------------------------------------- /experiments/singlerun/conv_20150110A.yaml: -------------------------------------------------------------------------------- 1 | # Baseline convolution experiment 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 64, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # kernel_stride: [1, 5], 20 | pool_shape: [1, 8], 21 | pool_stride: [1, 4], 22 | max_kernel_norm: 1.9365, 23 | }, 24 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 25 | layer_name: 'h3', 26 | output_channels: 64, 27 | irange: .05, 28 | kernel_shape: [1, 80], 29 | # kernel_stride: [1, 80], 30 | pool_shape: [1, 8], 31 | pool_stride: [1, 4], 32 | max_kernel_norm: 1.9365, 33 | }, 34 | !obj:pylearn2.models.mlp.Softmax { 35 | max_col_norm: 1.9365, 36 | layer_name: 'y', 37 | istdev: .05, 38 | n_classes: 10 39 | } 40 | ], 41 | }, 42 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 43 | learning_rate: .01, 44 | monitoring_dataset: 45 | { 46 | 'train' : *train, 47 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 48 | which_set: "valid", 49 | }, 50 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 51 | which_set: "test", 52 | } 53 | }, 54 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 55 | # channel_name: "valid_y_misclass", 56 | # prop_decrease: 0.01, 57 | # N: 20 58 | # }, 59 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 60 | max_epochs: 10000, 61 | }, 62 | }, 63 | extensions: [ 64 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 65 | channel_name: 'valid_y_misclass', 66 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 67 | }, 68 | ], 69 | save_freq: 1, 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 71 | } 72 | -------------------------------------------------------------------------------- /experiments/singlerun/conv_20150110B.yaml: -------------------------------------------------------------------------------- 1 | # Identical to conv_20150110A, but the kernel shapes are different, 2 | # dividing the spectrogram in 4 different frenquency regions. 3 | 4 | !obj:pylearn2.train.Train { 5 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 6 | which_set: "train", 7 | }, 8 | model: !obj:pylearn2.models.mlp.MLP { 9 | batch_size: 10, 10 | input_space: !obj:pylearn2.space.Conv2DSpace { 11 | shape: [513, 623], 12 | num_channels: 1, 13 | }, 14 | layers: [ 15 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 16 | layer_name: 'h2', 17 | output_channels: 64, 18 | irange: .05, 19 | kernel_shape: [128, 5], 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 26 | layer_name: 'h3', 27 | output_channels: 64, 28 | irange: .05, 29 | kernel_shape: [4, 80], 30 | # kernel_stride: [4, 80], 31 | pool_shape: [1, 8], 32 | pool_stride: [1, 4], 33 | max_kernel_norm: 1.9365, 34 | }, 35 | !obj:pylearn2.models.mlp.Softmax { 36 | max_col_norm: 1.9365, 37 | layer_name: 'y', 38 | istdev: .05, 39 | n_classes: 10 40 | } 41 | ], 42 | }, 43 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 44 | learning_rate: .01, 45 | monitoring_dataset: 46 | { 47 | 'train' : *train, 48 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 49 | which_set: "valid", 50 | }, 51 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 52 | which_set: "test", 53 | } 54 | }, 55 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 56 | # channel_name: "valid_y_misclass", 57 | # prop_decrease: 0.01, 58 | # N: 20 59 | # }, 60 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 61 | max_epochs: 10000, 62 | }, 63 | }, 64 | extensions: [ 65 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 66 | channel_name: 'valid_y_misclass', 67 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 68 | }, 69 | ], 70 | save_freq: 1, 71 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 72 | } 73 | -------------------------------------------------------------------------------- /experiments/singlerun/conv_20150502.yaml: -------------------------------------------------------------------------------- 1 | # 72% accuracy on CPU 2 | !obj:pylearn2.train.Train { 3 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 4 | which_set: "train", 5 | preprocess: False, 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 1247], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 64, 17 | irange: .05, 18 | kernel_shape: [513, 73], 19 | pool_shape: [1, 8], 20 | pool_stride: [1, 4], 21 | max_kernel_norm: 1.9365, 22 | }, 23 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 24 | layer_name: 'h3', 25 | output_channels: 64, 26 | irange: .05, 27 | kernel_shape: [1, 17], 28 | pool_shape: [1, 8], 29 | pool_stride: [1, 4], 30 | max_kernel_norm: 1.9365, 31 | }, 32 | !obj:pylearn2.models.mlp.Softmax { 33 | max_col_norm: 1.9365, 34 | layer_name: 'y', 35 | istdev: .05, 36 | n_classes: 10 37 | } 38 | ], 39 | }, 40 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 41 | learning_rate: .01, 42 | monitoring_dataset: 43 | { 44 | 'train' : *train, 45 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 46 | which_set: "valid", 47 | preprocess: False, 48 | }, 49 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 50 | which_set: "test", 51 | preprocess: False, 52 | } 53 | }, 54 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 55 | channel_name: "valid_y_misclass", 56 | prop_decrease: 0.01, 57 | N: 20 58 | }, 59 | }, 60 | extensions: [ 61 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 62 | channel_name: 'valid_y_misclass', 63 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 64 | }, 65 | ], 66 | save_freq: 1, 67 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 68 | } 69 | -------------------------------------------------------------------------------- /experiments/singlerun/conv_20150917A.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 3 | which_set: "train", 4 | }, 5 | model: !obj:pylearn2.models.mlp.MLP { 6 | batch_size: 10, 7 | input_space: !obj:pylearn2.space.Conv2DSpace { 8 | shape: [513, 623], 9 | num_channels: 1, 10 | }, 11 | layers: [ 12 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 13 | layer_name: 'h2', 14 | output_channels: 64, 15 | irange: .05, 16 | kernel_shape: [513, 5], 17 | # kernel_stride: [1, 5], 18 | pool_shape: [1, 8], 19 | pool_stride: [1, 4], 20 | max_kernel_norm: 1.9365, 21 | }, 22 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 23 | layer_name: 'h3', 24 | output_channels: 64, 25 | irange: .05, 26 | kernel_shape: [1, 80], 27 | # kernel_stride: [1, 80], 28 | pool_shape: [1, 8], 29 | pool_stride: [1, 4], 30 | max_kernel_norm: 1.9365, 31 | }, 32 | !obj:pylearn2.models.mlp.Softmax { 33 | max_col_norm: 1.9365, 34 | layer_name: 'y', 35 | istdev: .05, 36 | n_classes: 10 37 | } 38 | ], 39 | }, 40 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 41 | learning_rate: .01, 42 | monitoring_dataset: 43 | { 44 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 45 | which_set: "valid", 46 | }, 47 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 48 | which_set: "test", 49 | } 50 | }, 51 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 52 | # channel_name: "valid_y_misclass", 53 | # prop_decrease: 0.01, 54 | # N: 20 55 | # }, 56 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 57 | max_epochs: 10000, 58 | }, 59 | }, 60 | extensions: [ 61 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 62 | channel_name: 'valid_y_misclass', 63 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 64 | }, 65 | ], 66 | save_freq: 1, 67 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 68 | } 69 | -------------------------------------------------------------------------------- /experiments/singlerun/conv_4sec_20150501.yaml: -------------------------------------------------------------------------------- 1 | # 72% accuracy on CPU 2 | !obj:pylearn2.train.Train { 3 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 4 | which_set: "train", 5 | preprocess: False, 6 | seconds: 4.0, 7 | }, 8 | model: !obj:pylearn2.models.mlp.MLP { 9 | batch_size: 10, 10 | input_space: !obj:pylearn2.space.Conv2DSpace { 11 | shape: [513, 85], 12 | num_channels: 1, 13 | }, 14 | layers: [ 15 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 16 | layer_name: 'h2', 17 | output_channels: 64, 18 | irange: .05, 19 | kernel_shape: [513, 5], 20 | pool_shape: [1, 8], 21 | pool_stride: [1, 4], 22 | max_kernel_norm: 1.9365, 23 | }, 24 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 25 | layer_name: 'h3', 26 | output_channels: 64, 27 | irange: .05, 28 | kernel_shape: [1, 10], 29 | pool_shape: [1, 8], 30 | pool_stride: [1, 4], 31 | max_kernel_norm: 1.9365, 32 | }, 33 | !obj:pylearn2.models.mlp.Softmax { 34 | max_col_norm: 1.9365, 35 | layer_name: 'y', 36 | istdev: .05, 37 | n_classes: 10 38 | } 39 | ], 40 | }, 41 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 42 | learning_rate: .01, 43 | monitoring_dataset: 44 | { 45 | 'train' : *train, 46 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 47 | which_set: "valid", 48 | preprocess: False, 49 | seconds: 4.0, 50 | }, 51 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 52 | which_set: "test", 53 | preprocess: False, 54 | seconds: 4.0, 55 | } 56 | }, 57 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 58 | channel_name: "valid_y_misclass", 59 | prop_decrease: 0.01, 60 | N: 20 61 | }, 62 | }, 63 | extensions: [ 64 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 65 | channel_name: 'valid_y_misclass', 66 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 67 | }, 68 | ], 69 | save_freq: 1, 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 71 | } 72 | -------------------------------------------------------------------------------- /experiments/singlerun/conv_fast_20150119A.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # kernel_stride: [1, 5], 20 | pool_shape: [1, 8], 21 | pool_stride: [1, 4], 22 | max_kernel_norm: 1.9365, 23 | }, 24 | !obj:pylearn2.models.mlp.Softmax { 25 | max_col_norm: 1.9365, 26 | layer_name: 'y', 27 | istdev: .05, 28 | n_classes: 10 29 | } 30 | ], 31 | }, 32 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 33 | learning_rate: .01, 34 | monitoring_dataset: 35 | { 36 | 'train' : *train, 37 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 38 | which_set: "valid", 39 | }, 40 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 41 | which_set: "test", 42 | } 43 | }, 44 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 45 | costs: [ 46 | !obj:pylearn2.costs.mlp.Default {}, 47 | !obj:pylearn2.costs.mlp.L1WeightDecay { 48 | coeffs: [1.0E-4] 49 | } 50 | ] 51 | 52 | }, 53 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 54 | # input_include_probs: { 'h2' : .5 }, 55 | # input_scales: { 'h2' : 1.25 } 56 | # }, 57 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 58 | # channel_name: "valid_y_misclass", 59 | # prop_decrease: 0.01, 60 | # N: 20 61 | # }, 62 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 63 | max_epochs: 10000, 64 | }, 65 | }, 66 | extensions: [ 67 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 68 | channel_name: 'valid_y_misclass', 69 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 70 | }, 71 | ], 72 | save_freq: 1, 73 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 74 | } 75 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150130A.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | # learning_rule: !obj:pylearn2.training_algorithms.learning_rule.RMSProp {}, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: "valid", 41 | }, 42 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 43 | which_set: "test", 44 | } 45 | }, 46 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 47 | costs: [ 48 | !obj:pylearn2.costs.mlp.Default {}, 49 | !obj:pylearn2.costs.mlp.L1WeightDecay { 50 | coeffs: { 'h2': 0.001 }, 51 | } 52 | ] 53 | 54 | }, 55 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 56 | # input_include_probs: { 'h2' : .1 }, 57 | # input_scales: { 'h2' : 1.01 } 58 | # }, 59 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 60 | channel_name: "train_y_misclass", 61 | prop_decrease: 0.01, 62 | N: 20 63 | }, 64 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 65 | # max_epochs: 5000, 66 | # }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150130B.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | monitoring_dataset: 36 | { 37 | 'train' : *train, 38 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: "valid", 40 | }, 41 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 42 | which_set: "test", 43 | } 44 | }, 45 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 46 | costs: [ 47 | !obj:pylearn2.costs.mlp.Default {}, 48 | !obj:pylearn2.costs.mlp.L1WeightDecay { 49 | coeffs: { 'h2': 0.002 }, 50 | } 51 | ] 52 | }, 53 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 54 | # input_include_probs: { 'h2' : .1 }, 55 | # input_scales: { 'h2' : 1.01 } 56 | # }, 57 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 58 | channel_name: "train_y_misclass", 59 | prop_decrease: 0.01, 60 | N: 20 61 | }, 62 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 63 | # max_epochs: 5000, 64 | # }, 65 | }, 66 | extensions: [ 67 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 68 | channel_name: 'valid_y_misclass', 69 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 70 | }, 71 | ], 72 | save_freq: 1, 73 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 74 | } 75 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150130C.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | monitoring_dataset: 36 | { 37 | 'train' : *train, 38 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: "valid", 40 | }, 41 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 42 | which_set: "test", 43 | } 44 | }, 45 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 46 | costs: [ 47 | !obj:pylearn2.costs.mlp.Default {}, 48 | !obj:pylearn2.costs.mlp.L1WeightDecay { 49 | coeffs: { 'h2': 0.003 }, 50 | } 51 | ] 52 | 53 | }, 54 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 55 | # input_include_probs: { 'h2' : .1 }, 56 | # input_scales: { 'h2' : 1.01 } 57 | # }, 58 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 59 | # channel_name: "valid_y_misclass", 60 | # prop_decrease: 0.01, 61 | # N: 20 62 | # }, 63 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 64 | max_epochs: 5000, 65 | }, 66 | }, 67 | extensions: [ 68 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 69 | channel_name: 'valid_y_misclass', 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 71 | }, 72 | ], 73 | save_freq: 1, 74 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 75 | } 76 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150130D.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | monitoring_dataset: 36 | { 37 | 'train' : *train, 38 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: "valid", 40 | }, 41 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 42 | which_set: "test", 43 | } 44 | }, 45 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 46 | costs: [ 47 | !obj:pylearn2.costs.mlp.Default {}, 48 | !obj:pylearn2.costs.mlp.L1WeightDecay { 49 | coeffs: { 'h2': 0.004 }, 50 | } 51 | ] 52 | 53 | }, 54 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 55 | # input_include_probs: { 'h2' : .1 }, 56 | # input_scales: { 'h2' : 1.01 } 57 | # }, 58 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 59 | # channel_name: "valid_y_misclass", 60 | # prop_decrease: 0.01, 61 | # N: 20 62 | # }, 63 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 64 | max_epochs: 5000, 65 | }, 66 | }, 67 | extensions: [ 68 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 69 | channel_name: 'valid_y_misclass', 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 71 | }, 72 | ], 73 | save_freq: 1, 74 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 75 | } 76 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150130E.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | monitoring_dataset: 36 | { 37 | 'train' : *train, 38 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: "valid", 40 | }, 41 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 42 | which_set: "test", 43 | } 44 | }, 45 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 46 | costs: [ 47 | !obj:pylearn2.costs.mlp.Default {}, 48 | !obj:pylearn2.costs.mlp.L1WeightDecay { 49 | coeffs: { 'h2': 0.005 }, 50 | } 51 | ] 52 | 53 | }, 54 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 55 | # input_include_probs: { 'h2' : .1 }, 56 | # input_scales: { 'h2' : 1.01 } 57 | # }, 58 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 59 | # channel_name: "valid_y_misclass", 60 | # prop_decrease: 0.01, 61 | # N: 20 62 | # }, 63 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 64 | max_epochs: 5000, 65 | }, 66 | }, 67 | extensions: [ 68 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 69 | channel_name: 'valid_y_misclass', 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 71 | }, 72 | ], 73 | save_freq: 1, 74 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 75 | } 76 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150130F.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | monitoring_dataset: 36 | { 37 | 'train' : *train, 38 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: "valid", 40 | }, 41 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 42 | which_set: "test", 43 | } 44 | }, 45 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 46 | costs: [ 47 | !obj:pylearn2.costs.mlp.Default {}, 48 | !obj:pylearn2.costs.mlp.L1WeightDecay { 49 | coeffs: { 'h2': 0.006 }, 50 | } 51 | ] 52 | 53 | }, 54 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 55 | # input_include_probs: { 'h2' : .1 }, 56 | # input_scales: { 'h2' : 1.01 } 57 | # }, 58 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 59 | # channel_name: "valid_y_misclass", 60 | # prop_decrease: 0.01, 61 | # N: 20 62 | # }, 63 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 64 | max_epochs: 5000, 65 | }, 66 | }, 67 | extensions: [ 68 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 69 | channel_name: 'valid_y_misclass', 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 71 | }, 72 | ], 73 | save_freq: 1, 74 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 75 | } 76 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150130G.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | monitoring_dataset: 36 | { 37 | 'train' : *train, 38 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: "valid", 40 | }, 41 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 42 | which_set: "test", 43 | } 44 | }, 45 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 46 | costs: [ 47 | !obj:pylearn2.costs.mlp.Default {}, 48 | !obj:pylearn2.costs.mlp.L1WeightDecay { 49 | coeffs: { 'h2': 0.007 }, 50 | } 51 | ] 52 | 53 | }, 54 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 55 | # input_include_probs: { 'h2' : .1 }, 56 | # input_scales: { 'h2' : 1.01 } 57 | # }, 58 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 59 | # channel_name: "valid_y_misclass", 60 | # prop_decrease: 0.01, 61 | # N: 20 62 | # }, 63 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 64 | max_epochs: 5000, 65 | }, 66 | }, 67 | extensions: [ 68 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 69 | channel_name: 'valid_y_misclass', 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 71 | }, 72 | ], 73 | save_freq: 1, 74 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 75 | } 76 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150130H.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | monitoring_dataset: 36 | { 37 | 'train' : *train, 38 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: "valid", 40 | }, 41 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 42 | which_set: "test", 43 | } 44 | }, 45 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 46 | costs: [ 47 | !obj:pylearn2.costs.mlp.Default {}, 48 | !obj:pylearn2.costs.mlp.L1WeightDecay { 49 | coeffs: { 'h2': 0.008 }, 50 | } 51 | ] 52 | 53 | }, 54 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 55 | # input_include_probs: { 'h2' : .1 }, 56 | # input_scales: { 'h2' : 1.01 } 57 | # }, 58 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 59 | # channel_name: "valid_y_misclass", 60 | # prop_decrease: 0.01, 61 | # N: 20 62 | # }, 63 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 64 | max_epochs: 5000, 65 | }, 66 | }, 67 | extensions: [ 68 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 69 | channel_name: 'valid_y_misclass', 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 71 | }, 72 | ], 73 | save_freq: 1, 74 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 75 | } 76 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150130I.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | monitoring_dataset: 36 | { 37 | 'train' : *train, 38 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: "valid", 40 | }, 41 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 42 | which_set: "test", 43 | } 44 | }, 45 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 46 | costs: [ 47 | !obj:pylearn2.costs.mlp.Default {}, 48 | !obj:pylearn2.costs.mlp.L1WeightDecay { 49 | coeffs: { 'h2': 0.009 }, 50 | } 51 | ] 52 | 53 | }, 54 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 55 | # input_include_probs: { 'h2' : .1 }, 56 | # input_scales: { 'h2' : 1.01 } 57 | # }, 58 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 59 | # channel_name: "valid_y_misclass", 60 | # prop_decrease: 0.01, 61 | # N: 20 62 | # }, 63 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 64 | max_epochs: 5000, 65 | }, 66 | }, 67 | extensions: [ 68 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 69 | channel_name: 'valid_y_misclass', 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 71 | }, 72 | ], 73 | save_freq: 1, 74 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 75 | } 76 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150209A.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | # learning_rule: !obj:pylearn2.training_algorithms.learning_rule.RMSProp {}, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: "valid", 41 | }, 42 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 43 | which_set: "test", 44 | } 45 | }, 46 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 47 | costs: [ 48 | !obj:pylearn2.costs.mlp.Default {}, 49 | !obj:pylearn2.costs.mlp.L1WeightDecay { 50 | coeffs: { 'h2': 0.01 }, 51 | } 52 | ] 53 | 54 | }, 55 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 56 | # input_include_probs: { 'h2' : .1 }, 57 | # input_scales: { 'h2' : 1.01 } 58 | # }, 59 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 60 | channel_name: "train_y_misclass", 61 | prop_decrease: 0.01, 62 | N: 20 63 | }, 64 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 65 | # max_epochs: 5000, 66 | # }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150209B.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | # learning_rule: !obj:pylearn2.training_algorithms.learning_rule.RMSProp {}, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: "valid", 41 | }, 42 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 43 | which_set: "test", 44 | } 45 | }, 46 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 47 | costs: [ 48 | !obj:pylearn2.costs.mlp.Default {}, 49 | !obj:pylearn2.costs.mlp.L1WeightDecay { 50 | coeffs: { 'h2': 0.02 }, 51 | } 52 | ] 53 | 54 | }, 55 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 56 | # input_include_probs: { 'h2' : .1 }, 57 | # input_scales: { 'h2' : 1.01 } 58 | # }, 59 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 60 | channel_name: "train_y_misclass", 61 | prop_decrease: 0.01, 62 | N: 20 63 | }, 64 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 65 | # max_epochs: 5000, 66 | # }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150209C.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | # learning_rule: !obj:pylearn2.training_algorithms.learning_rule.RMSProp {}, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: "valid", 41 | }, 42 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 43 | which_set: "test", 44 | } 45 | }, 46 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 47 | costs: [ 48 | !obj:pylearn2.costs.mlp.Default {}, 49 | !obj:pylearn2.costs.mlp.L1WeightDecay { 50 | coeffs: { 'h2': 0.03 }, 51 | } 52 | ] 53 | 54 | }, 55 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 56 | # input_include_probs: { 'h2' : .1 }, 57 | # input_scales: { 'h2' : 1.01 } 58 | # }, 59 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 60 | channel_name: "train_y_misclass", 61 | prop_decrease: 0.01, 62 | N: 20 63 | }, 64 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 65 | # max_epochs: 5000, 66 | # }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150209D.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | # learning_rule: !obj:pylearn2.training_algorithms.learning_rule.RMSProp {}, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: "valid", 41 | }, 42 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 43 | which_set: "test", 44 | } 45 | }, 46 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 47 | costs: [ 48 | !obj:pylearn2.costs.mlp.Default {}, 49 | !obj:pylearn2.costs.mlp.L1WeightDecay { 50 | coeffs: { 'h2': 0.04 }, 51 | } 52 | ] 53 | 54 | }, 55 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 56 | # input_include_probs: { 'h2' : .1 }, 57 | # input_scales: { 'h2' : 1.01 } 58 | # }, 59 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 60 | channel_name: "train_y_misclass", 61 | prop_decrease: 0.01, 62 | N: 20 63 | }, 64 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 65 | # max_epochs: 5000, 66 | # }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150209E.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | # learning_rule: !obj:pylearn2.training_algorithms.learning_rule.RMSProp {}, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: "valid", 41 | }, 42 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 43 | which_set: "test", 44 | } 45 | }, 46 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 47 | costs: [ 48 | !obj:pylearn2.costs.mlp.Default {}, 49 | !obj:pylearn2.costs.mlp.L1WeightDecay { 50 | coeffs: { 'h2': 0.05 }, 51 | } 52 | ] 53 | 54 | }, 55 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 56 | # input_include_probs: { 'h2' : .1 }, 57 | # input_scales: { 'h2' : 1.01 } 58 | # }, 59 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 60 | channel_name: "train_y_misclass", 61 | prop_decrease: 0.01, 62 | N: 20 63 | }, 64 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 65 | # max_epochs: 5000, 66 | # }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150209F.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | # learning_rule: !obj:pylearn2.training_algorithms.learning_rule.RMSProp {}, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: "valid", 41 | }, 42 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 43 | which_set: "test", 44 | } 45 | }, 46 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 47 | costs: [ 48 | !obj:pylearn2.costs.mlp.Default {}, 49 | !obj:pylearn2.costs.mlp.L1WeightDecay { 50 | coeffs: { 'h2': 0.06 }, 51 | } 52 | ] 53 | 54 | }, 55 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 56 | # input_include_probs: { 'h2' : .1 }, 57 | # input_scales: { 'h2' : 1.01 } 58 | # }, 59 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 60 | channel_name: "train_y_misclass", 61 | prop_decrease: 0.01, 62 | N: 20 63 | }, 64 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 65 | # max_epochs: 5000, 66 | # }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/singlerun/l1reg_conv_fast_20150209G.yaml: -------------------------------------------------------------------------------- 1 | # TODO WRITEME 2 | 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: "train", 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | input_space: !obj:pylearn2.space.Conv2DSpace { 10 | shape: [513, 623], 11 | num_channels: 1, 12 | }, 13 | layers: [ 14 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 15 | layer_name: 'h2', 16 | output_channels: 2, 17 | irange: .05, 18 | kernel_shape: [513, 5], 19 | # W_lr_scale: .01, 20 | # kernel_stride: [1, 5], 21 | pool_shape: [1, 8], 22 | pool_stride: [1, 4], 23 | max_kernel_norm: 1.9365, 24 | }, 25 | !obj:pylearn2.models.mlp.Softmax { 26 | max_col_norm: 1.9365, 27 | layer_name: 'y', 28 | istdev: .05, 29 | n_classes: 10 30 | } 31 | ], 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: .01, 35 | # learning_rule: !obj:pylearn2.training_algorithms.learning_rule.RMSProp {}, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: "valid", 41 | }, 42 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 43 | which_set: "test", 44 | } 45 | }, 46 | cost: !obj:pylearn2.costs.cost.SumOfCosts { 47 | costs: [ 48 | !obj:pylearn2.costs.mlp.Default {}, 49 | !obj:pylearn2.costs.mlp.L1WeightDecay { 50 | coeffs: { 'h2': 0.07 }, 51 | } 52 | ] 53 | 54 | }, 55 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 56 | # input_include_probs: { 'h2' : .1 }, 57 | # input_scales: { 'h2' : 1.01 } 58 | # }, 59 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 60 | channel_name: "train_y_misclass", 61 | prop_decrease: 0.01, 62 | N: 20 63 | }, 64 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 65 | # max_epochs: 5000, 66 | # }, 67 | }, 68 | extensions: [ 69 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 70 | channel_name: 'valid_y_misclass', 71 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 72 | }, 73 | ], 74 | save_freq: 1, 75 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 76 | } 77 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_20150107A.yaml: -------------------------------------------------------------------------------- 1 | # Baseline experiment 2 | # Rationale: 3 | # We are trying to follow a similar route as in [#Sigtia:2014dl][]: 4 | # Using 50 neurons in 1 Rectified Linear hidden layer, with a Softmax output layer, 5 | # learning rate of 0.01. 6 | # In this case we are using a window size of 2048 samples for the spectrogram calculations, 7 | # in order to speed up the computation. This means that the shape of the spectrogram is 513*623 pixels. 8 | 9 | !obj:pylearn2.train.Train { 10 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 11 | which_set: 'train', 12 | }, 13 | model: !obj:pylearn2.models.mlp.MLP { 14 | layers: [ 15 | !obj:pylearn2.models.mlp.RectifiedLinear { 16 | irange: .005, 17 | layer_name: 'h0', 18 | dim: 50, 19 | }, 20 | !obj:pylearn2.models.mlp.Softmax { 21 | irange: .005, 22 | layer_name: 'y', 23 | n_classes: 10, 24 | } 25 | ], 26 | input_space: !obj:pylearn2.space.Conv2DSpace { 27 | shape: [513, 623], # the second dimension is dependend on the window size 28 | num_channels: 1, 29 | axes: ['b', 0, 1, 'c'], 30 | }, 31 | }, 32 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 33 | learning_rate: 0.01, 34 | batch_size: 100, 35 | monitoring_dataset: 36 | { 37 | 'train' : *train, 38 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: 'valid', 40 | }, 41 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 42 | which_set: 'test', 43 | }, 44 | }, 45 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 46 | # channel_name: "valid_y_misclass", 47 | # prop_decrease: 0.01, # TODO: do a minimum amount of many times 48 | # N: 20, 49 | # }, 50 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 51 | max_epochs: 10000, 52 | }, 53 | }, 54 | extensions: [ 55 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 56 | channel_name: 'valid_y_misclass', 57 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl", 58 | }, 59 | ], 60 | save_freq: 1, 61 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 62 | } 63 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_20150107B.yaml: -------------------------------------------------------------------------------- 1 | # The difference between this experiment and the previous one (mlp_20150107B) is that 2 | # the batch size has been increased to 1000. 3 | !obj:pylearn2.train.Train { 4 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 5 | which_set: 'train', 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | layers: [ 9 | !obj:pylearn2.models.mlp.RectifiedLinear { 10 | irange: .005, 11 | layer_name: 'h0', 12 | dim: 50, 13 | }, 14 | !obj:pylearn2.models.mlp.Softmax { 15 | irange: .005, 16 | layer_name: 'y', 17 | n_classes: 10, 18 | } 19 | ], 20 | input_space: !obj:pylearn2.space.Conv2DSpace { 21 | shape: [513, 623], 22 | num_channels: 1, 23 | axes: ['b', 0, 1, 'c'], 24 | }, 25 | }, 26 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 27 | learning_rate: 0.01, 28 | batch_size: 1000, 29 | monitoring_dataset: 30 | { 31 | 'train' : *train, 32 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 33 | which_set: 'valid', 34 | }, 35 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 36 | which_set: 'test', 37 | } 38 | }, 39 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 40 | # channel_name: "valid_y_misclass", 41 | # prop_decrease: 0.01, 42 | # N: 20, 43 | # }, 44 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 45 | max_epochs: 10000, 46 | }, 47 | }, 48 | extensions: [ 49 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 50 | channel_name: 'valid_y_misclass', 51 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl", 52 | }, 53 | ], 54 | save_freq: 1, 55 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 56 | } 57 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_20150107C.yaml: -------------------------------------------------------------------------------- 1 | # This experiment is the same as mlp_20150107A but uses a window size of 1024 samples 2 | !obj:pylearn2.train.Train { 3 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 4 | which_set: 'train', 5 | }, 6 | model: !obj:pylearn2.models.mlp.MLP { 7 | layers: [ 8 | !obj:pylearn2.models.mlp.RectifiedLinear { 9 | irange: .005, 10 | layer_name: 'h0', 11 | dim: 50, 12 | }, 13 | !obj:pylearn2.models.mlp.Softmax { 14 | irange: .005, 15 | layer_name: 'y', 16 | n_classes: 10, 17 | } 18 | ], 19 | input_space: !obj:pylearn2.space.Conv2DSpace { 20 | shape: [513, 1247], 21 | num_channels: 1, 22 | axes: ['b', 0, 1, 'c'], 23 | }, 24 | }, 25 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 26 | learning_rate: 0.01, 27 | batch_size: 100, 28 | monitoring_dataset: 29 | { 30 | 'train' : *train, 31 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 32 | which_set: 'valid', 33 | }, 34 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 35 | which_set: 'test', 36 | } 37 | }, 38 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 39 | # channel_name: "valid_y_misclass", 40 | # prop_decrease: 0.01, 41 | # N: 20, 42 | # }, 43 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 44 | max_epochs: 10000, 45 | }, 46 | }, 47 | extensions: [ 48 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 49 | channel_name: 'valid_y_misclass', 50 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl", 51 | }, 52 | ], 53 | save_freq: 1, 54 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 55 | } 56 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_20150107D.yaml: -------------------------------------------------------------------------------- 1 | # This experiment is the same as mlp_20150107C but with a batch size of 1000 2 | !obj:pylearn2.train.Train { 3 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 4 | which_set: 'train', 5 | }, 6 | model: !obj:pylearn2.models.mlp.MLP { 7 | layers: [ 8 | !obj:pylearn2.models.mlp.RectifiedLinear { 9 | irange: .005, 10 | layer_name: 'h0', 11 | dim: 50, 12 | }, 13 | !obj:pylearn2.models.mlp.Softmax { 14 | irange: .005, 15 | layer_name: 'y', 16 | n_classes: 10, 17 | } 18 | ], 19 | input_space: !obj:pylearn2.space.Conv2DSpace { 20 | shape: [513, 1247], 21 | num_channels: 1, 22 | axes: ['b', 0, 1, 'c'], 23 | }, 24 | }, 25 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 26 | learning_rate: 0.01, 27 | batch_size: 1000, 28 | monitoring_dataset: 29 | { 30 | 'train' : *train, 31 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 32 | which_set: 'valid', 33 | }, 34 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 35 | which_set: 'test', 36 | } 37 | }, 38 | # termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 39 | # channel_name: "valid_y_misclass", 40 | # prop_decrease: 0.01, 41 | # N: 20, 42 | # }, 43 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 44 | max_epochs: 10000, 45 | }, 46 | }, 47 | extensions: [ 48 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 49 | channel_name: 'valid_y_misclass', 50 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl", 51 | }, 52 | ], 53 | save_freq: 1, 54 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 55 | } 56 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_5sec_20150203A.yaml: -------------------------------------------------------------------------------- 1 | # Baseline experiment 2 | # Rationale: 3 | # We are trying to follow a similar route as in [#Sigtia:2014dl][]: 4 | # Using 50 neurons in 1 Rectified Linear hidden layer, with a Softmax output layer, 5 | # learning rate of 0.01. 6 | # In this case we are using a window size of 2048 samples for the spectrogram calculations, 7 | # in order to speed up the computation. This means that the shape of the spectrogram is 513*623 pixels. 8 | 9 | !obj:pylearn2.train.Train { 10 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 11 | which_set: 'train', 12 | seconds: 25.0, # changing this makes the shape of the Conv2DSpace change in the second dimension 13 | }, 14 | model: !obj:pylearn2.models.mlp.MLP { 15 | layers: [ 16 | !obj:pylearn2.models.mlp.RectifiedLinear { 17 | irange: .005, 18 | layer_name: 'h0', 19 | dim: 50, 20 | }, 21 | !obj:pylearn2.models.mlp.Softmax { 22 | irange: .005, 23 | layer_name: 'y', 24 | n_classes: 10, 25 | } 26 | ], 27 | input_space: !obj:pylearn2.space.Conv2DSpace { 28 | shape: [513, 5], # the second dimension is dependend on the window size 29 | num_channels: 1, 30 | # axes: ['b', 0, 1, 'c'], 31 | }, 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: 0.01, 35 | batch_size: 100, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: 'valid', 41 | seconds: 25.0, 42 | }, 43 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 44 | which_set: 'test', 45 | seconds: 25.0, 46 | }, 47 | }, 48 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 49 | channel_name: "valid_y_misclass", 50 | prop_decrease: 0.01, # TODO: do a minimum amount of many times 51 | N: 100, 52 | }, 53 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 54 | # max_epochs: 10000, 55 | # }, 56 | }, 57 | extensions: [ 58 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 59 | channel_name: 'valid_y_misclass', 60 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl", 61 | }, 62 | ], 63 | save_freq: 1, 64 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 65 | } 66 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_5sec_20150203B.yaml: -------------------------------------------------------------------------------- 1 | # Baseline experiment 2 | # Rationale: 3 | # We are trying to follow a similar route as in [#Sigtia:2014dl][]: 4 | # Using 50 neurons in 1 Rectified Linear hidden layer, with a Softmax output layer, 5 | # learning rate of 0.01. 6 | # In this case we are using a window size of 2048 samples for the spectrogram calculations, 7 | # in order to speed up the computation. This means that the shape of the spectrogram is 513*623 pixels. 8 | 9 | !obj:pylearn2.train.Train { 10 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 11 | which_set: 'train', 12 | seconds: 25.0, # changing this makes the shape of the Conv2DSpace change in the second dimension 13 | }, 14 | model: !obj:pylearn2.models.mlp.MLP { 15 | layers: [ 16 | !obj:pylearn2.models.mlp.RectifiedLinear { 17 | irange: .005, 18 | layer_name: 'h0', 19 | dim: 50, 20 | }, 21 | !obj:pylearn2.models.mlp.Softmax { 22 | irange: .005, 23 | layer_name: 'y', 24 | n_classes: 10, 25 | } 26 | ], 27 | input_space: !obj:pylearn2.space.Conv2DSpace { 28 | shape: [513, 5], # the second dimension is dependend on the window size 29 | num_channels: 1, 30 | # axes: ['b', 0, 1, 'c'], 31 | }, 32 | }, 33 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 34 | learning_rate: 0.01, 35 | batch_size: 100, 36 | monitoring_dataset: 37 | { 38 | 'train' : *train, 39 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 40 | which_set: 'valid', 41 | seconds: 25.0, 42 | }, 43 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 44 | which_set: 'test', 45 | seconds: 25.0, 46 | }, 47 | }, 48 | cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 49 | input_include_probs: { 'h0' : .32 }, 50 | input_scales: { 'h0' : 1.32 } 51 | }, 52 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 53 | channel_name: "valid_y_misclass", 54 | prop_decrease: 0.01, # TODO: do a minimum amount of many times 55 | N: 100, 56 | }, 57 | # termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 58 | # max_epochs: 10000, 59 | # }, 60 | }, 61 | extensions: [ 62 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 63 | channel_name: 'valid_y_misclass', 64 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl", 65 | }, 66 | ], 67 | save_freq: 1, 68 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 69 | } 70 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_fie_20150112A.yaml: -------------------------------------------------------------------------------- 1 | # Baseline experiment with frames as examples 2 | !obj:pylearn2.train.Train { 3 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 4 | which_set: 'train', 5 | frame_is_example: true, 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | layers: [ 9 | !obj:pylearn2.models.mlp.RectifiedLinear { 10 | irange: .005, 11 | layer_name: 'h0', 12 | dim: 50, 13 | }, 14 | !obj:pylearn2.models.mlp.Softmax { 15 | irange: .005, 16 | layer_name: 'y', 17 | n_classes: 10, 18 | } 19 | ], 20 | input_space: !obj:pylearn2.space.VectorSpace { 21 | dim: 513, 22 | }, 23 | }, 24 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 25 | learning_rate: 0.01, 26 | batch_size: 62300, 27 | monitoring_dataset: 28 | { 29 | 'train' : *train, 30 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 31 | which_set: 'valid', 32 | frame_is_example: true, 33 | }, 34 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 35 | which_set: 'test', 36 | frame_is_example: true, 37 | } 38 | }, 39 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 40 | max_epochs: 10000, 41 | }, 42 | }, 43 | extensions: [ 44 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 45 | channel_name: 'valid_y_misclass', 46 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 47 | }, 48 | ], 49 | save_freq: 1, 50 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 51 | } 52 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_fie_20150112B.yaml: -------------------------------------------------------------------------------- 1 | # Similar to mlp_fie_20150112A, but with the standard window size of 1024 2 | !obj:pylearn2.train.Train { 3 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 4 | which_set: 'train', 5 | frame_is_example: true, 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | layers: [ 9 | !obj:pylearn2.models.mlp.RectifiedLinear { 10 | irange: .005, 11 | layer_name: 'h0', 12 | dim: 50, 13 | }, 14 | !obj:pylearn2.models.mlp.Softmax { 15 | irange: .005, 16 | layer_name: 'y', 17 | n_classes: 10, 18 | } 19 | ], 20 | input_space: !obj:pylearn2.space.VectorSpace { 21 | dim: 513, 22 | }, 23 | }, 24 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 25 | learning_rate: 0.01, 26 | batch_size: 62300, 27 | monitoring_dataset: 28 | { 29 | 'train' : *train, 30 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 31 | which_set: 'valid', 32 | frame_is_example: true, 33 | }, 34 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 35 | which_set: 'test', 36 | frame_is_example: true, 37 | } 38 | }, 39 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 40 | max_epochs: 10000, 41 | }, 42 | }, 43 | extensions: [ 44 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 45 | channel_name: 'valid_y_misclass', 46 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 47 | }, 48 | ], 49 | save_freq: 1, 50 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 51 | } 52 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_fie_20150112C.yaml: -------------------------------------------------------------------------------- 1 | # Similar to mlp_20150112A, but the layer h0 has 500 units 2 | !obj:pylearn2.train.Train { 3 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 4 | which_set: 'train', 5 | frame_is_example: true, 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | layers: [ 9 | !obj:pylearn2.models.mlp.RectifiedLinear { 10 | irange: .005, 11 | layer_name: 'h0', 12 | dim: 500, 13 | }, 14 | !obj:pylearn2.models.mlp.Softmax { 15 | irange: .005, 16 | layer_name: 'y', 17 | n_classes: 10, 18 | } 19 | ], 20 | input_space: !obj:pylearn2.space.VectorSpace { 21 | dim: 513, 22 | }, 23 | }, 24 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 25 | learning_rate: 0.01, 26 | batch_size: 62300, 27 | monitoring_dataset: 28 | { 29 | 'train' : *train, 30 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 31 | which_set: 'valid', 32 | frame_is_example: true, 33 | }, 34 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 35 | which_set: 'test', 36 | frame_is_example: true, 37 | } 38 | }, 39 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 40 | max_epochs: 10000, 41 | }, 42 | }, 43 | extensions: [ 44 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 45 | channel_name: 'valid_y_misclass', 46 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 47 | }, 48 | ], 49 | save_freq: 1, 50 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 51 | } 52 | -------------------------------------------------------------------------------- /experiments/singlerun/mlp_fie_20150112D.yaml: -------------------------------------------------------------------------------- 1 | # Similar to mlp_fie_20150112B, but with 500 units 2 | !obj:pylearn2.train.Train { 3 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 4 | which_set: 'train', 5 | frame_is_example: true, 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | layers: [ 9 | !obj:pylearn2.models.mlp.RectifiedLinear { 10 | irange: .005, 11 | layer_name: 'h0', 12 | dim: 500, 13 | }, 14 | !obj:pylearn2.models.mlp.Softmax { 15 | irange: .005, 16 | layer_name: 'y', 17 | n_classes: 10, 18 | } 19 | ], 20 | input_space: !obj:pylearn2.space.VectorSpace { 21 | dim: 513, 22 | }, 23 | }, 24 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 25 | learning_rate: 0.01, 26 | batch_size: 62300, 27 | monitoring_dataset: 28 | { 29 | 'train' : *train, 30 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 31 | which_set: 'valid', 32 | frame_is_example: true, 33 | }, 34 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 35 | which_set: 'test', 36 | frame_is_example: true, 37 | } 38 | }, 39 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 40 | max_epochs: 10000, 41 | }, 42 | }, 43 | extensions: [ 44 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 45 | channel_name: 'valid_y_misclass', 46 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 47 | }, 48 | ], 49 | save_freq: 1, 50 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 51 | } 52 | -------------------------------------------------------------------------------- /experiments/test/conv_seed_test.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 3 | which_set: "train", 4 | seconds: &seconds 4.0, 5 | seed: &seed 1234, 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | seed: *seed, 10 | input_space: !obj:pylearn2.space.Conv2DSpace { 11 | shape: [513, 85], 12 | num_channels: 1, 13 | }, 14 | layers: [ 15 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 16 | layer_name: 'h2', 17 | output_channels: 64, 18 | irange: .05, 19 | kernel_shape: [513, 5], 20 | pool_shape: [1, 8], 21 | pool_stride: [1, 4], 22 | max_kernel_norm: 1.9365, 23 | }, 24 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 25 | layer_name: 'h3', 26 | output_channels: 64, 27 | irange: .05, 28 | kernel_shape: [1, 10], 29 | pool_shape: [1, 8], 30 | pool_stride: [1, 4], 31 | max_kernel_norm: 1.9365, 32 | }, 33 | !obj:pylearn2.models.mlp.Softmax { 34 | max_col_norm: 1.9365, 35 | layer_name: 'y', 36 | istdev: .05, 37 | n_classes: 10 38 | } 39 | ], 40 | }, 41 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 42 | learning_rate: .01, 43 | monitoring_dataset: 44 | { 45 | 'train' : *train, 46 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 47 | which_set: "valid", 48 | seconds: *seconds, 49 | seed: *seed, 50 | }, 51 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 52 | which_set: "test", 53 | seconds: *seconds, 54 | seed: *seed, 55 | } 56 | }, 57 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 58 | max_epochs: 10, 59 | }, 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /experiments/test/conv_tw.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 3 | which_set: "train", 4 | feature: &feature "texture_window", 5 | seed: &seed 1234, 6 | }, 7 | model: !obj:pylearn2.models.mlp.MLP { 8 | batch_size: 10, 9 | seed: *seed, 10 | input_space: !obj:pylearn2.space.Conv2DSpace { 11 | shape: [513, 61], 12 | num_channels: 1, 13 | }, 14 | layers: [ 15 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 16 | layer_name: 'h2', 17 | output_channels: 64, 18 | irange: .05, 19 | kernel_shape: [513, 3], 20 | pool_shape: [1, 4], 21 | pool_stride: [1, 2], 22 | max_kernel_norm: 1.9365, 23 | }, 24 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 25 | layer_name: 'h3', 26 | output_channels: 64, 27 | irange: .05, 28 | kernel_shape: [1, 2], 29 | pool_shape: [1, 4], 30 | pool_stride: [1, 2], 31 | max_kernel_norm: 1.9365, 32 | }, 33 | !obj:pylearn2.models.mlp.Softmax { 34 | max_col_norm: 1.9365, 35 | layer_name: 'y', 36 | istdev: .05, 37 | n_classes: 10 38 | } 39 | ], 40 | }, 41 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 42 | learning_rate: .01, 43 | monitoring_dataset: 44 | { 45 | 'train' : *train, 46 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 47 | which_set: "valid", 48 | feature: *feature, 49 | seed: *seed, 50 | }, 51 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 52 | which_set: "test", 53 | feature: *feature, 54 | seed: *seed, 55 | } 56 | }, 57 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 58 | channel_name: "valid_y_misclass", 59 | prop_decrease: 0.001, 60 | N: 20 61 | }, 62 | }, 63 | extensions: [ 64 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 65 | channel_name: 'valid_y_misclass', 66 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 67 | }, 68 | ], 69 | save_freq: 1, 70 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 71 | } 72 | -------------------------------------------------------------------------------- /experiments/test/cross_validation.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.cross_validation.TrainCV { 2 | dataset_iterator: !obj:pylearn2.cross_validation.dataset_iterators.DatasetKFold { 3 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 4 | which_set: "all", 5 | seconds: &seconds 4.0, 6 | seed: &seed 1234, 7 | verbose: true 8 | }, 9 | n_folds: 4 10 | }, 11 | model: !obj:pylearn2.models.mlp.MLP { 12 | batch_size: 10, 13 | # seed: *seed, 14 | input_space: !obj:pylearn2.space.Conv2DSpace { 15 | shape: [513, 85], 16 | num_channels: 1, 17 | }, 18 | layers: [ 19 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 20 | layer_name: 'h0', 21 | output_channels: 16, 22 | irange: .05, 23 | kernel_shape: [513, 5], 24 | pool_shape: [1, 8], 25 | pool_stride: [1, 4], 26 | max_kernel_norm: 1.9365, 27 | }, 28 | !obj:pylearn2.models.mlp.ConvRectifiedLinear { 29 | layer_name: 'h1', 30 | output_channels: 64, 31 | irange: .05, 32 | kernel_shape: [1, 10], 33 | pool_shape: [1, 8], 34 | pool_stride: [1, 4], 35 | max_kernel_norm: 1.9365, 36 | }, 37 | !obj:pylearn2.models.mlp.Softmax { 38 | max_col_norm: 1.9365, 39 | layer_name: 'y', 40 | istdev: .05, 41 | n_classes: 10 42 | } 43 | ], 44 | }, 45 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 46 | batch_size: 10, 47 | learning_rate: .001, 48 | # learning_rule: !obj:pylearn2.training_algorithms.learning_rule.Momentum { 49 | # init_momentum: .01 50 | # }, 51 | # cost: !obj:pylearn2.costs.mlp.dropout.Dropout { 52 | # input_include_probs: { 'h0' : .8 }, 53 | # input_scales: { 'h0' : 1. } 54 | # }, 55 | termination_criterion: !obj:pylearn2.termination_criteria.EpochCounter { 56 | max_epochs: 20 57 | }, 58 | }, 59 | cv_extensions: [ 60 | !obj:pylearn2.cross_validation.train_cv_extensions.MonitorBasedSaveBestCV { 61 | channel_name: 'test_y_misclass', 62 | save_path: 'results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl', 63 | }, 64 | ], 65 | save_freq: 1, 66 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 67 | } 68 | -------------------------------------------------------------------------------- /experiments/test/logreg.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 3 | which_set: "train", 4 | seconds: &seconds 16.0, 5 | seed: &seed 1234, 6 | space: &space vector, 7 | balanced_splits: &balanced_splits True, 8 | }, 9 | model: !obj:genretron.logistic_regression.LogisticRegression { 10 | nvis: 513, 11 | nclasses: 10, 12 | }, 13 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 14 | batch_size: 62300, 15 | learning_rate: .01, 16 | monitoring_dataset: 17 | { 18 | 'train' : *train, 19 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 20 | which_set: "valid", 21 | seconds: *seconds, 22 | seed: *seed, 23 | space: *space, 24 | balanced_splits: *balanced_splits 25 | }, 26 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 27 | which_set: "test", 28 | seconds: *seconds, 29 | seed: *seed, 30 | space: *space, 31 | balanced_splits: *balanced_splits 32 | } 33 | }, 34 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 35 | channel_name: "valid_error", 36 | prop_decrease: 0.001, 37 | N: 100 38 | }, 39 | }, 40 | extensions: [ 41 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 42 | channel_name: 'valid_error', 43 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 44 | }, 45 | ], 46 | save_freq: 1, 47 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 48 | } 49 | -------------------------------------------------------------------------------- /experiments/test/mlp.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 3 | which_set: 'train', 4 | space: &space 'vector', 5 | seconds: &seconds 4.0, 6 | seed: &seed 1234, 7 | }, 8 | model: !obj:pylearn2.models.mlp.MLP { 9 | seed: *seed, 10 | layers: [ 11 | !obj:pylearn2.models.mlp.RectifiedLinear { 12 | irange: .005, 13 | layer_name: 'h0', 14 | dim: 50, 15 | }, 16 | !obj:pylearn2.models.mlp.Softmax { 17 | irange: .005, 18 | layer_name: 'y', 19 | n_classes: 10, 20 | } 21 | ], 22 | input_space: !obj:pylearn2.space.VectorSpace { 23 | dim: 513, 24 | }, 25 | }, 26 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 27 | learning_rate: 0.01, 28 | batch_size: 62300, 29 | monitoring_dataset: 30 | { 31 | 'train' : *train, 32 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 33 | which_set: 'valid', 34 | space: *space, 35 | seconds: *seconds, 36 | seed: *seed, 37 | }, 38 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: 'test', 40 | space: *space, 41 | seconds: *seconds, 42 | seed: *seed, 43 | } 44 | }, 45 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 46 | channel_name: "valid_y_misclass", 47 | prop_decrease: 0.001, 48 | N: 20 49 | }, 50 | }, 51 | extensions: [ 52 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 53 | channel_name: 'valid_y_misclass', 54 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 55 | }, 56 | ], 57 | save_freq: 1, 58 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 59 | } 60 | -------------------------------------------------------------------------------- /experiments/test/mlp_tw.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 3 | which_set: 'train', 4 | space: &space 'vector', 5 | feature: &feature 'texture_window', 6 | seed: &seed 1234, 7 | }, 8 | model: !obj:pylearn2.models.mlp.MLP { 9 | seed: *seed, 10 | layers: [ 11 | !obj:pylearn2.models.mlp.RectifiedLinear { 12 | irange: .005, 13 | layer_name: 'h0', 14 | dim: 50, 15 | }, 16 | !obj:pylearn2.models.mlp.Softmax { 17 | irange: .005, 18 | layer_name: 'y', 19 | n_classes: 10, 20 | } 21 | ], 22 | input_space: !obj:pylearn2.space.VectorSpace { 23 | dim: 513, 24 | }, 25 | }, 26 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 27 | learning_rate: 0.01, 28 | batch_size: 62300, 29 | monitoring_dataset: 30 | { 31 | 'train' : *train, 32 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 33 | which_set: 'valid', 34 | space: *space, 35 | feature: *feature, 36 | seed: *seed, 37 | }, 38 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 39 | which_set: 'test', 40 | space: *space, 41 | feature: *feature, 42 | seed: *seed, 43 | } 44 | }, 45 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 46 | channel_name: "valid_y_misclass", 47 | prop_decrease: 0.001, 48 | N: 20 49 | }, 50 | }, 51 | extensions: [ 52 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 53 | channel_name: 'valid_y_misclass', 54 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 55 | }, 56 | ], 57 | save_freq: 1, 58 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl", 59 | } 60 | -------------------------------------------------------------------------------- /experiments/test/softmax.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 3 | which_set: "train", 4 | window_size: &window_size 2048, 5 | seconds: &seconds 16.0, 6 | seed: &seed 1234, 7 | space: &space vector, 8 | balanced_splits: &balanced_splits True, 9 | }, 10 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 11 | nvis: 513, 12 | n_classes: 10, 13 | irange: .05 14 | }, 15 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 16 | batch_size: 62300, 17 | learning_rate: .01, 18 | monitoring_dataset: 19 | { 20 | 'train' : *train, 21 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 22 | which_set: "valid", 23 | window_size: *window_size, 24 | seconds: *seconds, 25 | seed: *seed, 26 | space: *space, 27 | balanced_splits: *balanced_splits 28 | }, 29 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 30 | which_set: "test", 31 | window_size: *window_size, 32 | seconds: *seconds, 33 | seed: *seed, 34 | space: *space, 35 | balanced_splits: *balanced_splits 36 | } 37 | }, 38 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 39 | channel_name: "valid_y_misclass", 40 | prop_decrease: 0.01, 41 | N: 100 42 | }, 43 | }, 44 | extensions: [ 45 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 46 | channel_name: 'valid_y_misclass', 47 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 48 | }, 49 | ], 50 | save_freq: 1, 51 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 52 | } 53 | -------------------------------------------------------------------------------- /experiments/test/softmax_mnist.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:pylearn2.datasets.mnist.MNIST { 3 | which_set: 'train', 4 | start: 0, 5 | stop: 50000 6 | }, 7 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 8 | nvis: 784, 9 | n_classes: 10, 10 | irange: .05 11 | }, 12 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 13 | batch_size: 62300, 14 | learning_rate: .01, 15 | monitoring_dataset: 16 | { 17 | 'train' : *train, 18 | 'valid' : !obj:pylearn2.datasets.mnist.MNIST { 19 | which_set: 'train', 20 | start: 50000, 21 | stop: 60000 22 | }, 23 | 'test' : !obj:pylearn2.datasets.mnist.MNIST { 24 | which_set: 'test', 25 | stop: 10000 26 | } 27 | }, 28 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 29 | channel_name: "valid_y_misclass", 30 | prop_decrease: 0.001, 31 | N: 100 32 | }, 33 | }, 34 | extensions: [ 35 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 36 | channel_name: 'valid_y_misclass', 37 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 38 | }, 39 | ], 40 | save_freq: 1, 41 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 42 | } 43 | -------------------------------------------------------------------------------- /experiments/test/softmax_ws.yaml: -------------------------------------------------------------------------------- 1 | !obj:pylearn2.train.Train { 2 | dataset: &train !obj:genretron.gtzan.GTZAN_On_Memory { 3 | which_set: "train", 4 | window_size: &window_size 2048, 5 | seconds: &seconds 16.0, 6 | seed: &seed 1234, 7 | space: &space vector, 8 | balanced_splits: &balanced_splits True, 9 | use_whole_song: &use_whole_song True 10 | }, 11 | model: !obj:pylearn2.models.softmax_regression.SoftmaxRegression { 12 | nvis: 513, 13 | n_classes: 10, 14 | irange: .05 15 | }, 16 | algorithm: !obj:pylearn2.training_algorithms.sgd.SGD { 17 | batch_size: 62300, 18 | learning_rate: .01, 19 | monitoring_dataset: 20 | { 21 | 'train' : *train, 22 | 'valid' : !obj:genretron.gtzan.GTZAN_On_Memory { 23 | which_set: "valid", 24 | window_size: *window_size, 25 | seconds: *seconds, 26 | seed: *seed, 27 | space: *space, 28 | balanced_splits: *balanced_splits, 29 | use_whole_song: *use_whole_song 30 | }, 31 | 'test' : !obj:genretron.gtzan.GTZAN_On_Memory { 32 | which_set: "test", 33 | window_size: *window_size, 34 | seconds: *seconds, 35 | seed: *seed, 36 | space: *space, 37 | balanced_splits: *balanced_splits, 38 | use_whole_song: *use_whole_song 39 | } 40 | }, 41 | termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased { 42 | channel_name: "valid_y_misclass", 43 | prop_decrease: 0.01, 44 | N: 100 45 | }, 46 | }, 47 | extensions: [ 48 | !obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest { 49 | channel_name: 'valid_y_misclass', 50 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}_best.pkl" 51 | }, 52 | ], 53 | save_freq: 1, 54 | save_path: "results/${PYLEARN2_TRAIN_FILE_FULL_STEM}.pkl" 55 | } 56 | -------------------------------------------------------------------------------- /genretron/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crmne/Genretron/152ff2cd22e8ca9a1c73836ef9f48ecc5a14da8d/genretron/__init__.py -------------------------------------------------------------------------------- /genretron/gtzan.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from pylearn2.datasets import dense_design_matrix 3 | from audio_dataset import AudioDataset 4 | 5 | __authors__ = "Carmine Paolino" 6 | __copyright__ = "Copyright 2015, Vrije Universiteit Amsterdam" 7 | __credits__ = ["Carmine Paolino"] 8 | __license__ = "3-clause BSD" 9 | __email__ = "carmine@paolino.me" 10 | 11 | 12 | class GTZAN(AudioDataset): 13 | 14 | def __init__(self, path="${PYLEARN2_DATA_PATH}/GTZAN", 15 | seconds=29.0, **kwargs): 16 | super(GTZAN, self).__init__(path, seconds=seconds, **kwargs) 17 | 18 | 19 | class GTZAN_On_Memory(dense_design_matrix.DenseDesignMatrix): 20 | 21 | def __init__(self, **kwargs): 22 | gtzan = GTZAN(**kwargs) 23 | gtzan.process() 24 | super(GTZAN_On_Memory, self).__init__( 25 | X=gtzan.data_x, 26 | y=gtzan.data_y, 27 | view_converter=gtzan.view_converter 28 | ) 29 | -------------------------------------------------------------------------------- /genretron/jobman_utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import numpy 3 | from jobman.tools import DD 4 | 5 | __authors__ = "Carmine Paolino" 6 | __copyright__ = "Copyright 2015, Vrije Universiteit Amsterdam" 7 | __credits__ = ["Carmine Paolino"] 8 | __license__ = "3-clause BSD" 9 | __email__ = "carmine@paolino.me" 10 | 11 | 12 | def results_extractor(train_obj): 13 | channels = train_obj.model.monitor.channels 14 | best_index = numpy.argmin(channels['valid_y_nll'].val_record) 15 | 16 | return DD( 17 | best_epoch=best_index, 18 | best_epoch_time=channels['valid_y_misclass'].time_record[best_index], 19 | valid_y_misclass_array=[i.item() for i 20 | in channels['valid_y_misclass'].val_record], 21 | test_y_misclass_array=[i.item() for i 22 | in channels['test_y_misclass'].val_record], 23 | train_y_misclass_array=[i.item() for i 24 | in channels['train_y_misclass'].val_record], 25 | valid_y_misclass=channels[ 26 | 'valid_y_misclass'].val_record[best_index].item(), 27 | test_y_misclass=channels[ 28 | 'test_y_misclass'].val_record[best_index].item(), 29 | train_y_misclass=channels[ 30 | 'train_y_misclass'].val_record[best_index].item(), 31 | ) 32 | 33 | 34 | def log_uniform(low, high): 35 | """ 36 | Generates a number that's uniformly distributed in the log-space between 37 | `low` and `high` 38 | 39 | Parameters 40 | ---------- 41 | low : float 42 | Lower bound of the randomly generated number 43 | high : float 44 | Upper bound of the randomly generated number 45 | 46 | Returns 47 | ------- 48 | rval : float 49 | Random number uniformly distributed in the log-space specified by `low` 50 | and `high` 51 | """ 52 | log_low = numpy.log(low) 53 | log_high = numpy.log(high) 54 | 55 | log_rval = numpy.random.uniform(log_low, log_high) 56 | rval = float(numpy.exp(log_rval)) 57 | 58 | return rval 59 | -------------------------------------------------------------------------------- /genretron/kfold.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import numpy 3 | 4 | __authors__ = "Carmine Paolino" 5 | __copyright__ = "Copyright 2015, Vrije Universiteit Amsterdam" 6 | __credits__ = ["Carmine Paolino"] 7 | __license__ = "3-clause BSD" 8 | __email__ = "carmine@paolino.me" 9 | 10 | 11 | class KFold(object): 12 | 13 | """KFold CrossValidation with support for validation sets""" 14 | 15 | def __init__(self, idxs, n_folds=4): 16 | assert n_folds >= 3 17 | assert isinstance(idxs, numpy.ndarray) 18 | self.n_folds = n_folds 19 | self.runs = [] 20 | folds = numpy.split(idxs, self.n_folds) 21 | for run_n in xrange(self.n_folds): 22 | run = {'train': [], 'valid': [], 'test': []} 23 | test_idxs = (0 + run_n) % self.n_folds 24 | valid_idxs = (1 + run_n) % self.n_folds 25 | run['test'] = folds[test_idxs] 26 | run['valid'] = folds[valid_idxs] 27 | run['train'] = numpy.concatenate( 28 | [x for i, x in enumerate(folds) 29 | if i not in {test_idxs, valid_idxs}]) 30 | self.runs.append(run) 31 | -------------------------------------------------------------------------------- /genretron/logistic_regression.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import theano.tensor as T 3 | import numpy 4 | import theano 5 | from pylearn2.models.model import Model 6 | from pylearn2.space import VectorSpace 7 | from pylearn2.utils import sharedX 8 | from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin 9 | from theano.compat.python2x import OrderedDict 10 | from pylearn2.space import CompositeSpace 11 | 12 | 13 | class LogisticRegressionCost(DefaultDataSpecsMixin, Cost): 14 | 15 | """Code from 16 | http://deeplearning.net/software/pylearn2/theano_to_pylearn2_tutorial.html 17 | """ 18 | supervised = True 19 | 20 | def expr(self, model, data, **kwargs): 21 | space, source = self.get_data_specs(model) 22 | space.validate(data) 23 | 24 | inputs, targets = data 25 | outputs = model.logistic_regression(inputs) 26 | loss = -(targets * T.log(outputs)).sum(axis=1) 27 | return loss.mean() 28 | 29 | 30 | class LogisticRegression(Model): 31 | 32 | """Most code from 33 | http://deeplearning.net/software/pylearn2/theano_to_pylearn2_tutorial.html 34 | """ 35 | 36 | def __init__(self, nvis, nclasses): 37 | super(LogisticRegression, self).__init__() 38 | 39 | self.nvis = nvis 40 | self.nclasses = nclasses 41 | 42 | W_value = numpy.random.uniform( 43 | size=(self.nvis, self.nclasses)).astype(theano.config.floatX) 44 | self.W = sharedX(W_value, 'W') 45 | b_value = numpy.zeros(self.nclasses, dtype=theano.config.floatX) 46 | self.b = sharedX(b_value, 'b') 47 | self._params = [self.W, self.b] 48 | 49 | self.input_space = VectorSpace(dim=self.nvis) 50 | self.output_space = VectorSpace(dim=self.nclasses) 51 | 52 | def logistic_regression(self, inputs): 53 | return T.nnet.softmax(T.dot(inputs, self.W) + self.b) 54 | 55 | def get_monitoring_data_specs(self): 56 | space = CompositeSpace([self.get_input_space(), 57 | self.get_target_space()]) 58 | source = (self.get_input_source(), self.get_target_source()) 59 | return (space, source) 60 | 61 | def get_monitoring_channels(self, data): 62 | space, source = self.get_monitoring_data_specs() 63 | space.validate(data) 64 | 65 | X, y = data 66 | y_hat = self.logistic_regression(X) 67 | error = T.neq(y.argmax(axis=1), y_hat.argmax(axis=1)).mean( 68 | dtype=theano.config.floatX) 69 | 70 | return OrderedDict([('error', error)]) 71 | 72 | def get_weights(self): 73 | return self.W 74 | 75 | def get_default_cost(self): 76 | return LogisticRegressionCost() 77 | -------------------------------------------------------------------------------- /genretron/preprocessors.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import numpy 3 | 4 | 5 | class ZNormalizer(object): 6 | 7 | def fit_transform(self, data): 8 | mean = numpy.mean(data) 9 | std = numpy.std(data) 10 | data -= mean 11 | data /= std 12 | return data 13 | 14 | 15 | class MinMaxScaler(object): 16 | 17 | def fit_transform(self, data, feature_range=(-1, 1)): 18 | _min, _max = feature_range 19 | std = (data - data.min(axis=0)) / (data.max(axis=0) - data.min(axis=0)) 20 | return std * (_max - _min) + _min 21 | 22 | 23 | class LinearNormalizer(object): 24 | 25 | def fit_transform(self, data): 26 | raise NotImplementedError 27 | 28 | 29 | class OutlierReplacer(object): 30 | 31 | def fit_transform(self, data, percentile=5): 32 | raise NotImplementedError 33 | 34 | 35 | preprocessors = { 36 | 'znormalizer': ZNormalizer(), 37 | 'linearnormalizer': LinearNormalizer(), 38 | 'outlierreplacer': OutlierReplacer(), 39 | 'minmaxscaler': MinMaxScaler() 40 | } 41 | 42 | 43 | def preprocessor_factory(preprocessor): 44 | return preprocessors[preprocessor] 45 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | argparse 2 | librosa 3 | matplotlib>=1.4,<1.5 4 | nose 5 | nose-parameterized 6 | numpy 7 | psycopg2 8 | progress 9 | PyYAML 10 | scikit-learn 11 | scikits.audiolab 12 | scipy 13 | sqlalchemy 14 | tables 15 | theano 16 | -------------------------------------------------------------------------------- /results/.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | * 3 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | try: 3 | from setuptools import setup 4 | from setuptools.command.install import install 5 | except ImportError: 6 | from distutils.core import setup 7 | import pip 8 | from pip.req import parse_requirements 9 | from pip.download import PipSession 10 | 11 | install_first = [ 12 | 'setuptools>=17.1', 13 | 'six>=1.7' 14 | 'numpy' 15 | ] 16 | git_submodules = [ 17 | 'pylearn2', 18 | 'jobman' 19 | ] 20 | 21 | 22 | class CustomInstall(install): 23 | 24 | """Customized setuptools install command. 25 | 26 | Installs git submodules and packages that need to be installed first.""" 27 | 28 | def run(self): 29 | import os 30 | from distutils.sysconfig import get_python_lib 31 | 32 | for package in install_first: 33 | pip.main(['install', package]) 34 | 35 | install.do_egg_install(self) 36 | 37 | current_dir = os.path.dirname(os.path.realpath(__file__)) 38 | for submodule in git_submodules: 39 | pth_path = os.path.join(get_python_lib(), submodule + ".pth") 40 | with open(pth_path, 'w') as pth: 41 | pth.write(os.path.join(current_dir, submodule) + os.linesep) 42 | 43 | 44 | def requirements(): 45 | install_reqs = parse_requirements('requirements.txt', session=PipSession()) 46 | return [str(ir.req) for ir in install_reqs] 47 | 48 | 49 | config = { 50 | 'description': 'Genretron', 51 | 'author': ['Carmine Paolino'], 52 | 'url': 'https://github.com/crmne/Genretron', 53 | 'download_url': 'https://github.com/crmne/Genretron.git', 54 | 'author_email': ['carmine@paolino.me'], 55 | 'version': '1.0.0', 56 | 'install_requires': requirements(), 57 | 'packages': ['genretron'], 58 | # 'scripts': ['bin/train'], 59 | 'name': 'genretron', 60 | # 'test_suite': 'nose.collector', 61 | 'cmdclass': {'install': CustomInstall} 62 | } 63 | 64 | setup(**config) 65 | -------------------------------------------------------------------------------- /tests/test_audio_dataset_splits.py: -------------------------------------------------------------------------------- 1 | from genretron.audio_dataset import AudioDataset 2 | import numpy 3 | 4 | def setup(): 5 | global train, test, valid 6 | params = { 7 | 'path': '${PYLEARN2_DATA_PATH}/GTZAN', 8 | 'space': 'vector', 9 | 'seconds': 5.0, 10 | 'seed': 1234, 11 | 'balanced_splits': True, 12 | 'preprocessor': 'znormalizer', 13 | 'use_whole_song': True, 14 | 'print_params': False 15 | } 16 | params['which_set'] = 'train' 17 | train = AudioDataset(**params) 18 | train.process() 19 | del train.data_x, train.data_y 20 | 21 | params['which_set'] = 'test' 22 | test = AudioDataset(**params) 23 | test.process() 24 | del test.data_x, test.data_y 25 | 26 | params['which_set'] = 'valid' 27 | valid = AudioDataset(**params) 28 | valid.process() 29 | del valid.data_x, valid.data_y 30 | 31 | def test_tracks_dont_appear_twice_in_the_same_split(): 32 | for split in [train, test, valid]: 33 | yield check_tracks_dont_appear_twice_in_the_same_split, split 34 | 35 | def check_tracks_dont_appear_twice_in_the_same_split(split): 36 | assert numpy.all(numpy.unique(split.set_tracks) == numpy.sort(split.set_tracks)) 37 | 38 | def test_tracks_dont_appear_twice_in_different_splits(): 39 | all_tracks = numpy.sort(numpy.append(train.set_tracks, numpy.append(test.set_tracks, valid.set_tracks))) 40 | assert numpy.all(numpy.unique(all_tracks) == all_tracks) 41 | 42 | def test_indexes_dont_appear_twice_in_the_same_split(): 43 | for split in [train, test, valid]: 44 | yield check_indexes_dont_appear_twice_in_the_same_split, split 45 | 46 | def check_indexes_dont_appear_twice_in_the_same_split(split): 47 | assert numpy.all(numpy.unique(split.set_indexes) == numpy.sort(split.set_indexes)) 48 | 49 | def test_indexes_dont_appear_twice_in_different_splits(): 50 | all_indexes = numpy.sort(numpy.append(train.set_indexes, numpy.append(test.set_indexes, valid.set_indexes))) 51 | assert numpy.all(numpy.unique(all_indexes) == all_indexes) 52 | -------------------------------------------------------------------------------- /tests/test_audio_dataset_vectorspace.py: -------------------------------------------------------------------------------- 1 | from genretron.audio_dataset import AudioDataset 2 | import numpy 3 | 4 | def setup(): 5 | global dataset, data_x, data_y 6 | params = { 7 | 'path': '${PYLEARN2_DATA_PATH}/GTZAN', 8 | 'space': 'vector', 9 | 'seconds': 5.0, 10 | 'seed': 1234, 11 | 'balanced_splits': True, 12 | 'use_whole_song': True, 13 | 'print_params': False, 14 | 'which_set': 'valid' 15 | } 16 | dataset = AudioDataset(**params) 17 | dataset.set_tracks = dataset.get_track_ids(dataset.which_set) 18 | data_x, data_y = dataset.feature_extractors[dataset.feature](dataset.set_tracks) 19 | 20 | def test_x_to_vectorspace_should_return_data_in_right_order(): 21 | num_examples, column_size, row_size = data_x.shape 22 | first_column = [] 23 | for i in range(column_size): 24 | first_column.append(data_x[0][i][0]) 25 | first_column = numpy.array(first_column) 26 | reshaped = AudioDataset.x_to_vectorspace(data_x) 27 | assert numpy.all(reshaped[0] == first_column) 28 | 29 | def test_y_to_vectorspace_should_return_data_in_right_order(): 30 | pass 31 | --------------------------------------------------------------------------------