├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── bin ├── arpa_lm_to_dict_lm.py ├── arpa_lm_to_unigram_lm.py ├── check_all_fst_weights_are_zero.py ├── check_ext_deterministic.py ├── create_dict_lm_from_text.sh ├── create_lexicon.py ├── decoded_chars_to_words.py ├── explain_lm.py ├── kaldi2fuel.py ├── lm2fst.sh ├── make_subtree_branches.sh ├── print_yaml_conf.py ├── remove_fst_weights.py └── run.py ├── config ├── blocks.yaml └── theano.rc ├── env.sh ├── exp ├── README.md ├── timit │ ├── configs │ │ ├── iclr_reward.yaml │ │ ├── nips_baseline.yaml │ │ ├── nips_conv.yaml │ │ └── nips_smooth.yaml │ ├── read_phone60_transcripts.py │ └── write_hdf_dataset.sh └── wsj │ ├── README.md │ ├── add_bol.py │ ├── add_bos_to_parameters.py │ ├── configs │ ├── wsj_bhd10.bash │ ├── wsj_bhd11.bash │ ├── wsj_bhd11.yaml │ ├── wsj_bhd4.bash │ ├── wsj_bhd4.yaml │ ├── wsj_bhd5.bash │ ├── wsj_bhd5.yaml │ ├── wsj_bhd6.bash │ ├── wsj_bhd7.bash │ ├── wsj_bhd8.bash │ ├── wsj_bhd9.bash │ ├── wsj_bhd9.yaml │ ├── wsj_good.yaml │ ├── wsj_good_fbank.yaml │ ├── wsj_jan_baseline.yaml │ ├── wsj_jan_bhd01.bash │ ├── wsj_jan_bhd01.yaml │ ├── wsj_jan_bhd02.bash │ ├── wsj_jan_bhd02.yaml │ ├── wsj_jan_bhd03.bash │ ├── wsj_jan_bhd03.yaml │ ├── wsj_jan_bhd04.bash │ ├── wsj_jan_bhd04.yaml │ ├── wsj_jan_bhd05.bash │ ├── wsj_jan_bhd05.yaml │ ├── wsj_jan_debug.yaml │ ├── wsj_jan_new.yaml │ ├── wsj_jan_wsj11v2.yaml │ ├── wsj_jan_wsj13v2.yaml │ ├── wsj_jan_wsj14v2.yaml │ ├── wsj_jan_wsj15v2.yaml │ ├── wsj_jan_wsj16.yaml │ ├── wsj_jan_wsj17.yaml │ ├── wsj_jan_wsj18.yaml │ ├── wsj_jan_wsj19.yaml │ ├── wsj_paper.yaml │ ├── wsj_paper1.yaml │ ├── wsj_paper10.yaml │ ├── wsj_paper2.yaml │ ├── wsj_paper3.yaml │ ├── wsj_paper4.yaml │ ├── wsj_paper5.yaml │ ├── wsj_paper6.yaml │ ├── wsj_paper7.yaml │ ├── wsj_paper8.yaml │ ├── wsj_paper9.yaml │ ├── wsj_prior_conv.yaml │ ├── wsj_prior_conv_adadelta.yaml │ ├── wsj_pyramide.yaml │ ├── wsj_reward1.yaml │ ├── wsj_reward10.yaml │ ├── wsj_reward11.yaml │ ├── wsj_reward1f.yaml │ ├── wsj_reward2.yaml │ ├── wsj_reward3.yaml │ ├── wsj_reward4.yaml │ ├── wsj_reward5.yaml │ ├── wsj_reward6.yaml │ └── wsj_small.yaml │ ├── create_character_decoding_graph.sh │ ├── create_character_lexicon.sh │ ├── create_graph_form_text.sh │ ├── decode.sh │ ├── decode_and_score.sh │ ├── decode_tle.sh │ ├── extract_for_kaldi.sh │ ├── lm_4k0c030a │ ├── make_all_wsj_graphs.sh │ ├── score.sh │ └── write_hdf_dataset.sh ├── libs ├── Theano │ ├── .gitignore │ ├── .mailmap │ ├── .travis.yml │ ├── DESCRIPTION.txt │ ├── EMAIL.txt │ ├── HISTORY.txt │ ├── LICENSE.txt │ ├── MANIFEST.in │ ├── NEWS.txt │ ├── NEWS_DEV.txt │ ├── README.txt │ ├── Theano.pyproj │ ├── Theano.sln │ ├── benchmark │ │ ├── README │ │ ├── autoencoder │ │ │ ├── Makefile │ │ │ ├── aa.cc │ │ │ ├── aa.py │ │ │ └── aa_numpy.py │ │ ├── convolution │ │ │ ├── bench.sh │ │ │ ├── conv2d.py │ │ │ ├── opencv.py │ │ │ └── scipy_conv.py │ │ ├── numexpr │ │ │ └── gen_graph.py │ │ └── regression │ │ │ └── regression.py │ ├── bin │ │ ├── theano-cache │ │ ├── theano-nose │ │ └── theano-test │ ├── doc │ │ ├── .build │ │ │ └── PLACEHOLDER │ │ ├── .static │ │ │ └── PLACEHOLDER │ │ ├── .templates │ │ │ ├── PLACEHOLDER │ │ │ └── layout.html │ │ ├── LICENSE.txt │ │ ├── NEWS.txt │ │ ├── acknowledgement.txt │ │ ├── bcast.png │ │ ├── bcast.svg │ │ ├── cifarSC2011 │ │ │ ├── advanced_theano.txt │ │ │ ├── boot_camp_overview.txt │ │ │ ├── gpundarray.txt │ │ │ ├── index.txt │ │ │ ├── introduction.txt │ │ │ ├── pics │ │ │ │ ├── logreg_pydotprint_predict.png │ │ │ │ ├── logreg_pydotprint_prediction.png │ │ │ │ └── logreg_pydotprint_train.png │ │ │ ├── pyCUDA.txt │ │ │ └── theano.txt │ │ ├── citation.txt │ │ ├── conf.py │ │ ├── core_development_guide.txt │ │ ├── crei2013 │ │ │ ├── advanced_theano.txt │ │ │ ├── gpundarray.txt │ │ │ ├── ifelse_switch.py │ │ │ ├── index.txt │ │ │ ├── introduction.txt │ │ │ ├── logreg.py │ │ │ ├── logreg_profile.prof │ │ │ ├── pics │ │ │ │ ├── logreg_pydotprint_predict.png │ │ │ │ ├── logreg_pydotprint_prediction.png │ │ │ │ └── logreg_pydotprint_train.png │ │ │ ├── scan_poly.py │ │ │ ├── scan_pow.py │ │ │ └── theano.txt │ │ ├── dev_start_guide.txt │ │ ├── developer │ │ │ ├── compat.txt │ │ │ ├── index.txt │ │ │ ├── scan.txt │ │ │ └── tensor.txt │ │ ├── extending │ │ │ ├── apply.png │ │ │ ├── apply.svg │ │ │ ├── apply2.svg │ │ │ ├── cop.txt │ │ │ ├── ctype.txt │ │ │ ├── extending_faq.txt │ │ │ ├── extending_theano.txt │ │ │ ├── extending_theano_c.txt │ │ │ ├── extending_theano_solution_1.py │ │ │ ├── fibby.txt │ │ │ ├── graphstructures.txt │ │ │ ├── index.txt │ │ │ ├── inplace.txt │ │ │ ├── op.txt │ │ │ ├── optimization.txt │ │ │ ├── other_ops.txt │ │ │ ├── pics │ │ │ │ ├── symbolic_graph_opt.png │ │ │ │ └── symbolic_graph_unopt.png │ │ │ ├── pipeline.txt │ │ │ ├── theano_vs_c.txt │ │ │ ├── tips.txt │ │ │ ├── type.txt │ │ │ ├── unittest.txt │ │ │ └── using_params.txt │ │ ├── faq.txt │ │ ├── generate_dtype_tensor_table.py │ │ ├── glossary.txt │ │ ├── hpcs2011_tutorial │ │ │ ├── Makefile │ │ │ ├── double_op.py │ │ │ ├── logreg_example.py │ │ │ ├── pics │ │ │ │ ├── CPU_VS_GPU.png │ │ │ │ ├── Caffeine_Machine_no_background_red.png │ │ │ │ ├── UdeM_NoirBleu_logo_Marie_crop.pdf │ │ │ │ ├── apply_node.odg │ │ │ │ ├── apply_node.pdf │ │ │ │ ├── apply_node.png │ │ │ │ ├── bloc_repartition.png │ │ │ │ ├── conv.pdf │ │ │ │ ├── conv.png │ │ │ │ ├── f_optimized.png │ │ │ │ ├── f_unoptimized.png │ │ │ │ ├── grid_block_thread.png │ │ │ │ ├── lisabook_logo_text_3.png │ │ │ │ ├── logreg_pydotprint_predic.png │ │ │ │ ├── logreg_pydotprint_prediction.png │ │ │ │ ├── logreg_pydotprint_train.png │ │ │ │ ├── mlp.pdf │ │ │ │ ├── mlp.png │ │ │ │ ├── multiple_graph.pdf │ │ │ │ ├── multiple_graph.png │ │ │ │ ├── pipeline.odg │ │ │ │ ├── pipeline.pdf │ │ │ │ ├── pipeline.png │ │ │ │ ├── pycuda-logo-crop.pdf │ │ │ │ └── theano_logo.png │ │ │ ├── presentation.tex │ │ │ ├── pycuda_double_op.py │ │ │ ├── pycuda_simple.py │ │ │ ├── scan_poly.py │ │ │ ├── scan_pow.py │ │ │ └── simple_example.py │ │ ├── images │ │ │ ├── Elman_srnn.png │ │ │ ├── blocksparse.png │ │ │ ├── lstm.png │ │ │ ├── lstm_memorycell.png │ │ │ ├── snake_theta2.png │ │ │ ├── talk2010.gif │ │ │ ├── talk2010.png │ │ │ ├── theano-theta-117x117.png │ │ │ ├── theano_bw_parens_transparent.png │ │ │ ├── theano_logo-200x67.png │ │ │ ├── theano_logo.png │ │ │ ├── theano_logo_allblue.svg │ │ │ ├── theano_logo_allblue_200x46.png │ │ │ ├── theano_logo_allblue_200x54.png │ │ │ ├── theano_logo_allblue_350x95.png │ │ │ └── theano_logo_allblue_63x21.png │ │ ├── index.txt │ │ ├── install.txt │ │ ├── install_centos6.txt │ │ ├── install_ubuntu.txt │ │ ├── install_windows.txt │ │ ├── internal │ │ │ ├── dev_start_guide.txt │ │ │ ├── how_to_release.txt │ │ │ ├── index.txt │ │ │ ├── metadocumentation.txt │ │ │ ├── python.txt │ │ │ └── release.txt │ │ ├── introduction.txt │ │ ├── library │ │ │ ├── compile │ │ │ │ ├── debugmode.txt │ │ │ │ ├── function.txt │ │ │ │ ├── index.txt │ │ │ │ ├── io.txt │ │ │ │ ├── mode.txt │ │ │ │ ├── nanguardmode.txt │ │ │ │ ├── opfromgraph.txt │ │ │ │ ├── ops.txt │ │ │ │ ├── profilemode.txt │ │ │ │ └── shared.txt │ │ │ ├── config.txt │ │ │ ├── d3viz │ │ │ │ ├── examples │ │ │ │ │ ├── d3viz │ │ │ │ │ │ ├── css │ │ │ │ │ │ │ ├── d3-context-menu.css │ │ │ │ │ │ │ └── d3viz.css │ │ │ │ │ │ └── js │ │ │ │ │ │ │ ├── d3-context-menu.js │ │ │ │ │ │ │ ├── d3.v3.min.js │ │ │ │ │ │ │ ├── d3viz.js │ │ │ │ │ │ │ ├── dagre-d3.min.js │ │ │ │ │ │ │ └── graphlib-dot.min.js │ │ │ │ │ ├── mlp.html │ │ │ │ │ ├── mlp.png │ │ │ │ │ ├── mlp2.html │ │ │ │ │ ├── mlp2.pdf │ │ │ │ │ ├── mlp2.png │ │ │ │ │ ├── ofg.html │ │ │ │ │ └── ofg2.html │ │ │ │ ├── index.ipynb │ │ │ │ ├── index.txt │ │ │ │ └── index_files │ │ │ │ │ ├── index_10_0.png │ │ │ │ │ ├── index_11_0.png │ │ │ │ │ ├── index_24_0.png │ │ │ │ │ └── index_25_0.png │ │ │ ├── gof │ │ │ │ ├── fgraph.txt │ │ │ │ ├── graph.txt │ │ │ │ ├── index.txt │ │ │ │ ├── toolbox.txt │ │ │ │ ├── type.txt │ │ │ │ └── utils.txt │ │ │ ├── gradient.txt │ │ │ ├── index.txt │ │ │ ├── misc │ │ │ │ └── pkl_utils.txt │ │ │ ├── printing.txt │ │ │ ├── sandbox │ │ │ │ ├── cuda │ │ │ │ │ ├── dnn.txt │ │ │ │ │ ├── index.txt │ │ │ │ │ ├── op.txt │ │ │ │ │ ├── type.txt │ │ │ │ │ └── var.txt │ │ │ │ ├── gpuarray │ │ │ │ │ ├── dnn.txt │ │ │ │ │ ├── extra.txt │ │ │ │ │ ├── index.txt │ │ │ │ │ ├── op.txt │ │ │ │ │ └── type.txt │ │ │ │ ├── index.txt │ │ │ │ ├── linalg.txt │ │ │ │ ├── neighbours.txt │ │ │ │ └── rng_mrg.txt │ │ │ ├── scalar │ │ │ │ └── index.txt │ │ │ ├── scan.txt │ │ │ ├── sparse │ │ │ │ ├── index.txt │ │ │ │ └── sandbox.txt │ │ │ ├── tensor │ │ │ │ ├── basic.txt │ │ │ │ ├── bcast.png │ │ │ │ ├── bcast.svg │ │ │ │ ├── extra_ops.txt │ │ │ │ ├── index.txt │ │ │ │ ├── io.txt │ │ │ │ ├── nlinalg.txt │ │ │ │ ├── nnet │ │ │ │ │ ├── blocksparse.txt │ │ │ │ │ ├── bn.txt │ │ │ │ │ ├── conv.txt │ │ │ │ │ ├── index.txt │ │ │ │ │ ├── neighbours.txt │ │ │ │ │ ├── nnet.txt │ │ │ │ │ └── sigmoid_prec.png │ │ │ │ ├── opt.txt │ │ │ │ ├── raw_random.txt │ │ │ │ ├── shared_randomstreams.txt │ │ │ │ ├── signal │ │ │ │ │ ├── conv.txt │ │ │ │ │ ├── downsample.txt │ │ │ │ │ └── index.txt │ │ │ │ ├── slinalg.txt │ │ │ │ └── utils.txt │ │ │ └── typed_list.txt │ │ ├── links.txt │ │ ├── nextml2015 │ │ │ ├── Makefile │ │ │ ├── presentation.tex │ │ │ └── theano_grad.png │ │ ├── nice_quotes.txt │ │ ├── omlw2014 │ │ │ ├── Makefile │ │ │ ├── logreg.py │ │ │ ├── omlw_presentation.pdf │ │ │ ├── pr_conv_gemm_profile.png │ │ │ ├── presentation.tex │ │ │ ├── road-runner-1.jpg │ │ │ └── sharing.tex │ │ ├── optimizations.txt │ │ ├── proposals │ │ │ ├── complex_gradient.txt │ │ │ ├── conditional.txt │ │ │ ├── dp_optimization.txt │ │ │ ├── graphical_models.txt │ │ │ ├── index.txt │ │ │ ├── intermediate_language.txt │ │ │ ├── mongodb_cache.txt │ │ │ ├── opt_patterns2.txt │ │ │ ├── pfunc.txt │ │ │ ├── premerge.txt │ │ │ └── tensor_attributes.txt │ │ ├── pylintrc │ │ ├── sandbox │ │ │ ├── broadcasting.txt │ │ │ ├── ccodegen.txt │ │ │ ├── compilation.txt │ │ │ ├── debugging_with_stepmode.txt │ │ │ ├── elemwise_compiler.txt │ │ │ ├── fg.txt │ │ │ ├── function.txt │ │ │ ├── functional.txt │ │ │ ├── hosting.txt │ │ │ ├── how_to_make_ops.txt │ │ │ ├── index.txt │ │ │ ├── index2.txt │ │ │ ├── interactive_debugger.txt │ │ │ ├── logistic_regression_example.txt │ │ │ ├── max_gotcha.txt │ │ │ ├── performance.txt │ │ │ ├── randomnumbers.txt │ │ │ ├── rethinkccodegen.txt │ │ │ ├── sandbox.txt │ │ │ ├── software.txt │ │ │ ├── sparse.txt │ │ │ └── tensoroptools.txt │ │ ├── scripts │ │ │ └── docgen.py │ │ ├── theano_installer_for_anaconda.bat │ │ └── tutorial │ │ │ ├── adding.txt │ │ │ ├── adding_solution_1.py │ │ │ ├── aliasing.txt │ │ │ ├── apply.png │ │ │ ├── apply.svg │ │ │ ├── conditions.txt │ │ │ ├── debug_faq.txt │ │ │ ├── dlogistic.png │ │ │ ├── examples.txt │ │ │ ├── extending_theano.txt │ │ │ ├── extending_theano_c.txt │ │ │ ├── faq_tutorial.txt │ │ │ ├── gpu_data_convert.txt │ │ │ ├── gradients.txt │ │ │ ├── index.txt │ │ │ ├── loading_and_saving.txt │ │ │ ├── logistic.gp │ │ │ ├── logistic.png │ │ │ ├── loop.txt │ │ │ ├── loop_solution_1.py │ │ │ ├── modes.txt │ │ │ ├── modes_solution_1.py │ │ │ ├── multi_cores.txt │ │ │ ├── nan_tutorial.txt │ │ │ ├── numpy.txt │ │ │ ├── pics │ │ │ ├── d3viz.png │ │ │ ├── logreg_pydotprint_predict.png │ │ │ ├── logreg_pydotprint_prediction.png │ │ │ └── logreg_pydotprint_train.png │ │ │ ├── printing_drawing.txt │ │ │ ├── profiling.txt │ │ │ ├── profiling_example.py │ │ │ ├── profiling_example_out.prof │ │ │ ├── python-memory-management.txt │ │ │ ├── python.txt │ │ │ ├── shape_info.txt │ │ │ ├── sparse.txt │ │ │ ├── symbolic_graphs.txt │ │ │ ├── using_gpu.txt │ │ │ ├── using_gpu_solution_1.py │ │ │ └── using_multi_gpu.txt │ ├── requirement-rtd.txt │ ├── setup.cfg │ ├── setup.py │ └── theano │ │ ├── __init__.py │ │ ├── compat │ │ ├── __init__.py │ │ ├── python2x.py │ │ └── six.py │ │ ├── compile │ │ ├── __init__.py │ │ ├── builders.py │ │ ├── debugmode.py │ │ ├── function.py │ │ ├── function_module.py │ │ ├── io.py │ │ ├── mode.py │ │ ├── monitormode.py │ │ ├── nanguardmode.py │ │ ├── ops.py │ │ ├── pfunc.py │ │ ├── profilemode.py │ │ ├── profiling.py │ │ ├── sandbox │ │ │ └── __init__.py │ │ ├── sharedvalue.py │ │ └── tests │ │ │ ├── __init__.py │ │ │ ├── test_builders.py │ │ │ ├── test_debugmode.py │ │ │ ├── test_function.py │ │ │ ├── test_function_module.py │ │ │ ├── test_function_name.py │ │ │ ├── test_misc.py │ │ │ ├── test_mode.py │ │ │ ├── test_modes.py │ │ │ ├── test_monitormode.py │ │ │ ├── test_nanguardmode.py │ │ │ ├── test_ops.py │ │ │ ├── test_pfunc.py │ │ │ ├── test_profiling.py │ │ │ └── test_shared.py │ │ ├── configdefaults.py │ │ ├── configparser.py │ │ ├── d3viz │ │ ├── __init__.py │ │ ├── css │ │ │ ├── d3-context-menu.css │ │ │ └── d3viz.css │ │ ├── d3viz.py │ │ ├── formatting.py │ │ ├── html │ │ │ └── template.html │ │ ├── js │ │ │ ├── d3-context-menu.js │ │ │ ├── d3.v3.min.js │ │ │ ├── d3viz.js │ │ │ ├── dagre-d3.min.js │ │ │ └── graphlib-dot.min.js │ │ └── tests │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── test_d3viz.py │ │ │ └── test_formatting.py │ │ ├── gof │ │ ├── __init__.py │ │ ├── callcache.py │ │ ├── cc.py │ │ ├── cmodule.py │ │ ├── compiledir.py │ │ ├── compilelock.py │ │ ├── cutils.py │ │ ├── destroyhandler.py │ │ ├── fg.py │ │ ├── graph.py │ │ ├── lazylinker_c.c │ │ ├── lazylinker_c.py │ │ ├── link.py │ │ ├── null_type.py │ │ ├── op.py │ │ ├── opt.py │ │ ├── optdb.py │ │ ├── sandbox │ │ │ ├── equilibrium.py │ │ │ └── typeattr.txt │ │ ├── sched.py │ │ ├── tests │ │ │ ├── __init__.py │ │ │ ├── test_cc.py │ │ │ ├── test_cmodule.py │ │ │ ├── test_compiledir.py │ │ │ ├── test_compute_test_value.py │ │ │ ├── test_destroyhandler.py │ │ │ ├── test_fg.py │ │ │ ├── test_fg_old_crash.pkl │ │ │ ├── test_graph.py │ │ │ ├── test_graph_opt_caching.py │ │ │ ├── test_lazy.py │ │ │ ├── test_link.py │ │ │ ├── test_op.py │ │ │ ├── test_opt.py │ │ │ ├── test_optdb.py │ │ │ ├── test_sched.py │ │ │ ├── test_toolbox.py │ │ │ ├── test_types.py │ │ │ ├── test_utils.py │ │ │ └── test_vm.py │ │ ├── theano_mod_helper.h │ │ ├── toolbox.py │ │ ├── type.py │ │ ├── unify.py │ │ ├── utils.py │ │ └── vm.py │ │ ├── gradient.py │ │ ├── ifelse.py │ │ ├── misc │ │ ├── __init__.py │ │ ├── buildbot_filter.py │ │ ├── check_blas.py │ │ ├── check_blas_many.sh │ │ ├── check_duplicate_key.py │ │ ├── check_multi_gpu.py │ │ ├── cpucount.py │ │ ├── cudamat_utils.py │ │ ├── do_nightly_build │ │ ├── do_nightly_build_send │ │ ├── doubleop.py │ │ ├── elemwise_openmp_speedup.py │ │ ├── elemwise_time_test.py │ │ ├── gh_api.py │ │ ├── gnumpy_utils.py │ │ ├── hooks │ │ │ ├── check_whitespace.py │ │ │ └── reindent.py │ │ ├── latence_gpu_transfert.py │ │ ├── may_share_memory.py │ │ ├── ordered_set.py │ │ ├── pkl_utils.py │ │ ├── pycuda_example.py │ │ ├── pycuda_init.py │ │ ├── pycuda_utils.py │ │ ├── safe_asarray.py │ │ ├── strutil.py │ │ ├── tests │ │ │ ├── __init__.py │ │ │ ├── test_cudamat_utils.py │ │ │ ├── test_gnumpy_utils.py │ │ │ ├── test_may_share_memory.py │ │ │ ├── test_pkl_utils.py │ │ │ ├── test_pycuda_example.py │ │ │ ├── test_pycuda_theano_simple.py │ │ │ └── test_pycuda_utils.py │ │ └── windows.py │ │ ├── printing.py │ │ ├── raise_op.py │ │ ├── sandbox │ │ ├── __init__.py │ │ ├── blocksparse.py │ │ ├── conv.py │ │ ├── cuda │ │ │ ├── GpuConv3D.py │ │ │ ├── GpuConvGrad3D.py │ │ │ ├── GpuConvTransp3D.py │ │ │ ├── __init__.py │ │ │ ├── basic_ops.py │ │ │ ├── blas.py │ │ │ ├── blocksparse.py │ │ │ ├── cnmem.cpp │ │ │ ├── cnmem.h │ │ │ ├── conv.cu │ │ │ ├── conv_full_kernel.cu │ │ │ ├── conv_kernel.cu │ │ │ ├── corr3d_gemm.cu │ │ │ ├── corr_gemm.cu │ │ │ ├── cuda_ndarray.cu │ │ │ ├── cuda_ndarray.cuh │ │ │ ├── cudnn_helper.h │ │ │ ├── cula.py │ │ │ ├── dnn.py │ │ │ ├── dnn_base.c │ │ │ ├── dnn_conv_base.c │ │ │ ├── dnn_fwd.c │ │ │ ├── dnn_gi.c │ │ │ ├── dnn_gw.c │ │ │ ├── elemwise.py │ │ │ ├── extra_ops.py │ │ │ ├── fftconv.py │ │ │ ├── kernel_codegen.py │ │ │ ├── neighbours.py │ │ │ ├── nnet.py │ │ │ ├── nvcc_compiler.py │ │ │ ├── opt.py │ │ │ ├── opt_util.py │ │ │ ├── rng_curand.py │ │ │ ├── tests │ │ │ │ ├── CudaNdarray.pkl │ │ │ │ ├── __init__.py │ │ │ │ ├── old_pool_interface.pkl │ │ │ │ ├── test_abstractconv.py │ │ │ │ ├── test_basic_ops.py │ │ │ │ ├── test_bench_loopfusion.py │ │ │ │ ├── test_blas.py │ │ │ │ ├── test_blocksparse.py │ │ │ │ ├── test_conv_cuda_ndarray.py │ │ │ │ ├── test_cuda_ndarray.py │ │ │ │ ├── test_cula.py │ │ │ │ ├── test_dnn.py │ │ │ │ ├── test_driver.py │ │ │ │ ├── test_extra_ops.py │ │ │ │ ├── test_fftconv.py │ │ │ │ ├── test_gemmcorr3d.py │ │ │ │ ├── test_gradient.py │ │ │ │ ├── test_memory.py │ │ │ │ ├── test_mlp.py │ │ │ │ ├── test_neighbours.py │ │ │ │ ├── test_nnet.py │ │ │ │ ├── test_opt.py │ │ │ │ ├── test_rng_curand.py │ │ │ │ ├── test_tensor_op.py │ │ │ │ ├── test_type.py │ │ │ │ ├── test_var.py │ │ │ │ ├── test_viewop.py │ │ │ │ └── walltime.py │ │ │ ├── type.py │ │ │ └── var.py │ │ ├── debug.py │ │ ├── fourier.py │ │ ├── gpuarray │ │ │ ├── __init__.py │ │ │ ├── basic_ops.py │ │ │ ├── blas.py │ │ │ ├── comp.py │ │ │ ├── conv_desc.c │ │ │ ├── cudnn_helper.h │ │ │ ├── dnn.py │ │ │ ├── dnn_base.c │ │ │ ├── dnn_conv_base.c │ │ │ ├── dnn_fwd.c │ │ │ ├── dnn_gi.c │ │ │ ├── dnn_gw.c │ │ │ ├── dnn_pool.c │ │ │ ├── dnn_pool_grad.c │ │ │ ├── dnn_softmax.c │ │ │ ├── dnn_softmax_grad.c │ │ │ ├── elemwise.py │ │ │ ├── fp16_help.py │ │ │ ├── gemm16.c │ │ │ ├── gpuarray_helper.h │ │ │ ├── kernel_codegen.py │ │ │ ├── neighbours.py │ │ │ ├── nerv.py │ │ │ ├── nnet.py │ │ │ ├── opt.py │ │ │ ├── opt_util.py │ │ │ ├── subtensor.py │ │ │ ├── tests │ │ │ │ ├── GpuArray.pkl │ │ │ │ ├── __init__.py │ │ │ │ ├── config.py │ │ │ │ ├── test_abstractconv.py │ │ │ │ ├── test_basic_ops.py │ │ │ │ ├── test_blas.py │ │ │ │ ├── test_dnn.py │ │ │ │ ├── test_elemwise.py │ │ │ │ ├── test_neighbours.py │ │ │ │ ├── test_nerv.py │ │ │ │ ├── test_nnet.py │ │ │ │ ├── test_opt.py │ │ │ │ ├── test_pickle.py │ │ │ │ ├── test_scan.py │ │ │ │ ├── test_subtensor.py │ │ │ │ └── test_type.py │ │ │ └── type.py │ │ ├── linalg │ │ │ ├── __init__.py │ │ │ ├── ops.py │ │ │ └── tests │ │ │ │ ├── __init__.py │ │ │ │ └── test_linalg.py │ │ ├── minimal.py │ │ ├── multinomial.py │ │ ├── neighbourhoods.py │ │ ├── neighbours.py │ │ ├── rng_mrg.py │ │ ├── samples_MRG31k3p_12_7_5.txt │ │ ├── softsign.py │ │ ├── solve.py │ │ └── tests │ │ │ ├── __init__.py │ │ │ ├── multinomial_test_graph.pkl │ │ │ ├── test_multinomial.py │ │ │ ├── test_multinomial_wo_replacement.py │ │ │ ├── test_neighbourhoods.py │ │ │ └── test_rng_mrg.py │ │ ├── scalar │ │ ├── __init__.py │ │ ├── basic.py │ │ ├── basic_scipy.py │ │ ├── basic_sympy.py │ │ ├── sharedvar.py │ │ └── tests │ │ │ ├── __init__.py │ │ │ ├── test_basic.py │ │ │ └── test_basic_sympy.py │ │ ├── scan_module │ │ ├── __init__.py │ │ ├── numpy_api_changes.diff │ │ ├── scan.py │ │ ├── scan_op.py │ │ ├── scan_opt.py │ │ ├── scan_perform.c │ │ ├── scan_perform.pyx │ │ ├── scan_perform_ext.py │ │ ├── scan_utils.py │ │ ├── scan_views.py │ │ └── tests │ │ │ ├── __init__.py │ │ │ ├── inconsistent_scan.pkl │ │ │ ├── test_scan.py │ │ │ ├── test_scan_opt.py │ │ │ └── test_scan_utils.py │ │ ├── sparse │ │ ├── __init__.py │ │ ├── basic.py │ │ ├── opt.py │ │ ├── sandbox │ │ │ ├── __init__.py │ │ │ ├── sp.py │ │ │ ├── sp2.py │ │ │ ├── test_sp.py │ │ │ └── truedot.py │ │ ├── sharedvar.py │ │ ├── tests │ │ │ ├── __init__.py │ │ │ ├── test_basic.py │ │ │ ├── test_opt.py │ │ │ ├── test_sp2.py │ │ │ ├── test_type.py │ │ │ └── test_utils.py │ │ ├── type.py │ │ └── utils.py │ │ ├── tensor │ │ ├── __init__.py │ │ ├── basic.py │ │ ├── blas.py │ │ ├── blas_c.py │ │ ├── blas_headers.py │ │ ├── blas_scipy.py │ │ ├── elemwise.py │ │ ├── elemwise_cgen.py │ │ ├── extra_ops.py │ │ ├── fourier.py │ │ ├── inplace.py │ │ ├── io.py │ │ ├── nlinalg.py │ │ ├── nnet │ │ │ ├── Conv3D.py │ │ │ ├── ConvGrad3D.py │ │ │ ├── ConvTransp3D.py │ │ │ ├── __init__.py │ │ │ ├── abstract_conv.py │ │ │ ├── blocksparse.py │ │ │ ├── bn.py │ │ │ ├── conv.py │ │ │ ├── conv3d2d.py │ │ │ ├── corr.py │ │ │ ├── corr_gemm.c │ │ │ ├── neighbours.py │ │ │ ├── nnet.py │ │ │ ├── opt.py │ │ │ ├── sigm.py │ │ │ └── tests │ │ │ │ ├── __init__.py │ │ │ │ ├── speed_test_conv.py │ │ │ │ ├── test_abstract_conv.py │ │ │ │ ├── test_blocksparse.py │ │ │ │ ├── test_bn.py │ │ │ │ ├── test_conv.py │ │ │ │ ├── test_conv3d.py │ │ │ │ ├── test_conv3d2d.py │ │ │ │ ├── test_corr.py │ │ │ │ ├── test_neighbours.py │ │ │ │ ├── test_nnet.py │ │ │ │ ├── test_opt.py │ │ │ │ └── test_sigm.py │ │ ├── opt.py │ │ ├── opt_uncanonicalize.py │ │ ├── raw_random.py │ │ ├── shared_randomstreams.py │ │ ├── sharedvar.py │ │ ├── signal │ │ │ ├── __init__.py │ │ │ ├── conv.py │ │ │ ├── downsample.py │ │ │ ├── pool.py │ │ │ └── tests │ │ │ │ ├── __init__.py │ │ │ │ ├── test_conv.py │ │ │ │ └── test_pool.py │ │ ├── slinalg.py │ │ ├── sort.py │ │ ├── subtensor.py │ │ ├── tests │ │ │ ├── __init__.py │ │ │ ├── _test_mpi_roundtrip.py │ │ │ ├── mlp_test.py │ │ │ ├── shape_opt_cycle.pkl │ │ │ ├── test_basic.py │ │ │ ├── test_blas.py │ │ │ ├── test_blas_c.py │ │ │ ├── test_blas_scipy.py │ │ │ ├── test_casting.py │ │ │ ├── test_complex.py │ │ │ ├── test_elemwise.py │ │ │ ├── test_extra_ops.py │ │ │ ├── test_fourier.py │ │ │ ├── test_gc.py │ │ │ ├── test_inc_subtensor.py │ │ │ ├── test_io.py │ │ │ ├── test_keepdims.py │ │ │ ├── test_merge.py │ │ │ ├── test_misc.py │ │ │ ├── test_mpi.py │ │ │ ├── test_nlinalg.py │ │ │ ├── test_opt.py │ │ │ ├── test_opt_uncanonicalize.py │ │ │ ├── test_raw_random.py │ │ │ ├── test_shared_randomstreams.py │ │ │ ├── test_sharedvar.py │ │ │ ├── test_slinalg.py │ │ │ ├── test_sort.py │ │ │ ├── test_subtensor.py │ │ │ ├── test_type_other.py │ │ │ ├── test_utils.py │ │ │ ├── test_var.py │ │ │ └── test_xlogx.py │ │ ├── type.py │ │ ├── type_other.py │ │ ├── utils.py │ │ ├── var.py │ │ └── xlogx.py │ │ ├── tests │ │ ├── __init__.py │ │ ├── breakpoint.py │ │ ├── disturb_mem.py │ │ ├── diverse_tests.py │ │ ├── main.py │ │ ├── record.py │ │ ├── run_tests_in_batch.py │ │ ├── test_2nd_order_grads.py │ │ ├── test_breakpoint.py │ │ ├── test_config.py │ │ ├── test_determinism.py │ │ ├── test_dictionary_output.py │ │ ├── test_flake8.py │ │ ├── test_gradient.py │ │ ├── test_ifelse.py │ │ ├── test_pickle_unpickle_theano_fn.py │ │ ├── test_printing.py │ │ ├── test_record.py │ │ ├── test_rop.py │ │ ├── test_updates.py │ │ └── unittest_tools.py │ │ ├── typed_list │ │ ├── __init__.py │ │ ├── basic.py │ │ ├── opt.py │ │ ├── tests │ │ │ ├── __init__.py │ │ │ ├── test_basic.py │ │ │ ├── test_opt.py │ │ │ └── test_type.py │ │ └── type.py │ │ ├── updates.py │ │ └── version.py ├── blocks-extras │ ├── .gitignore │ ├── .scrutinizer.yml │ ├── .travis.yml │ ├── LICENSE │ ├── README.rst │ ├── bin │ │ ├── blocks-controller │ │ └── blocks-plot │ ├── blocks_extras │ │ ├── __init__.py │ │ ├── algorithms │ │ │ └── __init__.py │ │ ├── bricks │ │ │ ├── __init__.py │ │ │ └── attention.py │ │ ├── extensions │ │ │ ├── __init__.py │ │ │ ├── embed_ipython.py │ │ │ ├── plot.py │ │ │ └── synchronization.py │ │ ├── initialization.py │ │ ├── scripts │ │ │ ├── __init__.py │ │ │ └── plot.py │ │ └── utils.py │ ├── req-scrutinizer.txt │ ├── req-travis-conda.txt │ ├── setup.py │ └── tests │ │ ├── __init__.py │ │ ├── extensions │ │ ├── __init__.py │ │ └── test_plot.py │ │ ├── scripts │ │ ├── __init__.py │ │ └── test_plot.py │ │ ├── test_algorithms.py │ │ ├── test_bricks.py │ │ └── test_initialization.py ├── blocks │ ├── .gitignore │ ├── .scrutinizer.yml │ ├── .travis.yml │ ├── CONTRIBUTING.rst │ ├── LICENSE │ ├── README.rst │ ├── bin │ │ └── blocks-continue │ ├── blocks │ │ ├── __init__.py │ │ ├── algorithms │ │ │ └── __init__.py │ │ ├── bricks │ │ │ ├── __init__.py │ │ │ ├── attention.py │ │ │ ├── base.py │ │ │ ├── bn.py │ │ │ ├── conv.py │ │ │ ├── cost.py │ │ │ ├── interfaces.py │ │ │ ├── lookup.py │ │ │ ├── parallel.py │ │ │ ├── recurrent.py │ │ │ ├── sequence_generators.py │ │ │ ├── sequences.py │ │ │ ├── simple.py │ │ │ └── wrappers.py │ │ ├── config.py │ │ ├── extensions │ │ │ ├── __init__.py │ │ │ ├── monitoring.py │ │ │ ├── predicates.py │ │ │ ├── saveload.py │ │ │ ├── stopping.py │ │ │ └── training.py │ │ ├── filter.py │ │ ├── graph │ │ │ ├── __init__.py │ │ │ ├── annotations.py │ │ │ └── bn.py │ │ ├── initialization.py │ │ ├── log │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ └── sqlite.py │ │ ├── main_loop.py │ │ ├── model.py │ │ ├── monitoring │ │ │ ├── __init__.py │ │ │ ├── aggregation.py │ │ │ └── evaluators.py │ │ ├── roles.py │ │ ├── scripts │ │ │ └── __init__.py │ │ ├── search.py │ │ ├── select.py │ │ ├── serialization.py │ │ ├── theano_expressions.py │ │ ├── utils │ │ │ ├── __init__.py │ │ │ ├── containers.py │ │ │ ├── profile.py │ │ │ └── testing.py │ │ └── version.py │ ├── docs │ │ ├── _static │ │ │ ├── code_quality.png │ │ │ ├── mnist.png │ │ │ ├── plot_a.png │ │ │ ├── plot_cost.png │ │ │ ├── sequence_generator_scheme.png │ │ │ └── sequence_generator_scheme.svg │ │ ├── api │ │ │ ├── algorithms.rst │ │ │ ├── bricks.rst │ │ │ ├── extensions.rst │ │ │ ├── filter.rst │ │ │ ├── graph.rst │ │ │ ├── index.rst │ │ │ ├── initialization.rst │ │ │ ├── log.rst │ │ │ ├── main_loop.rst │ │ │ ├── model.rst │ │ │ ├── roles.rst │ │ │ ├── select.rst │ │ │ ├── serialization.rst │ │ │ ├── theano_expressions.rst │ │ │ └── utils.rst │ │ ├── bricks_overview.rst │ │ ├── cg.rst │ │ ├── conf.py │ │ ├── configuration.rst │ │ ├── create_your_own_brick.rst │ │ ├── development │ │ │ ├── docs.rst │ │ │ ├── index.rst │ │ │ ├── internal_api.rst │ │ │ └── pull_request.rst │ │ ├── index.rst │ │ ├── plotting.rst │ │ ├── rnn.rst │ │ ├── serialization.rst │ │ ├── setup.rst │ │ └── tutorial.rst │ ├── doctests │ │ └── __init__.py │ ├── req-rtd.txt │ ├── req-scrutinizer.txt │ ├── req-travis-conda.txt │ ├── req-travis-pip.txt │ ├── requirements.txt │ ├── setup.py │ └── tests │ │ ├── __init__.py │ │ ├── algorithms │ │ ├── __init__.py │ │ └── test_algorithms.py │ │ ├── bricks │ │ ├── __init__.py │ │ ├── test_attention.py │ │ ├── test_bn.py │ │ ├── test_bricks.py │ │ ├── test_conv.py │ │ ├── test_cost.py │ │ ├── test_interfaces.py │ │ ├── test_lookup.py │ │ ├── test_recurrent.py │ │ ├── test_sequence_generators.py │ │ └── test_wrappers.py │ │ ├── extensions │ │ ├── __init__.py │ │ ├── test_extensions.py │ │ ├── test_monitoring.py │ │ ├── test_progressbar.py │ │ ├── test_saveload.py │ │ ├── test_stopping.py │ │ ├── test_timing.py │ │ └── test_training.py │ │ ├── graph │ │ └── test_bn.py │ │ ├── monitoring │ │ ├── __init__.py │ │ ├── test_aggregation.py │ │ ├── test_evaluators.py │ │ └── test_monitored_quantity.py │ │ ├── test_config.py │ │ ├── test_graph.py │ │ ├── test_initialization.py │ │ ├── test_log.py │ │ ├── test_main_loop.py │ │ ├── test_model.py │ │ ├── test_roles.py │ │ ├── test_search.py │ │ ├── test_select.py │ │ ├── test_serialization.py │ │ ├── test_theano_expressions.py │ │ ├── test_variable_filter.py │ │ └── utils │ │ ├── __init__.py │ │ ├── test_containers.py │ │ └── test_utils.py └── fuel │ ├── .coveragerc │ ├── .gitignore │ ├── .scrutinizer.yml │ ├── .travis-data.sh │ ├── .travis.yml │ ├── LICENSE │ ├── README.rst │ ├── docs │ ├── api │ │ ├── converters.rst │ │ ├── data_streams.rst │ │ ├── dataset.rst │ │ ├── downloaders.rst │ │ ├── index.rst │ │ ├── iteration_schemes.rst │ │ └── transformers.rst │ ├── built_in_datasets.rst │ ├── conf.py │ ├── extending_fuel.rst │ ├── h5py_dataset.rst │ ├── index.rst │ ├── new_dataset.rst │ ├── overview.rst │ └── setup.rst │ ├── doctests │ └── __init__.py │ ├── fuel │ ├── __init__.py │ ├── bin │ │ ├── __init__.py │ │ ├── fuel_convert.py │ │ ├── fuel_download.py │ │ └── fuel_info.py │ ├── config_parser.py │ ├── converters │ │ ├── __init__.py │ │ ├── adult.py │ │ ├── base.py │ │ ├── binarized_mnist.py │ │ ├── caltech101_silhouettes.py │ │ ├── cifar10.py │ │ ├── cifar100.py │ │ ├── ilsvrc2010.py │ │ ├── iris.py │ │ ├── mnist.py │ │ └── svhn.py │ ├── datasets │ │ ├── __init__.py │ │ ├── adult.py │ │ ├── base.py │ │ ├── billion.py │ │ ├── binarized_mnist.py │ │ ├── caltech101_silhouettes.py │ │ ├── cifar10.py │ │ ├── cifar100.py │ │ ├── hdf5.py │ │ ├── imagenet.py │ │ ├── iris.py │ │ ├── mnist.py │ │ ├── svhn.py │ │ ├── text.py │ │ └── toy.py │ ├── downloaders │ │ ├── __init__.py │ │ ├── adult.py │ │ ├── base.py │ │ ├── binarized_mnist.py │ │ ├── caltech101_silhouettes.py │ │ ├── cifar10.py │ │ ├── cifar100.py │ │ ├── ilsvrc2010.py │ │ ├── iris.py │ │ ├── mnist.py │ │ └── svhn.py │ ├── exceptions.py │ ├── iterator.py │ ├── schemes.py │ ├── server.py │ ├── streams.py │ ├── transformers │ │ ├── __init__.py │ │ ├── _image.c │ │ ├── _image.pyx │ │ ├── defaults.py │ │ ├── image.py │ │ └── text.py │ ├── utils │ │ ├── __init__.py │ │ ├── formats.py │ │ └── parallel.py │ └── version.py │ ├── req-rtd.txt │ ├── req-travis-conda.txt │ ├── req-travis-pip.txt │ ├── requirements.txt │ ├── setup.cfg │ ├── setup.py │ └── tests │ ├── __init__.py │ ├── converters │ ├── __init__.py │ └── test_convert_ilsvrc2010.py │ ├── test_adult.py │ ├── test_billion.py │ ├── test_binarized_mnist.py │ ├── test_caltech101_silhouettes.py │ ├── test_cifar10.py │ ├── test_cifar100.py │ ├── test_config_parser.py │ ├── test_converters.py │ ├── test_datasets.py │ ├── test_downloaders.py │ ├── test_hdf5.py │ ├── test_iris.py │ ├── test_mnist.py │ ├── test_schemes.py │ ├── test_serialization.py │ ├── test_server.py │ ├── test_streams.py │ ├── test_svhn.py │ ├── test_text.py │ ├── test_toy.py │ ├── test_utils.py │ └── transformers │ ├── __init__.py │ ├── test_image.py │ └── test_transformers.py ├── lvsr ├── __init__.py ├── algorithms.py ├── bricks │ ├── __init__.py │ ├── attention.py │ ├── language_models.py │ └── recognizer.py ├── config.py ├── configs │ ├── prototype_autoencoder.yaml │ ├── prototype_speech.yaml │ └── schema.yaml ├── datasets │ ├── __init__.py │ └── h5py.py ├── error_rate.py ├── expressions.py ├── extensions.py ├── graph.py ├── log_backends.py ├── main.py ├── notebook.py ├── ops.py ├── preprocessing.py └── utils.py ├── setup.py └── tests ├── __init__.py ├── test_conv1d.py ├── test_error_rate.py └── test_expressions.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 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/.gitmodules -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2015 Université de Montréal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /bin/check_all_fst_weights_are_zero.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Check if an FST has only zero weights. 5 | """ 6 | 7 | import argparse 8 | import fst 9 | import sys 10 | 11 | 12 | def main(args): 13 | L = fst.read(args.fst_file) 14 | 15 | for state in L: 16 | for arc in state: 17 | if arc.weight != fst.TropicalWeight(0.0): 18 | sys.stderr.write( 19 | "Nonzero weight in the fst: node {} arc {}".format(state, arc)) 20 | exit(1) 21 | 22 | 23 | if __name__=='__main__': 24 | parser = argparse.ArgumentParser(description="Zero the weight on all transitions in the FST") 25 | parser.add_argument("fst_file", default='-', nargs='?') 26 | args = parser.parse_args() 27 | main(args) 28 | -------------------------------------------------------------------------------- /bin/check_ext_deterministic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import argparse 4 | import fst 5 | import sys 6 | 7 | 8 | def main(args): 9 | L = fst.read(args.fst_file) 10 | 11 | for state in L: 12 | ilab = [] 13 | for arc in state: 14 | ilab.append(arc.ilabel) 15 | ilabs = set(ilab) 16 | if 0 in ilabs and len(ilab) != 1: 17 | sys.stderr.write( 18 | "Node {} has a non-epsilon arc that is not unique: {}" 19 | .format(state, ilab)) 20 | exit(1) 21 | if len(ilabs) != len(ilab): 22 | sys.stderr.write( 23 | "Node {} has duplicated ilabels on edges: {}" 24 | .format(state, ilab)) 25 | exit(1) 26 | 27 | 28 | if __name__ == '__main__': 29 | parser = argparse.ArgumentParser( 30 | description="Check that all outgoing edges have either:\n" 31 | "1. Non-esilon and different ilabels or\n" 32 | "2. A single apsilon-labeled ilabel.") 33 | parser.add_argument("fst_file", default='-', nargs='?') 34 | args = parser.parse_args() 35 | main(args) 36 | -------------------------------------------------------------------------------- /bin/create_dict_lm_from_text.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Create an FST that accepts all words occuring in a given text file. 5 | # All words are assumed to be equally probable, thie resulting FST will 6 | # not be an unigram language model. 7 | # 8 | 9 | 10 | set -e 11 | 12 | KU=$KALDI_ROOT/egs/wsj/s5/utils 13 | 14 | . $KU/parse_options.sh 15 | 16 | if [ $# -ne 2 ]; then 17 | echo "usage: $0 " 18 | echo "options:" 19 | exit 1 20 | fi 21 | 22 | TEXTFILE=$1 23 | LMFILE=$2 24 | 25 | tmpfile=`mktemp` 26 | 27 | cat $TEXTFILE | cut -d' ' -f2- | tr ' ' '\n' | sort | uniq | \ 28 | grep -v "" > $tmpfile 29 | 30 | { 31 | echo "\\data\\" 32 | echo "ngram 1=`cat $tmpfile | wc -l`" 33 | echo "\\1-grams:" 34 | echo "0 " 35 | echo "0 " 36 | echo "0 " 37 | cat $tmpfile | sed -e "s/^/0 /" 38 | echo "\\end\\" 39 | } | gzip -c > $LMFILE 40 | -------------------------------------------------------------------------------- /bin/explain_lm.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Usage: explain_lm FST STR 4 | 5 | Explain the cost assigned to a string STR by the fst FST. 6 | """ 7 | 8 | 9 | def main(fst_path, string): 10 | fst = FST(fst_path) 11 | s = string.replace('', '%') 12 | subst = {'^': '', '$': '', ' ': '', '%': ''} 13 | fst.explain([subst.get(c, c) for c in s]) 14 | 15 | if __name__ == "__main__": 16 | import sys 17 | if len(sys.argv) != 2: 18 | print __doc__ 19 | sys.exit(1) 20 | from lvsr.ops import FST 21 | main(*sys.argv) 22 | -------------------------------------------------------------------------------- /bin/print_yaml_conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Print the conffiguration yaml formed by including parent configs and 5 | applying command line chenges. 6 | """ 7 | 8 | 9 | from lvsr.config import prototype, read_config 10 | from argparse import ArgumentParser 11 | 12 | if __name__ == '__main__': 13 | parser = ArgumentParser() 14 | parser.add_argument('config_path') 15 | parser.add_argument('format_string') 16 | parser.add_argument('--positional', default=False, action='store_true') 17 | args = parser.parse_args() 18 | # Experiment configuration 19 | config = prototype 20 | if args.config_path: 21 | with open(args.config_path, 'rt') as src: 22 | config = read_config(src) 23 | if args.positional: 24 | print args.format_string.format(config) 25 | else: 26 | print args.format_string.format(**config) 27 | -------------------------------------------------------------------------------- /bin/remove_fst_weights.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Remove all weights from an FST. 5 | """ 6 | 7 | import argparse 8 | import fst 9 | 10 | 11 | def main(args): 12 | L = fst.read(args.fst_file) 13 | 14 | for state in L: 15 | for arc in state: 16 | arc.weight = L.SEMIRING(0.0) 17 | 18 | L.write(args.fst_file, keep_isyms=True, keep_osyms=True) 19 | 20 | 21 | if __name__ == '__main__': 22 | parser = argparse.ArgumentParser( 23 | description="Zero the weight on all transitions in the FST") 24 | parser.add_argument("fst_file", default='-', nargs='?') 25 | args = parser.parse_args() 26 | main(args) 27 | -------------------------------------------------------------------------------- /config/blocks.yaml: -------------------------------------------------------------------------------- 1 | recursion_limit: 100000 2 | -------------------------------------------------------------------------------- /config/theano.rc: -------------------------------------------------------------------------------- 1 | [global] 2 | compiledir_format = lvsr_compiledir_%(platform)s-%(processor)s-%(python_version)s-%(python_bitwidth)s 3 | 4 | [lib] 5 | cnmem=0.9 6 | 7 | [experimental] 8 | unpickle_gpu_on_cpu=True 9 | unpickle_shared_gpu_on_cpu=True 10 | -------------------------------------------------------------------------------- /env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # The directory where the script is 4 | export LVSR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 | 6 | # For PyFST 7 | if [ -n "$KALDI_ROOT" ]; 8 | then 9 | export LD_LIBRARY_PATH=$KALDI_ROOT/tools/openfst/lib:$LD_LIBRARY_PATH 10 | fi 11 | 12 | export BLOCKS_CONFIG=$LVSR/config/blocks.yaml 13 | export THEANORC=$LVSR/config/theano.rc:$HOME/.theanorc 14 | 15 | #python modules 16 | export PYTHONPATH=$LVSR:$LVSR/libs/blocks:$LVSR/libs/blocks-extras:$LVSR/libs/fuel:$LVSR/libs/Theano:$PYTHONPATH 17 | export PATH=$LVSR/bin:$LVSR/libs/blocks/bin:$LVSR/libs/blocks-extras/bin:$LVSR/libs/fuel/bin:$PATH 18 | -------------------------------------------------------------------------------- /exp/README.md: -------------------------------------------------------------------------------- 1 | This directory will contain files related to specific experiments, like dataset creation or peculiar scoring requirements. 2 | -------------------------------------------------------------------------------- /exp/timit/configs/iclr_reward.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/timit/configs/nips_smooth.yaml 2 | net: 3 | criterion: 4 | name: mse_gain 5 | min_reward: -5 6 | initialization: 7 | /recognizer/generator/readout/post_merge/mlp: 8 | biases_init: 9 | !!python/object/apply:blocks.initialization.Constant [-1.0] 10 | training: 11 | exploration: greedy 12 | gradient_threshold: 100.0 13 | monitoring: 14 | search: 15 | round_to_inf: 4.5 16 | stop_on: patience 17 | stages: 18 | pretraining: 19 | training: 20 | num_epochs: 30 21 | net: 22 | criterion: 23 | min_reward: -1 24 | pretraining2: 25 | number: 50 26 | data: 27 | batch_size: 8 28 | training: 29 | num_epochs: 30 30 | restart_from: _best_ll 31 | -------------------------------------------------------------------------------- /exp/timit/configs/nips_conv.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/timit/configs/nips_baseline.yaml 2 | net: 3 | attention_type: content_and_conv 4 | conv_n: 100 5 | conv_num_filters: 10 6 | prior: 7 | # params for type: expanding, which is the default! 8 | initial_begin: 0 9 | initial_end: 10000 10 | max_speed: 10.0 11 | min_speed: 0.0 12 | type: expanding 13 | -------------------------------------------------------------------------------- /exp/timit/configs/nips_smooth.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/timit/configs/nips_conv.yaml 2 | net: 3 | energy_normalizer: logistic 4 | -------------------------------------------------------------------------------- /exp/wsj/add_bol.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # The purpose of the script is to add a token to an 4 | # existing dataset. One might want to do this 5 | # because generating one from scratch takes quite a bit of time. 6 | 7 | import sys 8 | import tables 9 | import numpy 10 | wsj = tables.open_file(sys.argv[1], 'a') 11 | value_map = wsj.root.characters.attrs.value_map 12 | entry = value_map[0].copy() 13 | entry[0] = '' 14 | entry[1] = 32 15 | value_map = numpy.hstack([value_map, [entry]]) 16 | wsj.root.characters.attrs.value_map = value_map 17 | -------------------------------------------------------------------------------- /exp/wsj/add_bos_to_parameters.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env/python 2 | # 3 | # A very temporary script that adds embeddings for one more character 4 | # to the parameter. 5 | 6 | import sys 7 | import numpy 8 | 9 | def add_one_dim(param, i): 10 | new_shape = list(param.shape) 11 | old_dim = new_shape[i] 12 | new_shape[i] += 1 13 | new_value = numpy.zeros(new_shape, dtype='float32') 14 | indices = len(new_shape) * [slice(None,)] 15 | indices[i] = slice(old_dim) 16 | new_value[indices] = param 17 | return new_value 18 | 19 | params = numpy.load(sys.argv[1]) 20 | new_params = {} 21 | for key, value in params.items(): 22 | if hasattr(value, 'shape'): 23 | if 33 in value.shape: 24 | value = add_one_dim(value, value.shape.index(33)) 25 | if 32 in value.shape: 26 | value = add_one_dim(value, value.shape.index(32)) 27 | new_params[key] = value 28 | with open(sys.argv[2], 'w') as dest: 29 | numpy.savez(dest, **new_params) 30 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd10.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # like bhd8 but with no regularization at the second stage 3 | $LVSR/lvsr/run.py --params wsj_bhd8.zip train wsj_bhd10r.zip $LVSR/exp/wsj/configs/wsj_bhd4.yaml\ 4 | regularization.max_norm 0 net.prior.type "'window_around_median'" 5 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd11.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # like bhd7 and bhd8, but with smaller initial weights and no normalization 3 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_bhd11.zip $LVSR/exp/wsj/configs/wsj_bhd11.yaml 4 | $LVSR/lvsr/run.py --params wsj_bhd11.zip train wsj_bhd11r.zip $LVSR/exp/wsj/configs/wsj_bhd11.yaml\ 5 | net.prior.type "'window_around_median'" 6 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd11.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_bhd4.yaml 2 | initialization: 3 | /recognizer: 4 | weights_init: 5 | !!python/object:blocks.initialization.Uniform {width: 0.1} 6 | regularization: 7 | max_norm: 0 8 | 9 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd4.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | $LVSR/lvsr/run.py --num-epochs=1 train wsj_bhd4.zip $LVSR/exp/wsj/configs/wsj_bhd4.yaml 3 | $LVSR/lvsr/run.py --params wsj_bhd4.zip train wsj_bhd4r.zip $LVSR/exp/wsj/configs/wsj_bhd4.yaml net.prior.type "'window_around_mean'" 4 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd4.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_baseline.yaml 2 | net: 3 | dims_bidir: [250, 250, 250, 250] 4 | subsample: [1, 1, 2, 2] 5 | bottom: 6 | dims: [] 7 | # 0.5 times respective settings from wsj_jan_baseline.yaml 8 | prior: 9 | before: 100 10 | after: 100 11 | initial_begin: 0 12 | initial_end: 40 13 | min_speed: 1.2 14 | max_speed: 2.2 15 | regularization: 16 | max_norm: 1.0 17 | 18 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd5.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | $LVSR/lvsr/run.py --num-epochs=1 train wsj_bhd5.zip $LVSR/exp/wsj/configs/wsj_bhd5.yaml 3 | $LVSR/lvsr/run.py --params wsj_bhd5.zip train wsj_bhd5r.zip $LVSR/exp/wsj/configs/wsj_bhd5.yaml net.prior.type "'window_around_mean'" 4 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd5.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_baseline.yaml 2 | net: 3 | bottom: 4 | dims: [] 5 | regularization: 6 | max_norm: 1 7 | 8 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd6.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Try to exactly replicate the fruitful BHD3 experiment 3 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_bhd6.zip $LVSR/exp/wsj/configs/wsj_jan_baseline.yaml 4 | $LVSR/lvsr/run.py --params wsj_bhd6.zip train wsj_bhd6r.zip $LVSR/exp/wsj/configs/wsj_jan_baseline.yaml\ 5 | regularization.max_norm 1 net.prior.type "'window_around_median'" 6 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd7.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Assuming that BHD6 will get to the level of wsj_jan_baseline2r_best, 3 | # let's add one more recurrent layer 4 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_bhd7.zip $LVSR/exp/wsj/configs/wsj_bhd4.yaml\ 5 | regularization.max_norm 0 6 | $LVSR/lvsr/run.py --params wsj_bhd7.zip train wsj_bhd7r.zip $LVSR/exp/wsj/configs/wsj_bhd4.yaml\ 7 | regularization.max_norm 1 net.prior.type "'window_around_median'" 8 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd8.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # BHD7, but regularize at the initial stage as well 3 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_bhd8.zip $LVSR/exp/wsj/configs/wsj_bhd4.yaml\ 4 | regularization.max_norm 1 5 | $LVSR/lvsr/run.py --params wsj_bhd8.zip train wsj_bhd8r.zip $LVSR/exp/wsj/configs/wsj_bhd4.yaml\ 6 | regularization.max_norm 1 net.prior.type "'window_around_median'" 7 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd9.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # like jan_baseline but with smaller initial weights 3 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_bhd9.zip $LVSR/exp/wsj/configs/wsj_bhd9.yaml 4 | $LVSR/lvsr/run.py --params wsj_bhd9.zip train wsj_bhd9r.zip $LVSR/exp/wsj/configs/wsj_bhd9.yaml\ 5 | net.prior.type "'window_around_median'" 6 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_bhd9.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_baseline.yaml 2 | initialization: 3 | /recognizer: 4 | weights_init: 5 | !!python/object:blocks.initialization.Uniform {width: 0.1} 6 | 7 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_good.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_prior_conv.yaml 2 | training: 3 | rules: 4 | - momentum 5 | - adadelta 6 | scale: 0.1 7 | decay_rate: 0.95 8 | epsilon: 1.0e-8 9 | net: 10 | use_states_for_readout: True 11 | bottom: 12 | activation: !!python/object/apply:blocks.bricks.Rectifier [] 13 | # JCh: These options were removed in 1.2016. They should be overriden in 14 | # Configurations that are based on this one 15 | # 16 | # data: 17 | # preprocess_text: True 18 | # preprocess_features: log_spectrogram 19 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_good_fbank.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_good.yaml 2 | data: 3 | dataset_filename: wsj.h5 4 | 5 | name_mapping: 6 | train: train_si284 7 | valid: test_dev93 8 | test: test_eval92 9 | 10 | sources_map: 11 | recordings: fbank_dd 12 | labels: characters 13 | uttids: uttids 14 | 15 | normalization: "" 16 | add_eos: True 17 | 18 | net: 19 | # 0.8 times respective settings from wsj_good_fbank.yaml 20 | prior: 21 | initial_begin: 0 22 | initial_end: 160 23 | min_speed: 4.8 24 | max_speed: 8.8 25 | before: 400 26 | after: 400 27 | 28 | 29 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_baseline.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_good_fbank.yaml 2 | net: 3 | dims_bidir: [250, 250, 250] 4 | subsample: [1, 1, 2] 5 | post_merge_dims: [250] 6 | post_merge_activation: !!python/object/apply:blocks.bricks.Rectifier [] 7 | # 0.5 times respective settings from wsj_good_fbank.yaml 8 | prior: 9 | before: 200 10 | after: 200 11 | initial_begin: 0 12 | initial_end: 80 13 | min_speed: 2.4 14 | max_speed: 4.4 15 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd01.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # like bhd7 and bhd8, but with smaller initial weights and no normalization 3 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_jan_bhd01.zip $LVSR/exp/wsj/configs/wsj_jan_bhd01.yaml 4 | $LVSR/lvsr/run.py --params wsj_jan_bhd01.zip train wsj_jan_bhd01r.zip $LVSR/exp/wsj/configs/wsj_jan_bhd01.yaml\ 5 | net.prior.type "'window_around_median'" 6 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd01.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_bhd4.yaml 2 | 3 | net: 4 | energy_normalizer: logistic 5 | 6 | initialization: 7 | /recognizer: 8 | weights_init: 9 | !!python/object:blocks.initialization.Uniform {width: 0.1} 10 | /recognizer/generator/att_trans/conv_att/energy_comp: 11 | weights_init: 12 | !!python/object/apply:blocks.initialization.Constant [0.] 13 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd02.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # like bhd7 and bhd8, but with smaller initial weights and no normalization 3 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_jan_bhd02.zip $LVSR/exp/wsj/configs/wsj_jan_bhd02.yaml 4 | $LVSR/lvsr/run.py --params wsj_jan_bhd02.zip train wsj_jan_bhd02r.zip $LVSR/exp/wsj/configs/wsj_jan_bhd02.yaml\ 5 | net.prior.type "'window_around_median'" 6 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd02.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_bhd4.yaml 2 | 3 | net: 4 | energy_normalizer: relu 5 | 6 | initialization: 7 | /recognizer: 8 | weights_init: 9 | !!python/object:blocks.initialization.Uniform {width: 0.1} 10 | /recognizer/generator/att_trans/conv_att/energy_comp: 11 | weights_init: 12 | !!python/object/apply:blocks.initialization.Constant [0.] 13 | /recognizer/generator/att_trans/conv_att/energy_comp: 14 | biases_init: 15 | !!python/object/apply:blocks.initialization.Constant [1.] 16 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd03.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # like bhd7 and bhd8, but with smaller initial weights and no normalization 3 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_jan_bhd03.zip $LVSR/exp/wsj/configs/wsj_jan_bhd03.yaml 4 | $LVSR/lvsr/run.py --params wsj_jan_bhd03.zip train wsj_jan_bhd03r.zip $LVSR/exp/wsj/configs/wsj_jan_bhd03.yaml\ 5 | net.prior.type "'window_around_median'" 6 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd03.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_bhd4.yaml 2 | 3 | initialization: 4 | /recognizer: 5 | weights_init: 6 | !!python/object:blocks.initialization.Uniform {width: 0.1} 7 | /recognizer/generator/att_trans/conv_att/energy_comp: 8 | weights_init: 9 | !!python/object/apply:blocks.initialization.Constant [0.] 10 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd04.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # like bhd7 and bhd8, but with smaller initial weights and no normalization 5 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_jan_bhd04.zip $LVSR/exp/wsj/configs/wsj_jan_bhd04.yaml net.prior.type "'expanding'" 6 | $LVSR/lvsr/run.py --params wsj_jan_bhd04.zip train wsj_jan_bhd04r.zip $LVSR/exp/wsj/configs/wsj_jan_bhd04.yaml 7 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd04.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_wsj11v2.yaml 2 | 3 | net: 4 | prior: 5 | # params for type: expanding, which is the default! 6 | initial_begin: 0 7 | initial_end: 200 8 | max_speed: 1.2 9 | min_speed: 2.2 10 | 11 | type: window_around_mean 12 | #type: window_around_median 13 | #type: expanding 14 | #type: window_based_on_length_ratio 15 | before: 150 16 | after: 150 17 | 18 | initialization: 19 | /recognizer: 20 | weights_init: 21 | !!python/object:blocks.initialization.Uniform {width: 0.1} 22 | /recognizer/generator/att_trans/conv_att/energy_comp: 23 | weights_init: 24 | !!python/object/apply:blocks.initialization.Constant [0.] 25 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd05.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # like bhd7 and bhd8, but with smaller initial weights and no normalization 5 | $LVSR/lvsr/run.py --num-epochs=3 train wsj_jan_bhd05.zip $LVSR/exp/wsj/configs/wsj_jan_bhd05.yaml net.prior.type "'expanding'" 6 | $LVSR/lvsr/run.py --params wsj_jan_bhd05.zip train wsj_jan_bhd05r.zip $LVSR/exp/wsj/configs/wsj_jan_bhd05.yaml 7 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_bhd05.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_bhd04.yaml 2 | 3 | net: 4 | energy_normalizer: logistic 5 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_debug.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_new.yaml 2 | net: 3 | dims_bidir: [17, 17, 17] 4 | subsample: [1, 2, 2] 5 | dim_dec: 19 6 | attention_type: content_and_conv 7 | conv_n: 13 8 | dec_stack: 2 9 | prior: 10 | before: 150 11 | after: 150 12 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_wsj11v2.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_new.yaml 2 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_wsj13v2.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_new.yaml 2 | net: 3 | dims_bidir: [256, 256, 256] 4 | subsample: [1, 1, 2] 5 | dec_stack: 2 6 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_wsj14v2.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_new.yaml 2 | net: 3 | dims_bidir: [256, 256, 256] 4 | subsample: [1, 1, 2] 5 | dec_stack: 2 6 | dim_dec: 512 7 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_wsj15v2.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_new.yaml 2 | net: 3 | dec_stack: 2 4 | dim_dec: 512 5 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_wsj16.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_new.yaml 2 | net: 3 | bottom: 4 | activation: !!python/object/apply:blocks.bricks.Rectifier [] 5 | dims: [] 6 | 7 | enc_transition: !!python/name:blocks.bricks.recurrent.GatedRecurrent 8 | dims_bidir: [256, 256, 256, 256, 256] 9 | subsample: [1, 1, 2, 2, 2] 10 | 11 | prior: #essentially no prior! 12 | type: expanding 13 | initial_begin: 0 14 | initial_end: 10000 15 | max_speed: 0 16 | min_speed: 0 17 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_wsj17.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_new.yaml 2 | net: 3 | bottom: 4 | bottom: !!python/object/apply:blocks.bricks.Rectifier [] 5 | dims: [] 6 | 7 | enc_transition: !!python/name:blocks.bricks.recurrent.GatedRecurrent 8 | dims_bidir: [256, 256, 256, 256, 256, 256] 9 | subsample: [1, 1, 2, 2, 2, 2] 10 | 11 | prior: #essentially no prior! 12 | type: expanding 13 | initial_begin: 0 14 | initial_end: 10000 15 | max_speed: 0 16 | min_speed: 0 17 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_wsj18.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_new.yaml 2 | net: 3 | bottom: 4 | activation: !!python/object/apply:blocks.bricks.Rectifier [] 5 | dims: [] 6 | 7 | enc_transition: !!python/name:blocks.bricks.recurrent.GatedRecurrent 8 | dims_bidir: [256, 256, 256] 9 | subsample: [1, 1, 2] 10 | 11 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_jan_wsj19.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_new.yaml 2 | net: 3 | bottom: 4 | activation: !!python/object/apply:blocks.bricks.Rectifier [] 5 | dims: [] 6 | 7 | enc_transition: !!python/name:blocks.bricks.recurrent.GatedRecurrent 8 | dims_bidir: [256, 256, 256] 9 | subsample: [1, 1, 1] 10 | 11 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper1.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper.yaml 2 | data: 3 | add_bos: 0 4 | stages: 5 | pretraining: 6 | training: 7 | num_epochs: 1 8 | main: 9 | training: 10 | num_epochs: 10 11 | annealing1: 12 | training: 13 | num_epochs: 3 14 | annealing2: 15 | training: 16 | num_epochs: 3 17 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper10.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper7.yaml 2 | stages: 3 | pretraining: null 4 | main: 5 | net: 6 | prior: 7 | before: 10000 8 | after: 10000 9 | training: 10 | num_epochs: 20 11 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper2.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper1.yaml 2 | net: 3 | dims_bidir: [250, 250, 250, 250] 4 | subsample: [1, 1, 1, 1] 5 | prior: 6 | before: 400 7 | after: 400 8 | type: window_around_median 9 | stages: 10 | pretraining: 11 | net: 12 | prior: 13 | type: expanding 14 | initial_begin: 0 15 | initial_end: 160 16 | min_speed: 4.8 17 | max_speed: 8.8 18 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper3.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper1.yaml 2 | net: 3 | dims_bidir: [250, 250, 250, 250] 4 | subsample: [1, 1, 1, 2] 5 | prior: 6 | before: 200 7 | after: 200 8 | type: window_around_median 9 | stages: 10 | pretraining: 11 | net: 12 | prior: 13 | type: expanding 14 | initial_begin: 0 15 | initial_end: 80 16 | min_speed: 2.4 17 | max_speed: 4.4 18 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper4.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper1.yaml 2 | net: 3 | dims_bidir: [250, 250, 250, 250] 4 | subsample: [1, 2, 2, 2] 5 | prior: 6 | before: 50 7 | after: 50 8 | type: window_around_median 9 | stages: 10 | pretraining: 11 | net: 12 | prior: 13 | type: expanding 14 | initial_begin: 0 15 | initial_end: 20 16 | min_speed: 0.6 17 | max_speed: 1.1 18 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper5.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper1.yaml 2 | net: 3 | use_states_for_readout: False 4 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper6.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper1.yaml 2 | net: 3 | dims_bidir: [320, 320, 320, 320] 4 | post_merge_dims: [320] 5 | dim_dec: 320 6 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper7.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper.yaml 2 | stages: 3 | pretraining: 4 | training: 5 | num_epochs: 4 6 | main: 7 | training: 8 | num_epochs: 15 9 | restart_from: _best 10 | annealing1: 11 | training: 12 | num_epochs: 3 13 | restart_from: _best 14 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper8.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper7.yaml 2 | stages: 3 | pretraining: null 4 | main: 5 | training: 6 | num_epochs: 20 7 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_paper9.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper7.yaml 2 | regularization: 3 | max_norm: -1. 4 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_prior_conv.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/lvsr/configs/prototype_speech.yaml 2 | data: 3 | dataset_filename: wsj.h5 4 | 5 | name_mapping: 6 | train: train_si284 7 | valid: test_dev93 8 | test: test_eval92 9 | 10 | sources_map: 11 | recordings: fbank_dd 12 | labels: characters 13 | uttids: uttids 14 | 15 | default_sources: [recordings, labels] 16 | 17 | normalization: wsj_norm.pkl 18 | net: 19 | dim_dec: 250 20 | dims_bidir: [250] 21 | bottom: 22 | dims: [250] 23 | 24 | attention_type: content_and_conv 25 | conv_n: 100 26 | prior: 27 | initial_begin: 0 28 | initial_end: 200 29 | min_speed: 6 30 | max_speed: 11 31 | dec_transition: !!python/name:blocks.bricks.recurrent.GatedRecurrent 32 | enc_transition: !!python/name:blocks.bricks.recurrent.GatedRecurrent 33 | training: 34 | scale: 0.004 35 | initialization: 36 | /recognizer: 37 | rec_weights_init: 38 | !!python/object/apply:blocks.initialization.IsotropicGaussian [0.1] 39 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_prior_conv_adadelta.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_prior_conv.yaml 2 | training: 3 | rules: 4 | - momentum 5 | - adadelta 6 | scale: 0.1 7 | decay_rate: 0.95 8 | epsilon: 1e-8 9 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_pyramide.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_good_fbank.yaml 2 | net: 3 | dims_bidir: [250, 500, 1000] 4 | subsample: [1, 2, 2] 5 | post_merge_dims: [1000] 6 | post_merge_activation: !!python/object/apply:blocks.bricks.Rectifier [] 7 | # 0.25 times respective settings from wsj_good_fbank.yaml 8 | prior: 9 | before: 200 10 | after: 200 11 | initial_begin: 0 12 | initial_end: 40 13 | min_speed: 1.2 14 | max_speed: 2.1 15 | 16 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_reward1.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper1.yaml 2 | net: 3 | criterion: 4 | name: mse_gain 5 | min_reward: -5 6 | lm: 7 | normalize_am_weights: False 8 | training: 9 | scale: 0.01 10 | initialization: 11 | /recognizer: 12 | weights_init: 13 | !!python/object/apply:blocks.initialization.Uniform [0.0, 0.1] 14 | /recognizer/generator/readout/post_merge/mlp: 15 | biases_init: 16 | !!python/object/apply:blocks.initialization.Constant [-1.0] 17 | monitoring: 18 | search: 19 | round_to_inf: 4.5 20 | stop_on: patience 21 | stages: 22 | pretraining: 23 | training: 24 | num_epochs: 4 25 | net: 26 | lm: null 27 | main: 28 | net: 29 | lm: null 30 | annealing1: 31 | net: 32 | lm: null 33 | annealing2: null 34 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_reward10.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper1.yaml 2 | net: 3 | criterion: 4 | name: mse_gain 5 | initialization: 6 | /recognizer: 7 | weights_init: 8 | !!python/object/apply:blocks.initialization.Uniform [0.0, 0.1] 9 | /recognizer/generator/readout/post_merge/mlp: 10 | biases_init: 11 | !!python/object/apply:blocks.initialization.Constant [-1.0] 12 | training: 13 | exploration: imitation 14 | data: 15 | add_bos: 1 16 | stages: 17 | pretraining: 18 | training: 19 | num_epochs: 4 20 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_reward11.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_reward6.yaml 2 | training: 3 | exploration: mixed 4 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_reward1f.yaml: -------------------------------------------------------------------------------- 1 | # A config to continue wsj_reward1 with another exploration strategy 2 | parent: $LVSR/exp/wsj/configs/wsj_reward1.yaml 3 | stages: 4 | pretraining: null 5 | main: 6 | training: 7 | num_epochs: 2 8 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_reward2.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_paper1.yaml 2 | net: 3 | criterion: 4 | name: mse_reward 5 | initialization: 6 | /recognizer: 7 | weights_init: 8 | !!python/object/apply:blocks.initialization.Uniform [0.0, 0.1] 9 | /recognizer/generator/readout/post_merge/mlp: 10 | biases_init: 11 | !!python/object/apply:blocks.initialization.Constant [1.0] 12 | stages: 13 | pretraining: 14 | training: 15 | num_epochs: 2 16 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_reward3.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_reward1.yaml 2 | training: 3 | exploration: greedy 4 | 5 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_reward4.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_reward1.yaml 2 | training: 3 | exploration: greedy 4 | data: 5 | add_bos: 1 6 | monitoring: 7 | search: 8 | char_discount: 0. 9 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_reward5.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_reward1.yaml 2 | data: 3 | add_bos: 1 4 | monitoring: 5 | search: 6 | char_discount: 0. 7 | stages: 8 | pretraining: 9 | net: 10 | criterion: 11 | min_reward: -1 12 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_reward6.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_reward4.yaml 2 | training: 3 | scale: 0.1 4 | stages: 5 | pretraining: 6 | net: 7 | criterion: 8 | min_reward: -1 9 | main: 10 | training: 11 | num_epochs: 15 12 | 13 | -------------------------------------------------------------------------------- /exp/wsj/configs/wsj_small.yaml: -------------------------------------------------------------------------------- 1 | parent: $LVSR/exp/wsj/configs/wsj_jan_baseline.yaml 2 | net: 3 | dims_bidir: [100] 4 | post_merge_dims: [] 5 | subsample: [1] 6 | bottom: 7 | dims: [] 8 | prior: 9 | type: window_around_median 10 | before: 400 11 | after: 400 12 | data: 13 | max_length: 200 14 | regularization: 15 | max_norm: 1.0 16 | stages: 17 | pretraining: 18 | number: 0 19 | net: 20 | prior: 21 | type: expanding 22 | initial_begin: 0 23 | initial_end: 160 24 | min_speed: 4.8 25 | max_speed: 8.8 26 | training: 27 | num_epochs: 3 28 | main: 29 | number: 100 30 | training: 31 | num_epochs: 4 32 | restart_from: _best_ll 33 | annealing1: 34 | number: 200 35 | training: 36 | num_epochs: 2 37 | epsilon: 1.0e-8 38 | restart_from: _best_ll 39 | annealing2: 40 | number: 300 41 | training: 42 | num_epochs: 2 43 | epsilon: 1.0e-10 44 | restart_from: _best_ll 45 | -------------------------------------------------------------------------------- /exp/wsj/create_character_decoding_graph.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | KU=$KALDI_ROOT/egs/wsj/s5/utils 5 | 6 | use_bol=false 7 | 8 | . $KU/parse_options.sh 9 | 10 | if [ $# -ne 2 ]; then 11 | echo "usage: `basename $0` " 12 | echo "options:" 13 | echo " --use-bol (true|false) #default: false, if true the graph will accout for bol symbol" 14 | exit 1 15 | fi 16 | 17 | LMFILE=$1 18 | DIR=$2 19 | 20 | WSJDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 21 | 22 | mkdir -p $DIR 23 | 24 | $WSJDIR/create_character_lexicon.sh $LMFILE $DIR 25 | lm2fst.sh --use-bol $use_bol $LMFILE $DIR 26 | 27 | lm_num_lines=`wc -l $LMFILE` 28 | if [ `cat $LMFILE | wc -l` -le 50 ]; then 29 | fstdraw -isymbols=$DIR/words.txt -osymbols=$DIR/words.txt $DIR/G.fst | dot -Tpdf > $DIR/G.pdf 30 | fstdraw -isymbols=$DIR/chars_disambig.txt -osymbols=$DIR/words.txt $DIR/L_disambig.fst | dot -Tpdf > $DIR/L_disambig.pdf 31 | fstdraw -isymbols=$DIR/chars_disambig.txt -osymbols=$DIR/words.txt $DIR/LG.fst | dot -Tpdf > $DIR/LG.pdf 32 | fi 33 | -------------------------------------------------------------------------------- /exp/wsj/create_graph_form_text.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | KU=$KALDI_ROOT/egs/wsj/s5/utils 6 | WSJDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 7 | 8 | 9 | part=test_dev93 10 | dataset=$FUEL_DATA_PATH/wsj.h5 11 | use_bol=false 12 | 13 | . $KU/parse_options.sh 14 | 15 | if [ $# -ne 1 ]; then 16 | echo "usage: `basename $0` " 17 | echo "options:" 18 | echo " --part #default: test_dev93" 19 | echo ' --dataset #default: $FUEL_DATA_PATH/WSJ/wsj_new.h5' 20 | echo " --use-bol (true|false) #default: false, if true the graph will accout for bol symbol" 21 | exit 1 22 | fi 23 | 24 | DIR=$1 25 | LMFILE=$DIR/lm_dict.arpa.gz 26 | 27 | mkdir -p $DIR 28 | 29 | $LVSR/bin/kaldi2fuel.py $dataset read_raw_text --subset $part kaldi_text $DIR/tmp_raw_text.txt 30 | cat $DIR/tmp_raw_text.txt | sort | tr -d '*:' > $DIR/raw_text.txt 31 | 32 | rm $DIR/tmp_raw_text.txt 33 | 34 | $LVSR/bin/create_dict_lm_from_text.sh $DIR/raw_text.txt $LMFILE 35 | 36 | $WSJDIR/create_character_lexicon.sh $LMFILE $DIR 37 | $LVSR/bin/lm2fst.sh --use-bol $use_bol $LMFILE $DIR 38 | -------------------------------------------------------------------------------- /exp/wsj/decode.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -uex 3 | 4 | MODEL=$1 5 | PART=$2 6 | BEAM_SIZE=$3 7 | LM=${LM:=nolm} 8 | LM_PATH=${LM_PATH:=data/lms/wsj_trigram_no_bos} 9 | 10 | ls $MODEL/reports || mkdir $MODEL/reports 11 | 12 | LM_CONF="monitoring.search.beam_size $BEAM_SIZE" 13 | if [ $LM == nolm ] 14 | then 15 | LM_CONF+=" monitoring.search.char_discount 0.1" 16 | else 17 | LM_CONF+=" monitoring.search.char_discount 1.0" 18 | LM_CONF+=" net.lm.weight 0.5 net.lm.no_transition_cost 20" 19 | LM_CONF+=" net.lm.path '$LM_PATH/LG_pushed_withsyms.fst'" 20 | fi 21 | 22 | $LVSR/bin/run.py search --part=$PART\ 23 | --report $MODEL/reports/${PART}_${LM}_${BEAM_SIZE}\ 24 | $MODEL/annealing1_best_ll.zip $LVSR/exp/wsj/configs/$MODEL.yaml\ 25 | vocabulary $LM_PATH'/words.txt' net.prior.before 10\ 26 | $LM_CONF 27 | -------------------------------------------------------------------------------- /exp/wsj/decode_tle.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -uex 3 | 4 | MODEL=$1 5 | PART=$2 6 | BEAM_SIZE=$3 7 | LM=${LM:=nolm} 8 | LM_PATH=${LM_PATH:=data/lms/wsj_trigram_no_bos} 9 | 10 | ls $MODEL/reports || mkdir $MODEL/reports 11 | 12 | LM_CONF="monitoring.search.beam_size $BEAM_SIZE" 13 | if [ ! $LM == nolm ] 14 | then 15 | LM_CONF+=" net.lm.weight 0.15" 16 | LM_CONF+=" net.lm.path '$LM_PATH/LG_pushed_withsyms.fst'" 17 | fi 18 | 19 | $LVSR/bin/run.py search --part=$PART\ 20 | --report $MODEL/reports/${PART}_${LM}_${BEAM_SIZE}\ 21 | $MODEL/annealing1_best_ll.zip $LVSR/exp/wsj/configs/$MODEL.yaml\ 22 | vocabulary $LM_PATH'/words.txt'\ 23 | $LM_CONF 24 | 25 | -------------------------------------------------------------------------------- /exp/wsj/extract_for_kaldi.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Extract transcripts to score using kaldi's compute-wer program 5 | # transcript sanitization rules taken from the Kaldi WSJ s5 recipe are applied 6 | # 7 | 8 | paste -d ' '\ 9 | <( cat $1 | grep Utterance | sed 's/.*(\(.*\))/\1/' )\ 10 | <( cat $1 | grep Recognized: | sed 's/Recognized: \(.*\)/\1/' )\ 11 | | sed 's///g'\ 12 | | sed 's/\/"QUOTE/g'\ 13 | | sed 's/\/"END-QUOTE/g'\ 14 | | sed 's/\/"UNQUOTE/g' 15 | 16 | -------------------------------------------------------------------------------- /exp/wsj/lm_4k0c030a: -------------------------------------------------------------------------------- 1 | \data\ 2 | ngram 1=8 3 | 4 | \1-grams: 5 | -1 6 | -1 NOTHING 7 | -1 SAYS 8 | -1 THE 9 | -1 BUSINESS 10 | -1 BUSINESSMAN 11 | -99 12 | -1 13 | 14 | \end\ 15 | -------------------------------------------------------------------------------- /libs/Theano/.gitignore: -------------------------------------------------------------------------------- 1 | *.linkinfo 2 | *.o 3 | *.orig 4 | *.pyc 5 | *.pyo 6 | *.so 7 | *.sw? 8 | *~ 9 | *.aux 10 | *.log 11 | *.nav 12 | *.out 13 | *.snm 14 | *.toc 15 | *.vrb 16 | .noseids 17 | *.DS_Store 18 | *.bak 19 | Theano.egg-info 20 | \#*\# 21 | build 22 | compiled/*.cpp 23 | core.* 24 | cutils_ext.cpp 25 | dist 26 | doc/.build/ 27 | doc/indexes/oplist.txt 28 | doc/indexes/typelist.txt 29 | html 30 | pdf 31 | setuptools-*.egg 32 | theano/generated_version.py 33 | theano/generated_version.py.out 34 | distribute-*.egg 35 | distribute-*.tar.gz 36 | Theano.suo 37 | .ipynb_checkpoints 38 | .pydevproject 39 | .ropeproject 40 | -------------------------------------------------------------------------------- /libs/Theano/LICENSE.txt: -------------------------------------------------------------------------------- 1 | doc/LICENSE.txt -------------------------------------------------------------------------------- /libs/Theano/MANIFEST.in: -------------------------------------------------------------------------------- 1 | global-include *.txt 2 | global-include *.c 3 | global-include *.cu 4 | global-include *.cuh 5 | global-include *.cpp 6 | global-include *.h 7 | global-include *.sh 8 | global-include *.pkl 9 | recursive-include docs 10 | include bin/theano-cache 11 | include bin/theano-nose 12 | include bin/theano-test 13 | -------------------------------------------------------------------------------- /libs/Theano/NEWS_DEV.txt: -------------------------------------------------------------------------------- 1 | .. _NEWS_DEV: 2 | 3 | =================== 4 | DRAFT Release Notes 5 | =================== 6 | 7 | git log -p rel-0.7... |grep Merge|grep '#[0123456789]' |cut -f 8 -d ' ' | sed 's\#\* https://github.com/Theano/Theano/pull/\' 8 | 9 | git shortlog -sn rel-0.7.. 10 | 11 | 12 | 13 | Theano Development version 14 | ========================== 15 | 16 | NEWS.txt: 17 | 18 | -------------------------------------------------------------------------------- /libs/Theano/Theano.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "Theano", "Theano.pyproj", "{B67D762D-0020-4E02-9DDF-7DB4F89B1DD3}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {B67D762D-0020-4E02-9DDF-7DB4F89B1DD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {B67D762D-0020-4E02-9DDF-7DB4F89B1DD3}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(SolutionProperties) = preSolution 16 | HideSolutionNode = FALSE 17 | EndGlobalSection 18 | EndGlobal 19 | -------------------------------------------------------------------------------- /libs/Theano/benchmark/README: -------------------------------------------------------------------------------- 1 | The code written by James Bergstra in this directory has been superseded 2 | by the scipy benchmarking code, which is in another repository: 3 | 4 | https://github.com/jaberg/DeepLearningBenchmarks 5 | 6 | The remainder of the code in this directory remains undocumented. 7 | -------------------------------------------------------------------------------- /libs/Theano/benchmark/autoencoder/Makefile: -------------------------------------------------------------------------------- 1 | aa.x : aa.cc 2 | g++ -O3 -ffast-math aa.cc -o aa.x -L${PUB_PREFIX}/lib -lgsl ${THEANO_BLAS_LDFLAGS} 3 | 4 | clean : 5 | rm aa.x 6 | -------------------------------------------------------------------------------- /libs/Theano/benchmark/convolution/bench.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python opencv.py $@ 4 | python conv2d.py $@ 5 | python scipy_conv.py $@ 6 | 7 | echo "WARNING the mode is valid for theano and scipy, but opencv use the mode same! Can opencv do the mode full?" 8 | -------------------------------------------------------------------------------- /libs/Theano/benchmark/convolution/opencv.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import sys, timeit 3 | import numpy 4 | import scikits.image.opencv 5 | 6 | try: 7 | img_shape = int(sys.argv[1]), int(sys.argv[2]) 8 | ker_shape = int(sys.argv[3]), int(sys.argv[4]) 9 | dtype = sys.argv[5] 10 | except: 11 | print("Usage: %s [nb_call]" % sys.argv[0], file=sys.stderr) 12 | sys.exit(-1) 13 | 14 | nb_call = 1 15 | if len(sys.argv)>6: 16 | nb_call=int(sys.argv[6]) 17 | 18 | T = timeit.Timer("f()",""" 19 | import scikits.image.opencv, sys, numpy 20 | img_shape = int(sys.argv[1]), int(sys.argv[2]) 21 | ker_shape = int(sys.argv[3]), int(sys.argv[4]) 22 | dtype = sys.argv[5] 23 | 24 | img = numpy.ones(img_shape, dtype=dtype) 25 | ker = numpy.ones(ker_shape, dtype=dtype) 26 | 27 | def f(): 28 | scikits.image.opencv.cvFilter2D(img, ker) 29 | """) 30 | time = T.repeat(repeat=3, number=nb_call) 31 | print(min(time), "opencv") 32 | 33 | -------------------------------------------------------------------------------- /libs/Theano/benchmark/convolution/scipy_conv.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import sys, timeit 3 | try: 4 | img_shape = int(sys.argv[1]), int(sys.argv[2]) 5 | ker_shape = int(sys.argv[3]), int(sys.argv[4]) 6 | dtype = sys.argv[5] 7 | except: 8 | print("Usage: %s [nb_call]" % sys.argv[0], file=sys.stderr) 9 | sys.exit(-1) 10 | 11 | nb_call = 1 12 | if len(sys.argv)>6: 13 | nb_call=int(sys.argv[6]) 14 | 15 | T = timeit.Timer("f()",""" 16 | from scipy.signal import convolve2d 17 | import numpy 18 | 19 | img_shape = int(sys.argv[1]), int(sys.argv[2]) 20 | ker_shape = int(sys.argv[3]), int(sys.argv[4]) 21 | dtype = sys.argv[5] 22 | 23 | img = numpy.ones(img_shape, dtype=dtype) 24 | ker = numpy.ones(ker_shape, dtype=dtype) 25 | 26 | def f(): 27 | convolve2d(img, ker, mode="valid") 28 | """) 29 | time = T.repeat(repeat=3, number=nb_call) 30 | print(min(time), "scipy") 31 | 32 | -------------------------------------------------------------------------------- /libs/Theano/bin/theano-test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | """IPython Test Suite Runner. 4 | """ 5 | from __future__ import print_function 6 | 7 | # The tests can't even run if nose isn't available, so might as well give the 8 | # user a civilized error message in that case. 9 | 10 | try: 11 | import nose 12 | except ImportError: 13 | error = """\ 14 | ERROR: The IPython test suite requires nose to run. 15 | 16 | Please install nose on your system first and try again. 17 | For information on installing nose, see: 18 | http://somethingaboutorange.com/mrl/projects/nose 19 | 20 | Exiting.""" 21 | import sys 22 | print(error, file=sys.stderr) 23 | else: 24 | import theano 25 | theano.test() 26 | -------------------------------------------------------------------------------- /libs/Theano/doc/.build/PLACEHOLDER: -------------------------------------------------------------------------------- 1 | sphinx doesn't like it when this repertory isn't available 2 | -------------------------------------------------------------------------------- /libs/Theano/doc/.static/PLACEHOLDER: -------------------------------------------------------------------------------- 1 | sphinx doesn't like it when this repertory isn't available 2 | -------------------------------------------------------------------------------- /libs/Theano/doc/.templates/PLACEHOLDER: -------------------------------------------------------------------------------- 1 | sphinx doesn't like it when this repertory isn't available 2 | -------------------------------------------------------------------------------- /libs/Theano/doc/.templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {%- block extrahead %} 4 | {{ super() }} 5 | 10 | {% endblock %} 11 | 12 | {% block footer %} 13 | {{ super() }} 14 | 23 | {% endblock %} 24 | 25 | -------------------------------------------------------------------------------- /libs/Theano/doc/NEWS.txt: -------------------------------------------------------------------------------- 1 | .. _NEWS: 2 | 3 | .. include:: ../NEWS.txt 4 | -------------------------------------------------------------------------------- /libs/Theano/doc/bcast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/bcast.png -------------------------------------------------------------------------------- /libs/Theano/doc/cifarSC2011/pics/logreg_pydotprint_predict.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/cifarSC2011/pics/logreg_pydotprint_predict.png -------------------------------------------------------------------------------- /libs/Theano/doc/cifarSC2011/pics/logreg_pydotprint_prediction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/cifarSC2011/pics/logreg_pydotprint_prediction.png -------------------------------------------------------------------------------- /libs/Theano/doc/cifarSC2011/pics/logreg_pydotprint_train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/cifarSC2011/pics/logreg_pydotprint_train.png -------------------------------------------------------------------------------- /libs/Theano/doc/crei2013/ifelse_switch.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import time 3 | 4 | import numpy 5 | 6 | import theano 7 | from theano import tensor as tt 8 | from six.moves import xrange 9 | from theano.ifelse import ifelse 10 | 11 | a, b = tt.scalars('a', 'b') 12 | x, y = tt.matrices('x', 'y') 13 | 14 | z_switch = tt.switch(tt.lt(a, b), tt.mean(x), tt.mean(y)) 15 | z_lazy = ifelse(tt.lt(a, b), tt.mean(x), tt.mean(y)) 16 | 17 | f_switch = theano.function([a, b, x, y], z_switch) 18 | f_lazyifelse = theano.function([a, b, x, y], z_lazy) 19 | 20 | val1 = 0. 21 | val2 = 1. 22 | big_mat1 = numpy.ones((10000, 1000)) 23 | big_mat2 = numpy.ones((10000, 1000)) 24 | 25 | n_times = 10 26 | 27 | tic = time.clock() 28 | for i in xrange(n_times): 29 | f_switch(val1, val2, big_mat1, big_mat2) 30 | print('time spent evaluating both values %f sec' % (time.clock() - tic)) 31 | 32 | tic = time.clock() 33 | for i in xrange(n_times): 34 | f_lazyifelse(val1, val2, big_mat1, big_mat2) 35 | print('time spent evaluating one value %f sec' % (time.clock() - tic)) 36 | -------------------------------------------------------------------------------- /libs/Theano/doc/crei2013/pics/logreg_pydotprint_predict.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/crei2013/pics/logreg_pydotprint_predict.png -------------------------------------------------------------------------------- /libs/Theano/doc/crei2013/pics/logreg_pydotprint_prediction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/crei2013/pics/logreg_pydotprint_prediction.png -------------------------------------------------------------------------------- /libs/Theano/doc/crei2013/pics/logreg_pydotprint_train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/crei2013/pics/logreg_pydotprint_train.png -------------------------------------------------------------------------------- /libs/Theano/doc/crei2013/scan_poly.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import numpy 3 | 4 | import theano 5 | import theano.tensor as tt 6 | 7 | coefficients = theano.tensor.vector("coefficients") 8 | x = tt.scalar("x") 9 | max_coefficients_supported = 10000 10 | 11 | # Generate the components of the polynomial 12 | full_range = theano.tensor.arange(max_coefficients_supported) 13 | components, updates = theano.scan(fn=lambda coeff, power, free_var: 14 | coeff * (free_var ** power), 15 | outputs_info=None, 16 | sequences=[coefficients, full_range], 17 | non_sequences=x) 18 | polynomial = components.sum() 19 | calculate_polynomial = theano.function(inputs=[coefficients, x], 20 | outputs=polynomial) 21 | 22 | test_coeff = numpy.asarray([1, 0, 2], dtype=numpy.float32) 23 | print(calculate_polynomial(test_coeff, 3)) 24 | # 19.0 25 | -------------------------------------------------------------------------------- /libs/Theano/doc/crei2013/scan_pow.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import theano 3 | import theano.tensor as tt 4 | from six.moves import xrange 5 | 6 | k = tt.iscalar("k") 7 | A = tt.vector("A") 8 | 9 | 10 | def inner_fct(prior_result, A): 11 | return prior_result * A 12 | # Symbolic description of the result 13 | result, updates = theano.scan(fn=inner_fct, 14 | outputs_info=tt.ones_like(A), 15 | non_sequences=A, n_steps=k) 16 | 17 | # Scan has provided us with A**1 through A**k. Keep only the last 18 | # value. Scan notices this and does not waste memory saving them. 19 | final_result = result[-1] 20 | 21 | power = theano.function(inputs=[A, k], 22 | outputs=final_result, 23 | updates=updates) 24 | 25 | print(power(list(range(10)), 2)) 26 | #[ 0. 1. 4. 9. 16. 25. 36. 49. 64. 81.] 27 | -------------------------------------------------------------------------------- /libs/Theano/doc/developer/index.txt: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. _developer: 4 | 5 | ============================================== 6 | Theano Design and Implementation Documentation 7 | ============================================== 8 | 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | tensor 14 | scan 15 | compat 16 | -------------------------------------------------------------------------------- /libs/Theano/doc/developer/tensor.txt: -------------------------------------------------------------------------------- 1 | .. _tensor: 2 | 3 | ======= 4 | Tensor 5 | ======= 6 | 7 | This file describes the design of theano.tensor. 8 | 9 | Elemwise grad and R_op 10 | ====================== 11 | 12 | Here's another straightforward example, though a bit more elaborate 13 | than adding two numbers together. Let's say that you want to compute 14 | the logistic curve, which is given by: 15 | 16 | .. math:: 17 | 18 | s(x) = \frac{1}{1 + e^{-x}} 19 | 20 | -------------------------------------------------------------------------------- /libs/Theano/doc/extending/apply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/extending/apply.png -------------------------------------------------------------------------------- /libs/Theano/doc/extending/pics/symbolic_graph_opt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/extending/pics/symbolic_graph_opt.png -------------------------------------------------------------------------------- /libs/Theano/doc/extending/pics/symbolic_graph_unopt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/extending/pics/symbolic_graph_unopt.png -------------------------------------------------------------------------------- /libs/Theano/doc/generate_dtype_tensor_table.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | letters = [ 4 | ('b', 'int8'), 5 | ('w', 'int16'), 6 | ('i', 'int32'), 7 | ('l', 'int64'), 8 | ('d', 'float64'), 9 | ('f', 'float32'), 10 | ('c', 'complex64'), 11 | ('z', 'complex128') ] 12 | 13 | shapes = [ 14 | ('scalar', ()), 15 | ('vector', (False,)), 16 | ('row', (True, False)), 17 | ('col', (False, True)), 18 | ('matrix', (False,False)), 19 | ('tensor3', (False,False,False)), 20 | ('tensor4', (False,False,False,False)),] 21 | 22 | hdr = '============ =========== ==== =========== =================================' 23 | print(hdr) 24 | print('Constructor dtype ndim shape broadcastable') 25 | print(hdr) 26 | for letter in letters: 27 | for shape in shapes: 28 | suff = ',)' if len(shape[1])==1 else ')' 29 | s = '(' + ','.join('1' if b else '?' for b in shape[1]) + suff 30 | print('%s%-10s %-10s %-4s %-10s %-20s' %( 31 | letter[0], shape[0], letter[1], len(shape[1]), s, shape[1] 32 | )) 33 | print(hdr) 34 | -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/Makefile: -------------------------------------------------------------------------------- 1 | all: presentation.pdf 2 | 3 | presentation.pdf: presentation.tex pics/f_optimized.png pics/logreg_pydotprint_prediction.png 4 | # pics/f_unoptimized.png pics/logreg_pydotprint_predic.png pics/logreg_pydotprint_train.png 5 | pdflatex presentation.tex 6 | 7 | pics/f_optimized.png: simple_example.py 8 | python simple_example.py 9 | 10 | pics/logreg_pydotprint_prediction.png: logreg_example.py 11 | python logreg_example.py 12 | #pics/f_unoptimized.png: simple_example.py 13 | # python simple_example.py 14 | 15 | -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/double_op.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import numpy 3 | import theano 4 | 5 | class DoubleOp(theano.Op): 6 | def __eq__(self, other): 7 | return type(self) == type(other) 8 | def __hash__(self): 9 | return hash(type(self)) 10 | def __str__(self): 11 | return self.__class__.__name__ 12 | def make_node(self, x): 13 | x = theano.tensor.as_tensor_variable(x) 14 | return theano.Apply(self, [x], [x.type()]) 15 | def perform(self, node, inputs, output_storage): 16 | x = inputs[0] 17 | z = output_storage[0] 18 | z[0] = x * 2 19 | 20 | x = theano.tensor.matrix() 21 | 22 | f = theano.function([x], DoubleOp()(x)) 23 | 24 | inp = numpy.random.rand(5,5) 25 | out = f(inp) 26 | assert numpy.allclose(inp*2, out) 27 | print(inp) 28 | print(out) 29 | -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/CPU_VS_GPU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/CPU_VS_GPU.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/Caffeine_Machine_no_background_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/Caffeine_Machine_no_background_red.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/apply_node.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/apply_node.odg -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/apply_node.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/apply_node.pdf -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/apply_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/apply_node.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/bloc_repartition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/bloc_repartition.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/conv.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/conv.pdf -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/conv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/conv.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/f_optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/f_optimized.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/f_unoptimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/f_unoptimized.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/grid_block_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/grid_block_thread.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/lisabook_logo_text_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/lisabook_logo_text_3.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/logreg_pydotprint_predic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/logreg_pydotprint_predic.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/logreg_pydotprint_prediction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/logreg_pydotprint_prediction.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/logreg_pydotprint_train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/logreg_pydotprint_train.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/mlp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/mlp.pdf -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/mlp.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/multiple_graph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/multiple_graph.pdf -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/multiple_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/multiple_graph.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/pipeline.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/pipeline.odg -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/pipeline.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/pipeline.pdf -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/pipeline.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/pycuda-logo-crop.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/pycuda-logo-crop.pdf -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pics/theano_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/hpcs2011_tutorial/pics/theano_logo.png -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/pycuda_simple.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import pycuda.autoinit 3 | import pycuda.driver as drv 4 | import numpy 5 | 6 | from pycuda.compiler import SourceModule 7 | mod = SourceModule(""" 8 | __global__ void multiply_them(float *dest, float *a, float *b) 9 | { 10 | const int i = threadIdx.x; 11 | dest[i] = a[i] * b[i]; 12 | } 13 | """) 14 | 15 | multiply_them = mod.get_function("multiply_them") 16 | 17 | a = numpy.random.randn(400).astype(numpy.float32) 18 | b = numpy.random.randn(400).astype(numpy.float32) 19 | 20 | dest = numpy.zeros_like(a) 21 | multiply_them( 22 | drv.Out(dest), drv.In(a), drv.In(b), 23 | block=(400,1,1), grid=(1,1)) 24 | 25 | assert numpy.allclose(dest, a*b) 26 | print(dest) 27 | -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/scan_poly.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import numpy 3 | 4 | import theano 5 | import theano.tensor as T 6 | 7 | coefficients = theano.tensor.vector("coefficients") 8 | x = T.scalar("x"); max_coefficients_supported = 10000 9 | 10 | # Generate the components of the polynomial 11 | full_range=theano.tensor.arange(max_coefficients_supported) 12 | components, updates = theano.scan(fn=lambda coeff, power, free_var: 13 | coeff * (free_var ** power), 14 | outputs_info=None, 15 | sequences=[coefficients, full_range], 16 | non_sequences=x) 17 | polynomial = components.sum() 18 | calculate_polynomial = theano.function(inputs=[coefficients, x], 19 | outputs=polynomial) 20 | 21 | test_coeff = numpy.asarray([1, 0, 2], dtype=numpy.float32) 22 | print(calculate_polynomial(test_coeff, 3)) 23 | # 19.0 24 | -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/scan_pow.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import theano 3 | import theano.tensor as T 4 | from six.moves import xrange 5 | 6 | k = T.iscalar("k"); A = T.vector("A") 7 | 8 | def inner_fct(prior_result, A): return prior_result * A 9 | # Symbolic description of the result 10 | result, updates = theano.scan(fn=inner_fct, 11 | outputs_info=T.ones_like(A), 12 | non_sequences=A, n_steps=k) 13 | 14 | # Scan has provided us with A**1 through A**k. Keep only the last 15 | # value. Scan notices this and does not waste memory saving them. 16 | final_result = result[-1] 17 | 18 | power = theano.function(inputs=[A,k], outputs=final_result, 19 | updates=updates) 20 | 21 | print(power(list(range(10)), 2)) 22 | -------------------------------------------------------------------------------- /libs/Theano/doc/hpcs2011_tutorial/simple_example.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import theano 3 | a = theano.tensor.vector("a") # declare variable 4 | b = a + a**10 # build symbolic expression 5 | f = theano.function([a], b) # compile function 6 | print(f([0,1,2])) 7 | # prints `array([0,2,1026])` 8 | 9 | theano.printing.pydotprint(b, outfile="pics/f_unoptimized.png", var_with_name_simple=True) 10 | theano.printing.pydotprint(f, outfile="pics/f_optimized.png", var_with_name_simple=True) 11 | -------------------------------------------------------------------------------- /libs/Theano/doc/images/Elman_srnn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/Elman_srnn.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/blocksparse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/blocksparse.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/lstm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/lstm.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/lstm_memorycell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/lstm_memorycell.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/snake_theta2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/snake_theta2.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/talk2010.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/talk2010.gif -------------------------------------------------------------------------------- /libs/Theano/doc/images/talk2010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/talk2010.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/theano-theta-117x117.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/theano-theta-117x117.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/theano_bw_parens_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/theano_bw_parens_transparent.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/theano_logo-200x67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/theano_logo-200x67.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/theano_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/theano_logo.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/theano_logo_allblue_200x46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/theano_logo_allblue_200x46.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/theano_logo_allblue_200x54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/theano_logo_allblue_200x54.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/theano_logo_allblue_350x95.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/theano_logo_allblue_350x95.png -------------------------------------------------------------------------------- /libs/Theano/doc/images/theano_logo_allblue_63x21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/images/theano_logo_allblue_63x21.png -------------------------------------------------------------------------------- /libs/Theano/doc/internal/dev_start_guide.txt: -------------------------------------------------------------------------------- 1 | .. _old_dev_start_guide: 2 | 3 | ============================ 4 | Developer Start Guide MOVED! 5 | ============================ 6 | 7 | 8 | The developer start guide :ref:`moved `. 9 | -------------------------------------------------------------------------------- /libs/Theano/doc/internal/index.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _internal: 3 | 4 | ====================== 5 | Internal Documentation 6 | ====================== 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | release 12 | dev_start_guide 13 | metadocumentation 14 | python 15 | how_to_release 16 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/compile/index.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _libdoc_compile: 3 | 4 | ============================================================== 5 | :mod:`compile` -- Transforming Expression Graphs to Functions 6 | ============================================================== 7 | 8 | .. module:: compile 9 | :platform: Unix, Windows 10 | :synopsis: transforming expression graphs to functions 11 | .. moduleauthor:: LISA 12 | 13 | .. toctree:: 14 | :maxdepth: 1 15 | 16 | shared 17 | function 18 | io 19 | ops 20 | mode 21 | debugmode 22 | profilemode 23 | nanguardmode 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/compile/opfromgraph.txt: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. _opfromgraph: 4 | 5 | =========== 6 | OpFromGraph 7 | =========== 8 | 9 | This page describes :class:`theano.OpFromGraph 10 | `, an Op that allows to 11 | encapsulate a Theano graph in an op. 12 | 13 | This can be used to encapsulate some functionality in one block. It is 14 | useful to scale Theano compilation for regular bigger graphs when we 15 | reuse that encapsulated fonctionality with different inputs many 16 | times. Due to this encapsulation, it can make Theano compilation phase 17 | faster for graphs with many nodes. 18 | 19 | Using this for small graphs is not recommended as it disables 20 | optimizations between what is inside the encapsulation and outside of it. 21 | 22 | .. note: 23 | 24 | This was not used widely up to now. If you have any 25 | questions/comments do not hesitate to contact us on the mailing list. 26 | 27 | 28 | 29 | .. autoclass:: theano.compile.builders.OpFromGraph 30 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/compile/ops.txt: -------------------------------------------------------------------------------- 1 | ================================================== 2 | :mod:`ops` -- Some Common Ops and extra Ops stuff 3 | ================================================== 4 | 5 | .. automodule:: theano.compile.ops 6 | :members: 7 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/d3viz/examples/d3viz/css/d3-context-menu.css: -------------------------------------------------------------------------------- 1 | .d3-context-menu { 2 | position: absolute; 3 | display: none; 4 | background-color: #f2f2f2; 5 | border-radius: 4px; 6 | 7 | font-family: Arial, sans-serif; 8 | font-size: 14px; 9 | min-width: 50px; 10 | border: 1px solid #d4d4d4; 11 | 12 | z-index:1200; 13 | } 14 | 15 | .d3-context-menu ul { 16 | list-style-type: none; 17 | margin: 4px 0px; 18 | padding: 0px; 19 | cursor: default; 20 | } 21 | 22 | .d3-context-menu ul li { 23 | padding: 4px 16px; 24 | } 25 | 26 | .d3-context-menu ul li:hover { 27 | background-color: #4677f8; 28 | color: #fefefe; 29 | } 30 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/d3viz/examples/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/library/d3viz/examples/mlp.png -------------------------------------------------------------------------------- /libs/Theano/doc/library/d3viz/examples/mlp2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/library/d3viz/examples/mlp2.pdf -------------------------------------------------------------------------------- /libs/Theano/doc/library/d3viz/examples/mlp2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/library/d3viz/examples/mlp2.png -------------------------------------------------------------------------------- /libs/Theano/doc/library/d3viz/index_files/index_10_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/library/d3viz/index_files/index_10_0.png -------------------------------------------------------------------------------- /libs/Theano/doc/library/d3viz/index_files/index_11_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/library/d3viz/index_files/index_11_0.png -------------------------------------------------------------------------------- /libs/Theano/doc/library/d3viz/index_files/index_24_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/library/d3viz/index_files/index_24_0.png -------------------------------------------------------------------------------- /libs/Theano/doc/library/d3viz/index_files/index_25_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/library/d3viz/index_files/index_25_0.png -------------------------------------------------------------------------------- /libs/Theano/doc/library/gof/fgraph.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _libdoc_gof_fgraph: 3 | 4 | ================================================ 5 | :mod:`fgraph` -- Graph Container [doc TODO] 6 | ================================================ 7 | 8 | .. module:: fgraph 9 | :platform: Unix, Windows 10 | :synopsis: Theano Internals 11 | .. moduleauthor:: LISA 12 | 13 | 14 | Guide 15 | ===== 16 | 17 | FunctionGraph 18 | ------------- 19 | 20 | .. _libdoc_gof_fgraphfeature: 21 | 22 | FunctionGraph Features 23 | ---------------------- 24 | 25 | .. _libdoc_gof_fgraphfeaturelist: 26 | 27 | FunctionGraph Feature List 28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 29 | * ReplaceValidate 30 | * DestroyHandler 31 | 32 | Reference 33 | ========= 34 | 35 | .. class:: FunctionGraph 36 | 37 | ***TODO*** 38 | 39 | .. note:: FunctionGraph(inputs, outputs) clones the inputs by 40 | default. To avoid this behavior, add the parameter 41 | clone=False. This is needed as we do not want cached constants 42 | in fgraph. 43 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/gof/graph.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_gof_graph: 2 | 3 | ============================================== 4 | :mod:`graph` -- Interface for the Theano graph 5 | ============================================== 6 | 7 | .. module:: graph 8 | :platform: Unix, Windows 9 | :synopsis: Interface for types of symbolic variables 10 | .. moduleauthor:: LISA 11 | 12 | --------- 13 | Reference 14 | --------- 15 | 16 | .. automodule:: theano.gof.graph 17 | :members: 18 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/gof/index.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _libdoc_gof: 3 | 4 | ================================================ 5 | :mod:`gof` -- Theano Internals [doc TODO] 6 | ================================================ 7 | 8 | .. module:: gof 9 | :platform: Unix, Windows 10 | :synopsis: Theano Internals 11 | .. moduleauthor:: LISA 12 | 13 | .. toctree:: 14 | :maxdepth: 1 15 | 16 | graph 17 | fgraph 18 | toolbox 19 | type 20 | utils 21 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/gof/toolbox.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_gof_toolbox: 2 | 3 | ================================================ 4 | :mod:`toolbox` -- [doc TODO] 5 | ================================================ 6 | 7 | .. module:: theano.gof.toolbox 8 | :platform: Unix, Windows 9 | :synopsis: Theano Internals 10 | .. moduleauthor:: LISA 11 | 12 | Guide 13 | ===== 14 | 15 | .. class:: Bookkeeper(object) 16 | 17 | .. class:: History(object) 18 | 19 | .. method:: revert(fgraph, checkpoint) 20 | Reverts the graph to whatever it was at the provided 21 | checkpoint (undoes all replacements). A checkpoint at any 22 | given time can be obtained using self.checkpoint(). 23 | 24 | .. class:: Validator(object) 25 | 26 | .. class:: ReplaceValidate(History, Validator) 27 | 28 | .. method:: replace_validate(fgraph, var, new_var, reason=None) 29 | 30 | .. class:: NodeFinder(Bookkeeper) 31 | 32 | .. class:: PrintListener(object) 33 | 34 | 35 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/gof/type.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_gof_type: 2 | 3 | ================================================ 4 | :mod:`type` -- Interface for types of variables 5 | ================================================ 6 | 7 | .. module:: type 8 | :platform: Unix, Windows 9 | :synopsis: Interface for types of symbolic variables 10 | .. moduleauthor:: LISA 11 | 12 | --------- 13 | Reference 14 | --------- 15 | 16 | .. automodule:: theano.gof.type 17 | :members: 18 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/gof/utils.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_gof_utils: 2 | 3 | ========================================================== 4 | :mod:`utils` -- Utilities functions operating on the graph 5 | ========================================================== 6 | 7 | .. testsetup:: * 8 | 9 | from theano.gof.utils import * 10 | 11 | .. module:: utils 12 | :platform: Unix, Windows 13 | :synopsis: Utilities functions operating on the graph 14 | .. moduleauthor:: LISA 15 | 16 | --------- 17 | Reference 18 | --------- 19 | 20 | .. automodule:: theano.gof.utils 21 | :members: 22 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/misc/pkl_utils.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _libdoc_misc: 3 | 4 | ================================================ 5 | :mod:`misc.pkl_utils` - Tools for serialization. 6 | ================================================ 7 | 8 | .. testsetup:: * 9 | 10 | from theano.misc.pkl_utils import * 11 | 12 | .. autofunction:: theano.misc.pkl_utils.dump 13 | 14 | .. autofunction:: theano.misc.pkl_utils.load 15 | 16 | .. autoclass:: theano.misc.pkl_utils.StripPickler 17 | 18 | .. autoclass:: theano.misc.pkl_utils.CompatUnpickler 19 | 20 | .. seealso:: 21 | 22 | :ref:`tutorial_loadsave` 23 | 24 | 25 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/cuda/index.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _libdoc_sandbox_cuda: 3 | 4 | =========================================== 5 | :mod:`sandbox.cuda` -- The CUDA GPU backend 6 | =========================================== 7 | 8 | .. module:: sandbox.cuda 9 | :platform: Unix, Windows 10 | :synopsis: Code for GPU programming 11 | .. moduleauthor:: LISA 12 | 13 | .. toctree:: 14 | :maxdepth: 1 15 | 16 | op 17 | var 18 | type 19 | dnn 20 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/cuda/op.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _libdoc_cuda_op: 3 | 4 | ====================================================== 5 | :mod:`sandbox.cuda` -- List of CUDA GPU Op implemented 6 | ====================================================== 7 | 8 | .. moduleauthor:: LISA 9 | 10 | Normally you should not call directly those Ops! Theano should automatically transform cpu ops to their gpu equivalent. So this list is just useful to let people know what is implemented on the gpu. 11 | 12 | Basic Op 13 | ======== 14 | 15 | .. automodule:: theano.sandbox.cuda.basic_ops 16 | :members: 17 | 18 | Blas Op 19 | ======= 20 | 21 | .. automodule:: theano.sandbox.cuda.blas 22 | :members: 23 | .. autoclass:: theano.sandbox.cuda.blas.GpuBatchedDot 24 | 25 | Nnet Op 26 | ======= 27 | 28 | .. automodule:: theano.sandbox.cuda.nnet 29 | :members: 30 | 31 | Curand Op 32 | ========= 33 | 34 | Random generator based on the CURAND libraries. It is not inserted automatically. 35 | 36 | .. automodule:: theano.sandbox.cuda.rng_curand 37 | :members: 38 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/cuda/type.txt: -------------------------------------------------------------------------------- 1 | .. ../../../../theano/sandbox/cuda/type.py 2 | .. ../../../../theano/sandbox/cuda/var.py 3 | .. ../../../../theano/sandbox/cuda/ 4 | 5 | .. _libdoc_cuda_type: 6 | 7 | ====================================================================== 8 | :mod:`sandbox.cuda.type` -- The Type object for Cuda-allocated arrays 9 | ====================================================================== 10 | 11 | .. module:: sandbox.cuda.type 12 | :platform: Unix, Windows 13 | :synopsis: The Type object for CUDA-allocated arrays 14 | .. moduleauthor:: LISA 15 | 16 | API 17 | === 18 | 19 | 20 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/cuda/var.txt: -------------------------------------------------------------------------------- 1 | .. ../../../../theano/sandbox/cuda/type.py 2 | .. ../../../../theano/sandbox/cuda/var.py 3 | .. ../../../../theano/sandbox/cuda/ 4 | 5 | .. _libdoc_cuda_var: 6 | 7 | =================================================================== 8 | :mod:`sandbox.cuda.var` -- The Variables for Cuda-allocated arrays 9 | =================================================================== 10 | 11 | .. module:: sandbox.cuda.var 12 | :platform: Unix, Windows 13 | :synopsis: The Variables object for CUDA-allocated arrays 14 | .. moduleauthor:: LISA 15 | 16 | API 17 | === 18 | 19 | .. autoclass:: theano.sandbox.cuda.var.CudaNdarraySharedVariable 20 | :members: get_value, set_value 21 | 22 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/gpuarray/extra.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_gpuarray_extra: 2 | 3 | ================= 4 | Utility functions 5 | ================= 6 | 7 | Optimisation 8 | ------------ 9 | 10 | .. automodule:: theano.sandbox.gpuarray.opt_util 11 | :members: 12 | 13 | Kernel generation 14 | ----------------- 15 | 16 | .. automodule:: theano.sandbox.gpuarray.kernel_codegen 17 | :members: 18 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/gpuarray/index.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _libdoc_gpuarray: 3 | 4 | ======================================================= 5 | :mod:`theano.sandbox.gpuarray` -- The (new) GPU backend 6 | ======================================================= 7 | 8 | .. module:: theano.sandbox.gpuarray 9 | :platform: Unix, Windows 10 | :synopsis: Code for GPU programming (new) 11 | .. moduleauthor:: MILA 12 | 13 | .. toctree:: 14 | :maxdepth: 1 15 | 16 | op 17 | dnn 18 | type 19 | extra 20 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/gpuarray/op.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_gpuarray_op: 2 | 3 | ================================ 4 | List of gpuarray Ops implemented 5 | ================================ 6 | 7 | .. moduleauthor:: LISA 8 | 9 | Normally you should not call directly those Ops! Theano should 10 | automatically transform cpu ops to their gpu equivalent. So this list 11 | is just useful to let people know what is implemented on the gpu. 12 | 13 | Basic Op 14 | ======== 15 | 16 | .. automodule:: theano.sandbox.gpuarray.basic_ops 17 | :members: 18 | 19 | Blas Op 20 | ======= 21 | 22 | .. automodule:: theano.sandbox.gpuarray.blas 23 | :members: 24 | 25 | .. automodule:: theano.sandbox.gpuarray.nerv 26 | :members: 27 | 28 | Elemwise Op 29 | =========== 30 | 31 | .. automodule:: theano.sandbox.gpuarray.elemwise 32 | :members: 33 | 34 | Subtensor Op 35 | ============ 36 | 37 | .. automodule:: theano.sandbox.gpuarray.subtensor 38 | :members: 39 | 40 | Nnet Op 41 | ======= 42 | 43 | .. automodule:: theano.sandbox.gpuarray.nnet 44 | :members: 45 | 46 | .. automodule:: theano.sandbox.gpuarray.neighbours 47 | :members: 48 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/gpuarray/type.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_gpuarray_type: 2 | 3 | =================================================== 4 | :mod:`theano.sandbox.gpuarray.type` -- Type classes 5 | =================================================== 6 | 7 | .. automodule:: theano.sandbox.gpuarray.type 8 | :members: 9 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/index.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _libdoc_sandbox: 3 | 4 | ============================================================== 5 | :mod:`sandbox` -- Experimental Code 6 | ============================================================== 7 | 8 | .. module:: sandbox 9 | :platform: Unix, Windows 10 | :synopsis: Experimental code 11 | .. moduleauthor:: LISA 12 | 13 | .. toctree:: 14 | :maxdepth: 1 15 | 16 | cuda/index 17 | gpuarray/index 18 | linalg 19 | neighbours 20 | rng_mrg 21 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/linalg.txt: -------------------------------------------------------------------------------- 1 | .. ../../../../theano/sandbox/linalg/ops.py 2 | .. ../../../../theano/sandbox/linalg 3 | 4 | .. _libdoc_sandbox_linalg: 5 | 6 | =================================================================== 7 | :mod:`sandbox.linalg` -- Linear Algebra Ops 8 | =================================================================== 9 | 10 | .. module:: sandbox.linalg 11 | :platform: Unix, Windows 12 | :synopsis: Linear Algebra Ops 13 | .. moduleauthor:: LISA 14 | 15 | API 16 | === 17 | 18 | .. automodule:: theano.sandbox.linalg.ops 19 | :members: 20 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/neighbours.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_neighbours: 2 | 3 | =================================================================== 4 | :mod:`sandbox.neighbours` -- Neighbours Ops 5 | =================================================================== 6 | 7 | .. module:: sandbox.neighbours 8 | :platform: Unix, Windows 9 | :synopsis: Neighbours Ops 10 | .. moduleauthor:: LISA 11 | 12 | :ref:`Moved ` 13 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sandbox/rng_mrg.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_rng_mrg: 2 | 3 | =================================================================== 4 | :mod:`sandbox.rng_mrg` -- MRG random number generator 5 | =================================================================== 6 | 7 | .. module:: sandbox.rng_mrg 8 | :platform: Unix, Windows 9 | :synopsis: MRG random number generator 10 | .. moduleauthor:: LISA 11 | 12 | API 13 | === 14 | 15 | .. automodule:: theano.sandbox.rng_mrg 16 | :members: 17 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/scalar/index.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _libdoc_scalar: 3 | 4 | ============================================================== 5 | :mod:`scalar` -- Symbolic Scalar Types, Ops [doc TODO] 6 | ============================================================== 7 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/sparse/sandbox.txt: -------------------------------------------------------------------------------- 1 | .. ../../../../theano/sparse/sandbox/sp.py 2 | .. ../../../../theano/sparse/sandbox/truedot.py 3 | 4 | .. _libdoc_sparse_sandbox: 5 | 6 | =================================================================== 7 | :mod:`sparse.sandbox` -- Sparse Op Sandbox 8 | =================================================================== 9 | 10 | .. module:: sparse.sandbox 11 | :platform: Unix, Windows 12 | :synopsis: Sparse Op Sandbox 13 | .. moduleauthor:: LISA 14 | 15 | API 16 | === 17 | 18 | .. automodule:: theano.sparse.sandbox.sp 19 | :members: 20 | .. automodule:: theano.sparse.sandbox.sp2 21 | :members: 22 | .. automodule:: theano.sparse.sandbox.truedot 23 | :members: 24 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/bcast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/library/tensor/bcast.png -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/extra_ops.txt: -------------------------------------------------------------------------------- 1 | =================================================================== 2 | :mod:`tensor.extra_ops` -- Tensor Extra Ops 3 | =================================================================== 4 | 5 | .. testsetup:: * 6 | 7 | from theano.tensor.extra_ops import * 8 | 9 | .. module:: tensor.extra_ops 10 | :platform: Unix, Windows 11 | :synopsis: Tensor Extra Ops 12 | .. moduleauthor:: LISA 13 | 14 | .. automodule:: theano.tensor.extra_ops 15 | :members: 16 | 17 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/index.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_tensor: 2 | 3 | ================================================== 4 | :mod:`tensor` -- Types and Ops for Symbolic numpy 5 | ================================================== 6 | 7 | .. module:: tensor 8 | :platform: Unix, Windows 9 | :synopsis: symbolic types and operations for n-dimensional arrays. 10 | .. moduleauthor:: LISA 11 | 12 | Theano's strength is in expressing symbolic calculations involving tensors. 13 | There are many types of symbolic expressions for tensors. 14 | They are grouped into the following sections: 15 | 16 | 17 | .. toctree:: 18 | :maxdepth: 1 19 | 20 | basic 21 | nnet/index 22 | raw_random 23 | shared_randomstreams 24 | signal/index 25 | utils 26 | extra_ops 27 | io 28 | opt 29 | slinalg 30 | nlinalg 31 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/io.txt: -------------------------------------------------------------------------------- 1 | =================================================================== 2 | :mod:`tensor.io` -- Tensor IO Ops 3 | =================================================================== 4 | 5 | .. module:: tensor.io 6 | :platform: Unix, Windows 7 | :synopsis: Tensor IO Ops 8 | .. moduleauthor:: LISA 9 | 10 | File operation 11 | ============== 12 | 13 | - Load from disk with the function :func:`load ` and its associated op :class:`LoadFromDisk ` 14 | 15 | MPI operation 16 | ============= 17 | - Non-blocking transfer: :func:`isend ` and :func:`irecv `. 18 | - Blocking transfer: :func:`send ` and :func:`recv ` 19 | 20 | Details 21 | ======= 22 | 23 | .. automodule:: theano.tensor.io 24 | :members: 25 | 26 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/nlinalg.txt: -------------------------------------------------------------------------------- 1 | .. ../../../../theano/sandbox/nlinalg.py 2 | 3 | .. _libdoc_linalg: 4 | 5 | =================================================================== 6 | :mod:`tensor.nlinalg` -- Linear Algebra Ops Using Numpy 7 | =================================================================== 8 | 9 | .. module:: tensor.nlinalg 10 | :platform: Unix, Windows 11 | :synopsis: Linear Algebra Ops Using Numpy 12 | .. moduleauthor:: LISA 13 | 14 | .. note:: 15 | 16 | This module is not imported by default. You need to import it to use it. 17 | 18 | API 19 | === 20 | 21 | .. automodule:: theano.tensor.nlinalg 22 | :members: 23 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/nnet/blocksparse.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_blocksparse: 2 | 3 | =============================================================================== 4 | :mod:`blocksparse` -- Block sparse dot operations (gemv and outer) 5 | =============================================================================== 6 | 7 | .. module:: tensor.nnet.blocksparse 8 | :platform: Unix, Windows 9 | :synopsis: Block sparse dot 10 | .. moduleauthor:: LISA 11 | 12 | 13 | .. automodule:: theano.tensor.nnet.blocksparse 14 | :members: 15 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/nnet/bn.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_tensor_nnet_bn: 2 | 3 | ================================ 4 | :mod:`bn` -- Batch Normalization 5 | ================================ 6 | 7 | .. module:: tensor.nnet.bn 8 | :platform: Unix, Windows 9 | :synopsis: Batch Normalization 10 | .. moduleauthor:: LISA 11 | 12 | 13 | .. autofunction:: theano.tensor.nnet.bn.batch_normalization 14 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/nnet/index.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_tensor_nnet: 2 | 3 | ================================================== 4 | :mod:`nnet` -- Ops related to neural networks 5 | ================================================== 6 | 7 | .. module:: nnet 8 | :platform: Unix, Windows 9 | :synopsis: various ops relating to neural networks 10 | .. moduleauthor:: LISA 11 | 12 | Theano was originally developped for machine learning applications, particularly 13 | for the topic of deep learning. As such, our lab has developed many functions 14 | and ops which are particular to neural networks and deep learning. 15 | 16 | .. toctree:: 17 | :maxdepth: 1 18 | 19 | conv 20 | nnet 21 | neighbours 22 | bn 23 | blocksparse 24 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/nnet/neighbours.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_tensor_nnet_neighbours: 2 | 3 | ======================================================================= 4 | :mod:`neighbours` -- Ops for working with images in convolutional nets 5 | ======================================================================= 6 | 7 | .. module:: theano.tensor.nnet.neighbours 8 | :platform: Unix, Windows 9 | :synopsis: Ops for working with images in conv nets 10 | .. moduleauthor:: LISA 11 | 12 | 13 | Functions 14 | ========= 15 | 16 | .. autofunction:: theano.tensor.nnet.neighbours.images2neibs 17 | 18 | .. autofunction:: theano.tensor.nnet.neighbours.neibs2images 19 | 20 | 21 | See also 22 | ======== 23 | 24 | - :ref:`indexing` 25 | - :ref:`lib_scan` 26 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/nnet/sigmoid_prec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/library/tensor/nnet/sigmoid_prec.png -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/opt.txt: -------------------------------------------------------------------------------- 1 | =================================================================== 2 | :mod:`tensor.opt` -- Tensor Optimizations 3 | =================================================================== 4 | 5 | .. module:: tensor.opt 6 | :platform: Unix, Windows 7 | :synopsis: Tensor Optimizations 8 | .. moduleauthor:: LISA 9 | 10 | .. automodule:: theano.tensor.opt 11 | :members: 12 | 13 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/signal/conv.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_tensor_signal_conv: 2 | 3 | ====================================================== 4 | :mod:`conv` -- Convolution 5 | ====================================================== 6 | 7 | .. note:: 8 | 9 | Two similar implementation exists for conv2d: 10 | 11 | :func:`signal.conv2d ` and 12 | :func:`nnet.conv2d `. 13 | 14 | The former implements a traditional 15 | 2D convolution, while the latter implements the convolutional layers 16 | present in convolutional neural networks (where filters are 3D and pool 17 | over several input channels). 18 | 19 | .. module:: conv 20 | :platform: Unix, Windows 21 | :synopsis: ops for performing convolutions 22 | .. moduleauthor:: LISA 23 | 24 | .. autofunction:: theano.tensor.signal.conv.conv2d 25 | 26 | .. function:: fft(*todo) 27 | 28 | [James has some code for this, but hasn't gotten it into the source tree yet.] 29 | 30 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/signal/downsample.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_tensor_signal_downsample: 2 | 3 | ====================================================== 4 | :mod:`downsample` -- Down-Sampling 5 | ====================================================== 6 | 7 | .. module:: downsample 8 | :platform: Unix, Windows 9 | :synopsis: ops for performing various forms of downsampling 10 | .. moduleauthor:: LISA 11 | 12 | .. seealso:: :func:`theano.tensor.nnet.neighbours.images2neibs` 13 | 14 | .. autofunction:: theano.tensor.signal.downsample.max_pool_2d 15 | .. autofunction:: theano.tensor.signal.downsample.max_pool_2d_same_size 16 | 17 | .. function:: fft(*todo) 18 | 19 | [James has some code for this, but hasn't gotten it into the source tree yet.] 20 | 21 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/signal/index.txt: -------------------------------------------------------------------------------- 1 | .. _libdoc_tensor_signal: 2 | 3 | ===================================================== 4 | :mod:`signal` -- Signal Processing 5 | ===================================================== 6 | 7 | Signal Processing 8 | ----------------- 9 | 10 | .. module:: signal 11 | :platform: Unix, Windows 12 | :synopsis: various ops for performing basic signal processing 13 | (convolutions, subsampling, fft, etc.) 14 | .. moduleauthor:: LISA 15 | 16 | The signal subpackage contains ops which are useful for performing various 17 | forms of signal processing. 18 | 19 | .. toctree:: 20 | :maxdepth: 1 21 | 22 | conv 23 | downsample 24 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/slinalg.txt: -------------------------------------------------------------------------------- 1 | .. ../../../../theano/sandbox/slinalg.py 2 | 3 | .. _libdoc_slinalg: 4 | 5 | =================================================================== 6 | :mod:`tensor.slinalg` -- Linear Algebra Ops Using Scipy 7 | =================================================================== 8 | 9 | .. module:: tensor.slinalg 10 | :platform: Unix, Windows 11 | :synopsis: Linear Algebra Ops Using Scipy 12 | .. moduleauthor:: LISA 13 | 14 | .. note:: 15 | 16 | This module is not imported by default. You need to import it to use it. 17 | 18 | API 19 | === 20 | 21 | .. automodule:: theano.tensor.slinalg 22 | :members: 23 | -------------------------------------------------------------------------------- /libs/Theano/doc/library/tensor/utils.txt: -------------------------------------------------------------------------------- 1 | =================================================================== 2 | :mod:`tensor.utils` -- Tensor Utils 3 | =================================================================== 4 | 5 | .. testsetup:: 6 | 7 | from theano.tensor.utils import * 8 | 9 | .. module:: tensor.utils 10 | :platform: Unix, Windows 11 | :synopsis: Tensor Utils 12 | .. moduleauthor:: LISA 13 | 14 | .. automodule:: theano.tensor.utils 15 | :members: 16 | 17 | -------------------------------------------------------------------------------- /libs/Theano/doc/nextml2015/Makefile: -------------------------------------------------------------------------------- 1 | presentation.pdf: presentation.tex 2 | pdflatex presentation.tex 3 | pdflatex presentation.tex 4 | 5 | clean: 6 | rm *.toc *.snm *.aux *.log *.nav *.out *.vrb 7 | -------------------------------------------------------------------------------- /libs/Theano/doc/nextml2015/theano_grad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/nextml2015/theano_grad.png -------------------------------------------------------------------------------- /libs/Theano/doc/nice_quotes.txt: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | "Thank YOU for correcting it so quickly. I wish all packages I worked 4 | with would have such an active maintenance - this is as good as it 5 | gets :-)" 6 | -- Jan Antolik, [theano-users] strange behaviour, Mon, Aug 2, 2010 at 1:36 PM 7 | 8 | ------------------------- 9 | 10 | "Theano rocks incredibly. It's like the holy grail of linear algebra 11 | computations." 12 | 13 | -- visionlessvisionary on reddit 14 | 15 | http://www.reddit.com/r/MachineLearning/comments/banhb/deep_learning_tutorial_learn_to_build_complex/c0lsvik 16 | 17 | ------------------------- 18 | 19 | I am completely new to theano and after running the deep-learning 20 | tutorial and see the examples actually work on my GTX 275 I must say I 21 | am 100% sold on the theano approach; this is an amazing project that 22 | deserves broad recognition among the scientific python community. 23 | 24 | -- Olivier Grisel 25 | 26 | 27 | -------------------------------------------------------------------------------- /libs/Theano/doc/omlw2014/Makefile: -------------------------------------------------------------------------------- 1 | all: presentation.pdf sharing.pdf 2 | 3 | clean: 4 | rm -f pygpu_ndarray.so core.* *.o *~ 5 | 6 | cleantmp: 7 | rm -f core.* *.o *~ 8 | 9 | presentation.pdf: presentation.tex 10 | pdflatex presentation 11 | pdflatex presentation 12 | 13 | sharing.pdf: sharing.tex 14 | pdflatex sharing 15 | pdflatex sharing 16 | -------------------------------------------------------------------------------- /libs/Theano/doc/omlw2014/omlw_presentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/omlw2014/omlw_presentation.pdf -------------------------------------------------------------------------------- /libs/Theano/doc/omlw2014/pr_conv_gemm_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/omlw2014/pr_conv_gemm_profile.png -------------------------------------------------------------------------------- /libs/Theano/doc/omlw2014/road-runner-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/omlw2014/road-runner-1.jpg -------------------------------------------------------------------------------- /libs/Theano/doc/proposals/dp_optimization.txt: -------------------------------------------------------------------------------- 1 | 2 | ======================== 3 | DP Instruction Selection 4 | ======================== 5 | 6 | Read Ch 9 of Modern Compiler Implementation about instruction selection. 7 | We should probably be doing graph optimization totally differently: 8 | Optimizations *only add* new ways of implementing something, they do not replace 9 | the old way. Every graph node (apply) as a cost, and Dynamic Programming (DP) 10 | is used to select the minimum cost graph. 11 | 12 | The advantage of this approach is that optimizations do not have to run in such 13 | a careful order, and graph selection would be much faster. 14 | 15 | 16 | Think about how aliasing and destructive operations (the destroy-handler) would 17 | fit in this approach. 18 | 19 | -------------------------------------------------------------------------------- /libs/Theano/doc/proposals/index.txt: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. _proposals: 4 | 5 | ================================== 6 | Proposals for new/revised features 7 | ================================== 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | :glob: 12 | 13 | * 14 | 15 | -------------------------------------------------------------------------------- /libs/Theano/doc/proposals/intermediate_language.txt: -------------------------------------------------------------------------------- 1 | 2 | ===================== 3 | Intermediate Language 4 | ===================== 5 | 6 | 7 | It would be nice to be able to use Theano from other languages. 8 | This requires two things: a way to communicate the expression to the theano 9 | compiler, and a way to pass data to and from the compiled function. 10 | 11 | One way to do this would be define a textual representation of theano graphs. 12 | A Scheme-like language seems appropriate. Perhaps just scheme would be 13 | appropriate. 14 | 15 | 16 | How to pass shared variables? 17 | 18 | -------------------------------------------------------------------------------- /libs/Theano/doc/proposals/mongodb_cache.txt: -------------------------------------------------------------------------------- 1 | 2 | ================= 3 | MongoDB DLL Cache 4 | ================= 5 | 6 | 7 | In network environments (like at DIRO on NFS3), a distributed DB like mongo or couch is faster and more 8 | robust to concurrency than the $HOME/.theano. Also, a single cache could be 9 | shared by multiple users. This would result in less compilation time, for 10 | everyone, and less stale-cache problems. 11 | 12 | -------------------------------------------------------------------------------- /libs/Theano/doc/proposals/premerge.txt: -------------------------------------------------------------------------------- 1 | 2 | Proactive Merging 3 | ================= 4 | 5 | 6 | Merge is done now as an optimization. 7 | But if Merging was done at graph construction time, things like #476 would work. 8 | Additionally, memo-izing at graph construction time would make it possible to 9 | define recursive formula with recursive python functions (e.g. Fibonacci). 10 | Currently the merge optimization would make the Fibonacci series linear, but the 11 | size of the program used to express the program would be exponential. 12 | 13 | -------------------------------------------------------------------------------- /libs/Theano/doc/proposals/tensor_attributes.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ======================== 4 | Add tensor attributes 5 | ======================== 6 | 7 | 8 | Size, shape, psd, symmetric, triangular, contiguous. 9 | Add these attributes to the TensorType with the option always that they be 10 | 'unknown'. 11 | Add attributes that are useful for optimizations, or useful for code generation. 12 | 13 | 14 | -------------------------------------------------------------------------------- /libs/Theano/doc/sandbox/compilation.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _compilation: 3 | 4 | ======================= 5 | Compilation and Linking 6 | ======================= 7 | 8 | .. index:: 9 | single: Linker 10 | 11 | .. _linker: 12 | 13 | Linker 14 | ====== 15 | 16 | WRITEME 17 | 18 | 19 | -------------------------------------------------------------------------------- /libs/Theano/doc/sandbox/fg.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _fgraph: 3 | 4 | ============= 5 | FunctionGraph 6 | ============= 7 | 8 | TODO: clean up/update the doc/check if complete 9 | WRITEME 10 | 11 | .. autoclass:: theano.gof.fg.FunctionGraph 12 | 13 | .. _fgraphfeature: 14 | 15 | Feature 16 | ======= 17 | 18 | .. autoclass:: theano.gof.toolbox.Feature 19 | :members: 20 | -------------------------------------------------------------------------------- /libs/Theano/doc/sandbox/function.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _function: 3 | 4 | ================== 5 | function interface 6 | ================== 7 | 8 | WRITEME 9 | 10 | -------------------------------------------------------------------------------- /libs/Theano/doc/sandbox/functional.txt: -------------------------------------------------------------------------------- 1 | 2 | ========== 3 | Functional 4 | ========== 5 | 6 | Want to know about Theano's `function design 7 | `? 8 | -------------------------------------------------------------------------------- /libs/Theano/doc/sandbox/index.txt: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ========================================================= 4 | Sandbox, this documentation may or may not be out-of-date 5 | ========================================================= 6 | 7 | .. toctree:: 8 | :glob: 9 | 10 | * 11 | 12 | -------------------------------------------------------------------------------- /libs/Theano/doc/sandbox/index2.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _advanced: 3 | 4 | ==================================== 5 | Advanced Topics (under construction) 6 | ==================================== 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | fg 12 | compilation 13 | ccodegen 14 | function 15 | debugging_with_stepmode 16 | 17 | -------------------------------------------------------------------------------- /libs/Theano/doc/sandbox/performance.txt: -------------------------------------------------------------------------------- 1 | 2 | =========== 3 | Performance 4 | =========== 5 | 6 | Theano uses several tricks to obtain good performance: 7 | * common sub-expression elimination 8 | * [custom generated] C code for many operations 9 | * pre-allocation of temporary storage 10 | * loop fusion (which gcc normally can't do) 11 | 12 | On my neural net experiments for my course projects, I was getting around 10x 13 | speed improvements over basic numpy by using theano. 14 | [More specific speed tests would be nice.] 15 | 16 | 17 | With a little work, Theano could also implement more sophisticated 18 | optimizations: 19 | 20 | * automatic ordering of matrix multiplications 21 | * profile-based memory layout decisions (e.g. row-major vs. col-major) 22 | * gcc intrinsics to use MMX, SSE2 parallelism for faster element-wise arithmetic 23 | * conditional expressions 24 | -------------------------------------------------------------------------------- /libs/Theano/doc/sandbox/software.txt: -------------------------------------------------------------------------------- 1 | =============== 2 | Others software 3 | =============== 4 | 5 | Other software to look at and maybe recommend to users: 6 | 7 | * [http://www.pytables.org/moin PyTables] - This is looking really 8 | promising for dataset storage and experiment logging... This might 9 | actually be useful for large data sets. 10 | * [http://matplotlib.sourceforge.net/ MatPlotLib] - visualization tools 11 | (plot curves interactively, like matlab's figure window) 12 | * [http://www.pythonware.com/products/pil/ PIL] - Python Image Library: 13 | write your matrices out in png! (Kinda a weird recommendation, I think) 14 | * [http://www.logilab.org/857 pylint] - Syntax checker for python to 15 | help beautify your code. (We'd be hypocrites to recommend this :) 16 | * [http://www.winpdb.org/ Winpdb] - A Platform Independent Python 17 | Debugger. (Except it doesn't really help you debug Theano graphs) 18 | * [http://wiki.python.org/moin/IntegratedDevelopmentEnvironments Python 19 | Integrated Development Environments] - for all your coding needs 20 | 21 | -------------------------------------------------------------------------------- /libs/Theano/doc/sandbox/tensoroptools.txt: -------------------------------------------------------------------------------- 1 | 2 | .. _tensoroptools: 3 | 4 | ================ 5 | Tensor Op Tools 6 | ================ 7 | 8 | WRITEME - describe how to use Elemwise here 9 | 10 | -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/adding_solution_1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Theano tutorial 3 | # Solution to Exercise in section 'Baby Steps - Algebra' 4 | 5 | from __future__ import print_function 6 | import theano 7 | a = theano.tensor.vector() # declare variable 8 | b = theano.tensor.vector() # declare variable 9 | out = a ** 2 + b ** 2 + 2 * a * b # build symbolic expression 10 | f = theano.function([a, b], out) # compile function 11 | print(f([1, 2], [4, 5])) # prints [ 25. 49.] 12 | -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/apply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/tutorial/apply.png -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/dlogistic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/tutorial/dlogistic.png -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/extending_theano.txt: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | This page has been moved. Please refer to: :ref:`extending_theano`. 4 | -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/extending_theano_c.txt: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | This page has been moved. Please refer to: :ref:`extending_theano_c`. 4 | -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/logistic.gp: -------------------------------------------------------------------------------- 1 | set terminal svg font "Bitstream Vera Sans,10" size 300,200 2 | set output "logistic.svg" 3 | 4 | set xrange [-6:6] 5 | set xzeroaxis linetype -1 6 | set yzeroaxis linetype -1 7 | set xtics axis nomirror 8 | set ytics axis nomirror 0,0.5,1 9 | set key off 10 | set grid 11 | set border 1 12 | 13 | set samples 400 14 | 15 | plot 1/(1 + exp(-x)) with line linetype rgbcolor "blue" linewidth 2 16 | 17 | set ytics axis nomirror 0,0.25 18 | set output "dlogistic.svg" 19 | plot 1/(1 + exp(-x)) * (1 - 1/(1 + exp(-x))) with line linetype rgbcolor "blue" linewidth 2 20 | -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/logistic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/tutorial/logistic.png -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/pics/d3viz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/tutorial/pics/d3viz.png -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/pics/logreg_pydotprint_predict.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/tutorial/pics/logreg_pydotprint_predict.png -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/pics/logreg_pydotprint_prediction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/tutorial/pics/logreg_pydotprint_prediction.png -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/pics/logreg_pydotprint_train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/doc/tutorial/pics/logreg_pydotprint_train.png -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/profiling_example.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | 3 | import theano 4 | 5 | x, y, z = theano.tensor.vectors('xyz') 6 | f = theano.function([x, y, z], [(x + y + z) * 2]) 7 | xv = numpy.random.rand(10).astype(theano.config.floatX) 8 | yv = numpy.random.rand(10).astype(theano.config.floatX) 9 | zv = numpy.random.rand(10).astype(theano.config.floatX) 10 | f(xv, yv, zv) 11 | -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/python.txt: -------------------------------------------------------------------------------- 1 | .. _python: 2 | 3 | 4 | *************** 5 | Python tutorial 6 | *************** 7 | 8 | In this documentation, we suppose that the reader knows Python. Here is a small list of Python 9 | tutorials/exercises if you need to learn it or only need a refresher: 10 | 11 | * `Python Challenge `__ 12 | * `Dive into Python `__ 13 | * `Google Python Class `__ 14 | * `Enthought Python course `__ (free for academics) 15 | 16 | We have a tutorial on how :ref:`Python manages its memory `. 17 | -------------------------------------------------------------------------------- /libs/Theano/doc/tutorial/symbolic_graphs.txt: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | This page has been moved. Please refer to: :ref:`graphstructures`. 4 | -------------------------------------------------------------------------------- /libs/Theano/requirement-rtd.txt: -------------------------------------------------------------------------------- 1 | sphinx>=1.3.0 2 | nose>=1.3.0 3 | -------------------------------------------------------------------------------- /libs/Theano/setup.cfg: -------------------------------------------------------------------------------- 1 | [nosetest] 2 | match=^test 3 | nocapture=1 4 | 5 | [flake8] 6 | ignore=E501,E123,E133 7 | -------------------------------------------------------------------------------- /libs/Theano/theano/compile/__init__.py: -------------------------------------------------------------------------------- 1 | from theano.compile.ops import ( 2 | DeepCopyOp, deep_copy_op, register_deep_copy_op_c_code, 3 | Shape, shape, register_shape_c_code, 4 | Shape_i, register_shape_i_c_code, 5 | ViewOp, view_op, register_view_op_c_code, FromFunctionOp, 6 | as_op, Rebroadcast, register_rebroadcast_c_code, 7 | SpecifyShape, specify_shape, register_specify_shape_c_code) 8 | 9 | from theano.compile.function_module import * 10 | 11 | from theano.compile.mode import * 12 | 13 | from theano.compile.io import * 14 | 15 | from theano.compile.debugmode import DebugMode 16 | 17 | from theano.compile.monitormode import MonitorMode 18 | 19 | from theano.compile.profiling import ProfileStats, ScanProfileStats 20 | 21 | from theano.compile.profilemode import ProfileMode 22 | 23 | from theano.compile.sharedvalue import (shared, shared_constructor, 24 | SharedVariable) 25 | from theano.compile.pfunc import pfunc, Param, rebuild_collect_shared 26 | 27 | from theano.compile.builders import * 28 | 29 | from theano.compile.function import function, function_dump 30 | -------------------------------------------------------------------------------- /libs/Theano/theano/compile/sandbox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/compile/sandbox/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/compile/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/compile/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/compile/tests/test_function_name.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import os 4 | import re 5 | 6 | import theano 7 | from theano import tensor 8 | 9 | 10 | class FunctionName(unittest.TestCase): 11 | def test_function_name(self): 12 | x = tensor.vector('x') 13 | func = theano.function([x], x + 1.) 14 | 15 | regex = re.compile(os.path.basename('.*test_function_name.pyc?:13')) 16 | assert(regex.match(func.name) is not None) 17 | -------------------------------------------------------------------------------- /libs/Theano/theano/d3viz/__init__.py: -------------------------------------------------------------------------------- 1 | from theano.d3viz.d3viz import d3viz, d3write 2 | -------------------------------------------------------------------------------- /libs/Theano/theano/d3viz/css/d3-context-menu.css: -------------------------------------------------------------------------------- 1 | .d3-context-menu { 2 | position: absolute; 3 | display: none; 4 | background-color: #f2f2f2; 5 | border-radius: 4px; 6 | 7 | font-family: Arial, sans-serif; 8 | font-size: 14px; 9 | min-width: 50px; 10 | border: 1px solid #d4d4d4; 11 | 12 | z-index:1200; 13 | } 14 | 15 | .d3-context-menu ul { 16 | list-style-type: none; 17 | margin: 4px 0px; 18 | padding: 0px; 19 | cursor: default; 20 | } 21 | 22 | .d3-context-menu ul li { 23 | padding: 4px 16px; 24 | } 25 | 26 | .d3-context-menu ul li:hover { 27 | background-color: #4677f8; 28 | color: #fefefe; 29 | } 30 | -------------------------------------------------------------------------------- /libs/Theano/theano/d3viz/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/d3viz/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/gof/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/gof/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/gof/tests/test_compiledir.py: -------------------------------------------------------------------------------- 1 | from theano.configdefaults import short_platform 2 | 3 | 4 | def test_short_platform(): 5 | for r, p, a in [ # (release, platform, answer) 6 | ('3.2.0-70-generic', 7 | 'Linux-3.2.0-70-generic-x86_64-with-debian-wheezy-sid', 8 | "Linux-3.2--generic-x86_64-with-debian-wheezy-sid"), 9 | ('3.2.0-70.1-generic', 10 | 'Linux-3.2.0-70.1-generic-x86_64-with-debian-wheezy-sid', 11 | "Linux-3.2--generic-x86_64-with-debian-wheezy-sid"), 12 | ('3.2.0-70.1.2-generic', 13 | 'Linux-3.2.0-70.1.2-generic-x86_64-with-debian-wheezy-sid', 14 | "Linux-3.2--generic-x86_64-with-debian-wheezy-sid"), 15 | ('2.6.35.14-106.fc14.x86_64', 16 | 'Linux-2.6.35.14-106.fc14.x86_64-x86_64-with-fedora-14-Laughlin', 17 | 'Linux-2.6-fc14.x86_64-x86_64-with-fedora-14-Laughlin'), 18 | ]: 19 | o = short_platform(r, p) 20 | assert o == a, (o, a) 21 | -------------------------------------------------------------------------------- /libs/Theano/theano/gof/tests/test_fg_old_crash.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/gof/tests/test_fg_old_crash.pkl -------------------------------------------------------------------------------- /libs/Theano/theano/gof/theano_mod_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef THEANO_MOD_HELPER 2 | #define THEANO_MOD_HELPER 3 | 4 | #include 5 | 6 | #ifndef _WIN32 7 | #define MOD_PUBLIC __attribute__((visibility ("default"))) 8 | #else 9 | /* MOD_PUBLIC is only used in PyMODINIT_FUNC, which is declared 10 | * and implemented in mod.cu/cpp, not in headers, so dllexport 11 | * is always correct. */ 12 | #define MOD_PUBLIC __declspec( dllexport ) 13 | #endif 14 | 15 | #ifdef __cplusplus 16 | #define THEANO_EXTERN extern "C" 17 | #else 18 | #define THEANO_EXTERN 19 | #endif 20 | 21 | #if PY_MAJOR_VERSION < 3 22 | #define THEANO_RTYPE void 23 | #else 24 | #define THEANO_RTYPE PyObject * 25 | #endif 26 | 27 | /* We need to redefine PyMODINIT_FUNC to add MOD_PUBLIC in the middle */ 28 | #undef PyMODINIT_FUNC 29 | #define PyMODINIT_FUNC THEANO_EXTERN MOD_PUBLIC THEANO_RTYPE 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libs/Theano/theano/misc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/misc/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/misc/buildbot_filter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import sys 4 | 5 | 6 | def filter_output(fd_in): 7 | s = "" 8 | for line in fd_in: 9 | toks = line.split() 10 | if len(toks): 11 | if toks[0] == "File" and toks[-1].startswith('test'): 12 | s += line 13 | elif toks[0].startswith("ImportError"): 14 | s += line 15 | elif toks[0] in ["KnownFailureTest:", "Exception:", "Failure:", 16 | "AssertionError", "AssertionError:", 17 | "GradientError:"]: 18 | s += line 19 | elif toks[0] == "Executing" and toks[1] in ["tests", 'nosetests']: 20 | s += line 21 | return s 22 | 23 | if __name__ == "__main__": 24 | import pdb 25 | pdb.set_trace() 26 | if len(sys.argv) > 1: 27 | with open(sys.argv[1]) as f: 28 | print(filter_output(f)) 29 | else: 30 | print(filter_output(sys.stdin)) 31 | -------------------------------------------------------------------------------- /libs/Theano/theano/misc/check_blas_many.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python misc/check_blas.py --print_only 4 | 5 | cat /proc/cpuinfo |grep "model name" |uniq 6 | cat /proc/cpuinfo |grep processor 7 | free 8 | uname -a 9 | 10 | TIME_PREFIX=time 11 | VAR=OMP_NUM_THREADS 12 | echo "numpy gemm take=" 13 | THEANO_FLAGS=blas.ldflags= $TIME_PREFIX python misc/check_blas.py --quiet 14 | for i in 1 2 4 8 15 | do 16 | export $VAR=$i 17 | x=`$TIME_PREFIX python misc/check_blas.py --quiet` 18 | echo "theano gemm with $VAR=$i took: ${x}s" 19 | done 20 | 21 | #Fred to test distro numpy at LISA: PYTHONPATH=/u/bastienf/repos:/usr/lib64/python2.5/site-packages THEANO_FLAGS=blas.ldflags= OMP_NUM_THREADS=8 time python misc/check_blas.py 22 | -------------------------------------------------------------------------------- /libs/Theano/theano/misc/latence_gpu_transfert.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | import time 4 | 5 | import numpy 6 | 7 | import theano 8 | 9 | y = theano.tensor.fvector() 10 | x = theano.shared(numpy.zeros(1, dtype='float32')) 11 | f1 = theano.function([y], updates={x: y}) 12 | f2 = theano.function([], theano.sandbox.cuda.host_from_gpu(x)) 13 | print(f1.maker.fgraph.toposort()) 14 | print(f2.maker.fgraph.toposort()) 15 | for i in [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000]: 16 | o = numpy.zeros(i, dtype='float32') 17 | t0 = time.time() 18 | f1(o) 19 | t1 = time.time() 20 | tf1 = t1 - t0 21 | t0 = time.time() 22 | f2() 23 | t1 = time.time() 24 | 25 | print("%8i %6.1f ns %7.1f ns" % (i, tf1 * 1e6, (t1 - t0) * 1e6)) 26 | -------------------------------------------------------------------------------- /libs/Theano/theano/misc/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/misc/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/raise_op.py: -------------------------------------------------------------------------------- 1 | """Symbolic Op for raising an exception.""" 2 | 3 | from theano import gof 4 | 5 | __authors__ = "James Bergstra" 6 | __copyright__ = "(c) 2011, Universite de Montreal" 7 | __license__ = "3-clause BSD License" 8 | __contact__ = "theano-dev " 9 | 10 | __docformat__ = "restructuredtext en" 11 | 12 | 13 | class Raise(gof.Op): 14 | """Op whose perform() raises an exception. 15 | """ 16 | __props__ = ('msg', 'exc') 17 | 18 | def __init__(self, msg="", exc=NotImplementedError): 19 | """ 20 | msg - the argument to the exception 21 | exc - an exception class to raise in self.perform 22 | """ 23 | self.msg = msg 24 | self.exc = exc 25 | 26 | def __str__(self): 27 | return "Raise{%s(%s)}" % (self.exc, self.msg) 28 | 29 | def make_node(self, x): 30 | return gof.Apply(self, [x], [x.type()]) 31 | 32 | def perform(self, node, inputs, out_storage): 33 | raise self.exc(self.msg) 34 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/sandbox/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/blocksparse.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | from theano.tensor.nnet.blocksparse import ( 3 | SparseBlockGemv, SparseBlockOuter, sparse_block_dot, sparse_block_gemv, 4 | sparse_block_gemv_inplace, sparse_block_outer, sparse_block_outer_inplace) 5 | 6 | __all__ = [SparseBlockGemv, SparseBlockOuter, sparse_block_dot, 7 | sparse_block_gemv, sparse_block_gemv_inplace, sparse_block_outer, 8 | sparse_block_outer_inplace] 9 | 10 | warnings.warn("DEPRECATION: theano.sandbox.blocksparse does not exist anymore," 11 | "it has been moved to theano.tensor.nnet.blocksparse.", 12 | category=DeprecationWarning) 13 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/conv.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import sys 3 | print("DEPRECATION: theano.sandbox.conv no longer provides conv. They have been moved to theano.tensor.nnet.conv", file=sys.stderr) 4 | from theano.tensor.nnet.conv import * 5 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/cuda/tests/CudaNdarray.pkl: -------------------------------------------------------------------------------- 1 | ctheano.sandbox.cuda.type 2 | CudaNdarray_unpickler 3 | p1 4 | (cnumpy.core.multiarray 5 | _reconstruct 6 | p2 7 | (cnumpy 8 | ndarray 9 | p3 10 | (I0 11 | tS'b' 12 | tRp4 13 | (I1 14 | (I1 15 | tcnumpy 16 | dtype 17 | p5 18 | (S'f4' 19 | I0 20 | I1 21 | tRp6 22 | (I3 23 | S'<' 24 | NNNI-1 25 | I-1 26 | I0 27 | tbI00 28 | S'\x00\x00(\xc2' 29 | tbtR. -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/cuda/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/sandbox/cuda/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/cuda/tests/test_neighbours.py: -------------------------------------------------------------------------------- 1 | # Skip test if cuda_ndarray is not available. 2 | from nose.plugins.skip import SkipTest 3 | 4 | import theano.sandbox.cuda as cuda_ndarray 5 | if cuda_ndarray.cuda_available == False: 6 | raise SkipTest('Optional package cuda disabled') 7 | 8 | import theano.tensor.nnet.tests.test_neighbours 9 | from theano.sandbox.cuda.neighbours import GpuImages2Neibs 10 | 11 | if theano.config.mode == 'FAST_COMPILE': 12 | mode_with_gpu = theano.compile.mode.get_mode('FAST_RUN').including('gpu') 13 | else: 14 | mode_with_gpu = theano.compile.mode.get_default_mode().including('gpu') 15 | 16 | 17 | class T_GpuImages2Neibs(theano.tensor.nnet.tests.test_neighbours.T_Images2Neibs): 18 | mode = mode_with_gpu 19 | op = GpuImages2Neibs 20 | dtypes = ['float32'] 21 | 22 | if __name__ == '__main__': 23 | unittest.main() 24 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/cuda/tests/test_viewop.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | import unittest 3 | from nose.plugins.skip import SkipTest 4 | 5 | import theano 6 | 7 | mode_with_opt = theano.compile.mode.get_default_mode() 8 | mode_with_gpu = theano.compile.mode.get_default_mode().including('gpu') 9 | 10 | 11 | def test_viewop_gpu(): 12 | from theano.sandbox import cuda 13 | if cuda.cuda_available == False: 14 | raise SkipTest('Optional package cuda disabled') 15 | _x = theano.tensor.fvector('x') 16 | x = cuda.gpu_from_host(_x) 17 | _out = theano.compile.ViewOp()(x) 18 | out = cuda.host_from_gpu(_out) 19 | f = theano.function([x], 20 | out, 21 | mode=mode_with_gpu) 22 | data = numpy.array([1, 2, 3], dtype='float32') 23 | assert numpy.allclose(f(data), data) 24 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/gpuarray/cudnn_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef CUDNN_HELPER_H 2 | #define CUDNN_HELPER_H 3 | 4 | #include 5 | 6 | #ifndef CUDNN_VERSION 7 | 8 | #define CUDNN_VERSION -1 9 | static inline int cudnnGetVersion() { 10 | return -1; 11 | } 12 | #endif 13 | 14 | #include 15 | 16 | // If needed, define element of the V4 interface in terms of elements of 17 | // previous versions 18 | #if defined(CUDNN_VERSION) && CUDNN_VERSION < 4000 19 | 20 | #define CUDNN_CONVOLUTION_FWD_ALGO_FFT_TILING 5 21 | #define CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING 3 22 | 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/gpuarray/fp16_help.py: -------------------------------------------------------------------------------- 1 | def work_dtype(dtype): 2 | if dtype == 'float16': 3 | return 'float32' 4 | else: 5 | return dtype 6 | 7 | 8 | def load_w(dtype): 9 | if dtype == 'float16': 10 | return '__half2float' 11 | else: 12 | return '' 13 | 14 | 15 | def write_w(dtype): 16 | if dtype == 'float16': 17 | return '__float2half_rn' 18 | else: 19 | return '' 20 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/gpuarray/tests/GpuArray.pkl: -------------------------------------------------------------------------------- 1 | ctheano.sandbox.gpuarray.type 2 | GpuArray_unpickler 3 | p0 4 | (cnumpy.core.multiarray 5 | _reconstruct 6 | p1 7 | (cnumpy 8 | ndarray 9 | p2 10 | (I0 11 | tp3 12 | S'b' 13 | p4 14 | tp5 15 | Rp6 16 | (I1 17 | (I1 18 | tp7 19 | cnumpy 20 | dtype 21 | p8 22 | (S'f4' 23 | p9 24 | I0 25 | I1 26 | tp10 27 | Rp11 28 | (I3 29 | S'<' 30 | p12 31 | NNNI-1 32 | I-1 33 | I0 34 | tp13 35 | bI00 36 | S'\x00\x00(\xc2' 37 | p14 38 | tp15 39 | bNtp16 40 | Rp17 41 | . -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/gpuarray/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/sandbox/gpuarray/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/gpuarray/tests/test_neighbours.py: -------------------------------------------------------------------------------- 1 | from theano.tensor.nnet.tests import test_neighbours 2 | 3 | from .config import mode_with_gpu 4 | 5 | from ..neighbours import GpuImages2Neibs 6 | 7 | 8 | class T_GpuImages2Neibs(test_neighbours.T_Images2Neibs): 9 | mode = mode_with_gpu 10 | op = GpuImages2Neibs 11 | dtypes = ['int64', 'float32', 'float64'] 12 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/linalg/__init__.py: -------------------------------------------------------------------------------- 1 | from .ops import (cholesky, matrix_inverse, solve, 2 | diag, extract_diag, alloc_diag, 3 | det, psd, eig, eigh, eigvalsh, 4 | trace, spectral_radius_bound) 5 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/linalg/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/sandbox/linalg/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/neighbours.py: -------------------------------------------------------------------------------- 1 | """ 2 | Neighbours was moved into theano.tensor.nnet.neighbours. 3 | This file was created for compatibility. 4 | """ 5 | from theano.tensor.nnet.neighbours import (images2neibs, neibs2images, 6 | Images2Neibs) 7 | 8 | __all__ = ["images2neibs", "neibs2images", "Images2Neibs"] 9 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/softsign.py: -------------------------------------------------------------------------------- 1 | 2 | import theano 3 | import theano.tensor 4 | 5 | 6 | class ScalarSoftsign(theano.scalar.UnaryScalarOp): 7 | @staticmethod 8 | def static_impl(x): 9 | return x / (1.0 + abs(x)) 10 | 11 | def impl(self, x): 12 | return ScalarSoftsign.static_impl(x) 13 | 14 | def grad(self, inp, grads): 15 | x, = inp 16 | gz, = grads 17 | if 'float' in x.type.dtype: 18 | d = (1.0 + abs(x)) 19 | return [gz / (d * d)] 20 | else: 21 | return NotImplemented 22 | 23 | def c_code(self, node, name, inp, out, sub): 24 | x, = inp 25 | z, = out 26 | if node.inputs[0].type in [theano.scalar.float32, 27 | theano.scalar.float64]: 28 | return "%(z)s = %(x)s / (1.0+fabs(%(x)s));" % locals() 29 | raise NotImplementedError('only floating point x is implemented') 30 | 31 | scalar_softsign = ScalarSoftsign(theano.scalar.upgrade_to_float, 32 | name='scalar_softsign') 33 | softsign = theano.tensor.Elemwise(scalar_softsign, name='softsign') 34 | -------------------------------------------------------------------------------- /libs/Theano/theano/sandbox/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/sandbox/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/scalar/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from .basic import * 3 | 4 | from .basic_scipy import * 5 | -------------------------------------------------------------------------------- /libs/Theano/theano/scalar/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/scalar/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/scalar/tests/test_basic_sympy.py: -------------------------------------------------------------------------------- 1 | from theano.scalar.basic_sympy import SymPyCCode 2 | from theano.scalar.basic import floats 3 | import theano 4 | 5 | try: 6 | import sympy 7 | xs = sympy.Symbol('x') 8 | ys = sympy.Symbol('y') 9 | except ImportError: 10 | from nose.plugins.skip import SkipTest 11 | raise SkipTest('optional package sympy disabled') 12 | 13 | xt, yt = floats('xy') 14 | 15 | 16 | def test_SymPyCCode(): 17 | op = SymPyCCode([xs, ys], xs + ys) 18 | e = op(xt, yt) 19 | g = theano.gof.FunctionGraph([xt, yt], [e]) 20 | fn = theano.gof.CLinker().accept(g).make_function() 21 | assert fn(1.0, 2.0) == 3.0 22 | 23 | 24 | def test_grad(): 25 | op = SymPyCCode([xs], xs**2) 26 | zt = op(xt) 27 | ztprime = theano.grad(zt, xt) 28 | assert ztprime.owner.op.expr == 2 * xs 29 | 30 | 31 | def test_multivar_grad(): 32 | op = SymPyCCode([xs, ys], xs ** 2 + ys ** 3) 33 | zt = op(xt, yt) 34 | dzdx, dzdy = theano.grad(zt, [xt, yt]) 35 | assert dzdx.owner.op.expr == 2 * xs 36 | assert dzdy.owner.op.expr == 3 * ys ** 2 37 | -------------------------------------------------------------------------------- /libs/Theano/theano/scan_module/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/scan_module/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/sparse/__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | try: 4 | import scipy 5 | scipy_ver = [int(n) for n in scipy.__version__.split('.')[:2]] 6 | enable_sparse = bool(scipy_ver >= [0, 7]) 7 | if not enable_sparse: 8 | sys.stderr.write("WARNING: scipy version = %s." 9 | " We request version >=0.7.0 for the sparse code as it has" 10 | " bugs fixed in the sparse matrix code.\n" % scipy.__version__) 11 | except ImportError: 12 | enable_sparse = False 13 | sys.stderr.write("WARNING: scipy can't be imported." 14 | " We disable the sparse matrix code.") 15 | 16 | from theano.sparse.type import * 17 | 18 | if enable_sparse: 19 | from theano.sparse.basic import * 20 | from theano.sparse import opt 21 | from theano.sparse import sharedvar 22 | from theano.sparse.sharedvar import sparse_constructor as shared 23 | -------------------------------------------------------------------------------- /libs/Theano/theano/sparse/sandbox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/sparse/sandbox/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/sparse/sandbox/truedot.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import theano 4 | import numpy 5 | import scipy.sparse as sp 6 | 7 | from theano import sparse 8 | from theano import gof, tensor, compile 9 | 10 | from theano.sparse.tests.test_basic import eval_outputs 11 | from theano.sparse.basic import ( 12 | _is_sparse_variable, _is_dense_variable, 13 | as_sparse_variable, _is_sparse, _mtypes, _mtype_to_str) 14 | from theano.sparse import SparseType, dense_from_sparse, transpose 15 | 16 | from theano.sparse.tests.test_basic import sparse_random_inputs 17 | from theano.tests import unittest_tools as utt 18 | from theano.sparse import verify_grad_sparse 19 | 20 | # To maintain compatibility 21 | from theano.sparse.basic import TrueDot, true_dot 22 | -------------------------------------------------------------------------------- /libs/Theano/theano/sparse/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/sparse/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/sparse/tests/test_type.py: -------------------------------------------------------------------------------- 1 | def test_sparse_type(): 2 | import theano.sparse 3 | # They need to be available even if scipy is not available. 4 | assert hasattr(theano.sparse, "SparseType") 5 | -------------------------------------------------------------------------------- /libs/Theano/theano/sparse/utils.py: -------------------------------------------------------------------------------- 1 | from theano.gof.utils import hash_from_code 2 | 3 | 4 | def hash_from_sparse(data): 5 | # We need to hash the shapes as hash_from_code only hashes 6 | # the data buffer. Otherwise, this will cause problem with shapes like: 7 | # (1, 0) and (2, 0) 8 | # We also need to add the dtype to make the distinction between 9 | # uint32 and int32 of zeros with the same shape. 10 | 11 | # Python hash is not strong, so I always use md5. To avoid having a too 12 | # long hash, I call it again on the contatenation of all parts. 13 | return hash_from_code(hash_from_code(data.data) + 14 | hash_from_code(data.indices) + 15 | hash_from_code(data.indptr) + 16 | hash_from_code(str(data.shape)) + 17 | hash_from_code(str(data.dtype)) + 18 | hash_from_code(data.format)) 19 | -------------------------------------------------------------------------------- /libs/Theano/theano/tensor/nnet/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/tensor/nnet/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/tensor/signal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/tensor/signal/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/tensor/signal/downsample.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | from . import pool 3 | import warnings 4 | 5 | warnings.warn("downsample module has been moved to the pool module.") 6 | max_pool_2d_same_size = pool.max_pool_2d_same_size 7 | max_pool_2d = pool.pool_2d 8 | DownsampleFactorMax = pool.Pool 9 | PoolGrad = pool.PoolGrad 10 | MaxPoolGrad = pool.MaxPoolGrad 11 | AveragePoolGrad = pool.AveragePoolGrad 12 | 13 | 14 | # This is for compatibility with pickled things. It should go away at 15 | # some point. 16 | class DownsampleFactorMaxGrad(object): 17 | def __new__(self, ds, ignore_border, st=None, padding=(0, 0), mode='max'): 18 | if mode == 'max': 19 | return MaxPoolGrad(ds=ds, ignore_border=ignore_border, st=st, 20 | padding=padding) 21 | else: 22 | return AveragePoolGrad(ds=ds, ignore_border=ignore_border, st=st, 23 | padding=padding, mode=mode) 24 | 25 | DownsampleFactorMaxGradGrad = pool.DownsampleFactorMaxGradGrad 26 | -------------------------------------------------------------------------------- /libs/Theano/theano/tensor/signal/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/tensor/signal/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/tensor/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/tensor/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/tensor/tests/shape_opt_cycle.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/tensor/tests/shape_opt_cycle.pkl -------------------------------------------------------------------------------- /libs/Theano/theano/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | try: 3 | from theano.tests.main import main, TheanoNoseTester 4 | except ImportError: 5 | pass 6 | -------------------------------------------------------------------------------- /libs/Theano/theano/tests/disturb_mem.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from six.moves import xrange 3 | 4 | __authors__ = "Ian Goodfellow" 5 | __credits__ = ["Ian Goodfellow"] 6 | __license__ = "3-clause BSD" 7 | __maintainer__ = "Ian Goodfellow" 8 | __email__ = "goodfeli@iro" 9 | 10 | 11 | def disturb_mem(): 12 | # Allocate a time-dependent amount of objects to increase 13 | # chances of subsequently objects' ids changing from run 14 | # to run. This is useful for exposing issues that cause 15 | # non-deterministic behavior due to dependence on memory 16 | # addresses, like iterating over a dict or a set. 17 | global l 18 | now = datetime.now() 19 | ms = now.microsecond 20 | ms = int(ms) 21 | n = ms % 1000 22 | m = ms // 1000 23 | l = [[0] * m for i in xrange(n)] 24 | -------------------------------------------------------------------------------- /libs/Theano/theano/typed_list/__init__.py: -------------------------------------------------------------------------------- 1 | from .type import TypedListType 2 | from .basic import * 3 | from . import opt 4 | -------------------------------------------------------------------------------- /libs/Theano/theano/typed_list/opt.py: -------------------------------------------------------------------------------- 1 | from theano import gof 2 | from theano import compile 3 | from theano.gof import TopoOptimizer 4 | from theano.typed_list.basic import Reverse, Append, Extend, Insert, Remove 5 | 6 | 7 | @gof.local_optimizer([Append, Extend, Insert, Reverse, Remove], inplace=True) 8 | def typed_list_inplace_opt(node): 9 | if (isinstance(node.op, (Append, Extend, Insert, Reverse, Remove)) and not 10 | node.op.inplace): 11 | 12 | new_op = node.op.__class__(inplace=True) 13 | new_node = new_op(*node.inputs) 14 | return [new_node] 15 | return False 16 | compile.optdb.register('typed_list_inplace_opt', 17 | TopoOptimizer(typed_list_inplace_opt, 18 | failure_callback=TopoOptimizer.warn_inplace), 19 | 60, 'fast_run', 'inplace') 20 | -------------------------------------------------------------------------------- /libs/Theano/theano/typed_list/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/typed_list/tests/__init__.py -------------------------------------------------------------------------------- /libs/Theano/theano/version.py: -------------------------------------------------------------------------------- 1 | try: 2 | from theano.generated_version import * # noqa 3 | except ImportError: 4 | short_version = 'unknown' 5 | version = 'unknown' 6 | git_revision = 'unknown' 7 | full_version = 'unknown' 8 | release = False 9 | -------------------------------------------------------------------------------- /libs/blocks-extras/.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 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | 46 | # Translations 47 | *.mo 48 | *.pot 49 | 50 | # Django stuff: 51 | *.log 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | -------------------------------------------------------------------------------- /libs/blocks-extras/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 mila-udem 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /libs/blocks-extras/bin/blocks-controller: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import logging 3 | import argparse 4 | 5 | from blocks_extras.extensions.synchronization import SynchronizeController 6 | 7 | if __name__ == '__main__': 8 | parser = argparse.ArgumentParser("Starts a synchronization controller") 9 | parser.add_argument("--port", type=int, 10 | help="Port for listening") 11 | args = parser.parse_args() 12 | 13 | logging.basicConfig(level='INFO') 14 | controller = SynchronizeController(control_port=args.port) 15 | controller.serve() 16 | -------------------------------------------------------------------------------- /libs/blocks-extras/blocks_extras/__init__.py: -------------------------------------------------------------------------------- 1 | from blocks.config import config 2 | 3 | config.add_config('bokeh_server', type_=str, default='http://localhost:5006/') 4 | config.load_yaml() 5 | -------------------------------------------------------------------------------- /libs/blocks-extras/blocks_extras/extensions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks-extras/blocks_extras/extensions/__init__.py -------------------------------------------------------------------------------- /libs/blocks-extras/blocks_extras/scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks-extras/blocks_extras/scripts/__init__.py -------------------------------------------------------------------------------- /libs/blocks-extras/blocks_extras/utils.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | 3 | 4 | def check_valid_permutation(permutation): 5 | """Check that a given container contains a valid permutation. 6 | 7 | Parameters 8 | ---------- 9 | permutation : array-like, 1-dimensional 10 | An array, list, etc. 11 | 12 | Returns 13 | ------- 14 | permutation : ndarray, 1-dimensional 15 | An ndarray of integers representing a permutation. 16 | 17 | Raises 18 | ------ 19 | ValueError 20 | If the given input is not a valid permutation on the 21 | integers. 22 | 23 | """ 24 | permutation = numpy.asarray(permutation) 25 | if permutation.ndim != 1: 26 | raise ValueError("expected 1-dimensional permutation argument") 27 | elif permutation.dtype.kind != 'i': 28 | raise ValueError("expected integer dtype argument") 29 | elif (len(set(permutation)) != max(permutation) + 1 or 30 | min(permutation) < 0): 31 | raise ValueError("invalid permutation") 32 | return permutation 33 | -------------------------------------------------------------------------------- /libs/blocks-extras/req-scrutinizer.txt: -------------------------------------------------------------------------------- 1 | flake8==2.3.0 # rq.filter: <2.4.0 2 | 3 | --allow-external pep257 4 | --allow-unverified pep257 5 | git+https://github.com/bartvm/pep257.git@numpy#egg=pep257 6 | -------------------------------------------------------------------------------- /libs/blocks-extras/req-travis-conda.txt: -------------------------------------------------------------------------------- 1 | bokeh=0.10.0 2 | -------------------------------------------------------------------------------- /libs/blocks-extras/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import find_packages, setup 2 | 3 | setup( 4 | name='blocks_extras', 5 | install_requires=['blocks'], 6 | packages=find_packages(), 7 | scripts=['bin/blocks-plot'], 8 | extras_require={'plot': ['bokeh']}, 9 | zip_safe=False 10 | ) 11 | -------------------------------------------------------------------------------- /libs/blocks-extras/tests/extensions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks-extras/tests/extensions/__init__.py -------------------------------------------------------------------------------- /libs/blocks-extras/tests/extensions/test_plot.py: -------------------------------------------------------------------------------- 1 | from blocks.utils.testing import MockMainLoop 2 | from blocks.extensions import SimpleExtension, FinishAfter 3 | from blocks_extras.extensions.plot import Plot 4 | 5 | 6 | def test_plot(): 7 | class Writer(SimpleExtension): 8 | def do(self, *args, **kwargs): 9 | self.main_loop.log.current_row['channel'] = ( 10 | self.main_loop.status['iterations_done'] ** 2) 11 | main_loop = MockMainLoop(extensions=[ 12 | Writer(after_batch=True), 13 | Plot('test', [['channel']]).set_conditions(after_batch=True), 14 | FinishAfter(after_n_batches=11)]) 15 | main_loop.run() 16 | -------------------------------------------------------------------------------- /libs/blocks-extras/tests/scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks-extras/tests/scripts/__init__.py -------------------------------------------------------------------------------- /libs/blocks-extras/tests/test_bricks.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | from numpy.testing import assert_equal 3 | import theano 4 | from theano import tensor 5 | from blocks_extras.bricks import FixedPermutation 6 | 7 | 8 | def test_fixed_permutation(): 9 | x = tensor.matrix() 10 | x_val = numpy.arange(15, dtype=theano.config.floatX).reshape((5, 3)) 11 | perm = FixedPermutation([2, 0, 1]) 12 | y = perm.apply(x) 13 | y_val = y.eval({x: x_val}) 14 | assert_equal(x_val[:, [2, 0, 1]], y_val) 15 | perm = FixedPermutation([2, 0, 1], dot=False) 16 | y = perm.apply(x) 17 | assert_equal(x_val[:, [2, 0, 1]], y_val) 18 | -------------------------------------------------------------------------------- /libs/blocks/.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 | # Eclipse 57 | .project 58 | .pydevproject 59 | .settings/ 60 | -------------------------------------------------------------------------------- /libs/blocks/bin/blocks-continue: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import logging 3 | from argparse import ArgumentParser 4 | 5 | from blocks.serialization import continue_training 6 | 7 | if __name__ == "__main__": 8 | logging.basicConfig() 9 | 10 | parser = ArgumentParser("Continues your pickled main loop") 11 | parser.add_argument( 12 | "path", help="A path to a file with a pickled main loop") 13 | args = parser.parse_args() 14 | 15 | continue_training(args.path) 16 | -------------------------------------------------------------------------------- /libs/blocks/blocks/__init__.py: -------------------------------------------------------------------------------- 1 | """The blocks library for parametrized Theano ops.""" 2 | import blocks.version 3 | __version__ = blocks.version.version 4 | -------------------------------------------------------------------------------- /libs/blocks/blocks/bricks/__init__.py: -------------------------------------------------------------------------------- 1 | """Bricks are parameterized Theano operations.""" 2 | from .base import application, Brick, lazy 3 | from .bn import (BatchNormalization, SpatialBatchNormalization, 4 | BatchNormalizedMLP) 5 | from .interfaces import (Activation, Feedforward, Initializable, LinearLike, 6 | Random) 7 | from .simple import (Linear, Bias, Maxout, LinearMaxout, Identity, Tanh, 8 | Logistic, Softplus, Rectifier, Softmax, 9 | NDimensionalSoftmax) 10 | from .sequences import Sequence, FeedforwardSequence, MLP 11 | from .wrappers import WithExtraDims 12 | 13 | __all__ = ('application', 'Brick', 'lazy', 'BatchNormalization', 14 | 'SpatialBatchNormalization', 'BatchNormalizedMLP', 15 | 'Activation', 'Feedforward', 'Initializable', 'LinearLike', 16 | 'Random', 'Linear', 'Bias', 'Maxout', 'LinearMaxout', 'Identity', 17 | 'Tanh', 'Logistic', 'Softplus', 'Rectifier', 'Softmax', 18 | 'NDimensionalSoftmax', 'Sequence', 'FeedforwardSequence', 19 | 'MLP', 'WithExtraDims') 20 | -------------------------------------------------------------------------------- /libs/blocks/blocks/extensions/predicates.py: -------------------------------------------------------------------------------- 1 | class OnLogRecord(object): 2 | """Trigger a callback when a certain log record is found. 3 | 4 | Parameters 5 | ---------- 6 | record_name : str 7 | The record name to check. 8 | 9 | """ 10 | def __init__(self, record_name): 11 | self.record_name = record_name 12 | 13 | def __call__(self, log): 14 | return bool(log.current_row.get(self.record_name, False)) 15 | -------------------------------------------------------------------------------- /libs/blocks/blocks/log/__init__.py: -------------------------------------------------------------------------------- 1 | from .log import TrainingLog 2 | from .sqlite import SQLiteLog 3 | 4 | BACKENDS = { 5 | 'python': TrainingLog, 6 | 'sqlite': SQLiteLog 7 | } 8 | -------------------------------------------------------------------------------- /libs/blocks/blocks/monitoring/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/blocks/monitoring/__init__.py -------------------------------------------------------------------------------- /libs/blocks/blocks/scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/blocks/scripts/__init__.py -------------------------------------------------------------------------------- /libs/blocks/blocks/version.py: -------------------------------------------------------------------------------- 1 | version = '0.2.0' 2 | -------------------------------------------------------------------------------- /libs/blocks/docs/_static/code_quality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/docs/_static/code_quality.png -------------------------------------------------------------------------------- /libs/blocks/docs/_static/mnist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/docs/_static/mnist.png -------------------------------------------------------------------------------- /libs/blocks/docs/_static/plot_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/docs/_static/plot_a.png -------------------------------------------------------------------------------- /libs/blocks/docs/_static/plot_cost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/docs/_static/plot_cost.png -------------------------------------------------------------------------------- /libs/blocks/docs/_static/sequence_generator_scheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/docs/_static/sequence_generator_scheme.png -------------------------------------------------------------------------------- /libs/blocks/docs/api/algorithms.rst: -------------------------------------------------------------------------------- 1 | Algorithms 2 | ========== 3 | 4 | .. automodule:: blocks.algorithms 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/extensions.rst: -------------------------------------------------------------------------------- 1 | Extensions 2 | ========== 3 | 4 | .. automodule:: blocks.extensions 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | Monitoring extensions 10 | --------------------- 11 | 12 | .. automodule:: blocks.extensions.monitoring 13 | :members: 14 | :undoc-members: 15 | :show-inheritance: 16 | 17 | Training 18 | -------- 19 | 20 | .. automodule:: blocks.extensions.training 21 | :members: 22 | :undoc-members: 23 | :show-inheritance: 24 | 25 | Serialization 26 | ------------- 27 | 28 | .. automodule:: blocks.extensions.saveload 29 | :members: 30 | :undoc-members: 31 | :show-inheritance: 32 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/filter.rst: -------------------------------------------------------------------------------- 1 | .. _filter: 2 | 3 | Filter 4 | ====== 5 | 6 | .. automodule:: blocks.filter 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/graph.rst: -------------------------------------------------------------------------------- 1 | .. _graph: 2 | 3 | Computational graph 4 | =================== 5 | 6 | .. automodule:: blocks.graph 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/index.rst: -------------------------------------------------------------------------------- 1 | API Reference 2 | ============= 3 | 4 | .. warning:: 5 | 6 | This API reference is currently nothing but a dump of docstrings, ordered 7 | alphabetically. 8 | 9 | The API reference contains detailed descriptions of the different end-user 10 | classes, functions, methods, etc. you will need to work with Blocks. 11 | 12 | .. note:: 13 | 14 | This API reference only contains *end-user* documentation. If you are 15 | looking to hack away at Blocks' internals, you will find more detailed 16 | comments in the source code. 17 | 18 | .. toctree:: 19 | :glob: 20 | 21 | * 22 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/initialization.rst: -------------------------------------------------------------------------------- 1 | .. _initialization: 2 | 3 | Parameter initialization 4 | ======================== 5 | 6 | .. automodule:: blocks.initialization 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/log.rst: -------------------------------------------------------------------------------- 1 | .. _log: 2 | 3 | Logging 4 | ======= 5 | 6 | Log has two different backends configurable in ``.blocksrc``, 7 | see :doc:`../configuration`. 8 | 9 | .. automodule:: blocks.log 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | Dictionary backend 15 | ------------------ 16 | 17 | .. automodule:: blocks.log.log 18 | :members: 19 | :undoc-members: 20 | :show-inheritance: 21 | 22 | Sqlite backend 23 | -------------- 24 | 25 | .. automodule:: blocks.log.sqlite 26 | :members: 27 | :undoc-members: 28 | :show-inheritance: 29 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/main_loop.rst: -------------------------------------------------------------------------------- 1 | .. _main: 2 | 3 | Main loop 4 | ========= 5 | 6 | .. automodule:: blocks.main_loop 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/model.rst: -------------------------------------------------------------------------------- 1 | Model 2 | ===== 3 | 4 | .. automodule:: blocks.model 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/roles.rst: -------------------------------------------------------------------------------- 1 | Variable roles 2 | ============== 3 | 4 | .. autofunction:: blocks.roles.add_role 5 | 6 | Roles 7 | ----- 8 | 9 | All roles are implemented as subclasses of :class:`VariableRole`. 10 | 11 | .. autoclass:: blocks.roles.VariableRole 12 | 13 | The actual roles are instances of the different subclasses of 14 | :class:`VariableRole`. They are: 15 | 16 | .. automodule:: blocks.roles 17 | :members: INPUT, OUTPUT, AUXILIARY, COST, PARAMETER, WEIGHT, BIAS, FILTER 18 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/select.rst: -------------------------------------------------------------------------------- 1 | Brick selectors 2 | =============== 3 | 4 | .. automodule:: blocks.select 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/serialization.rst: -------------------------------------------------------------------------------- 1 | Serialization 2 | ============= 3 | 4 | .. automodule:: blocks.serialization 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/theano_expressions.rst: -------------------------------------------------------------------------------- 1 | .. _theano_expressions: 2 | 3 | Theano expressions 4 | ================== 5 | 6 | .. automodule:: blocks.theano_expressions 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | -------------------------------------------------------------------------------- /libs/blocks/docs/api/utils.rst: -------------------------------------------------------------------------------- 1 | .. _utils: 2 | 3 | Utilities 4 | ========= 5 | 6 | .. automodule:: blocks.utils 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | -------------------------------------------------------------------------------- /libs/blocks/docs/configuration.rst: -------------------------------------------------------------------------------- 1 | Configuration 2 | ============= 3 | 4 | .. automodule:: blocks.config 5 | 6 | .. autoclass:: ConfigurationError 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /libs/blocks/docs/development/internal_api.rst: -------------------------------------------------------------------------------- 1 | Internal API 2 | ============ 3 | 4 | * `Bricks`_ 5 | * `Extensions`_ 6 | * `Utils`_ 7 | 8 | Bricks 9 | ------ 10 | .. automodule:: blocks.bricks.base 11 | :undoc-members: 12 | :members: 13 | :private-members: 14 | :show-inheritance: 15 | 16 | .. automodule:: blocks.bricks 17 | :members: Activation, ActivationDocumentation 18 | :undoc-members: 19 | :private-members: 20 | :show-inheritance: 21 | 22 | Extensions 23 | ---------- 24 | .. automodule:: blocks.extensions.predicates 25 | :undoc-members: 26 | :members: 27 | :private-members: 28 | :show-inheritance: 29 | 30 | .. automodule:: blocks.monitoring.evaluators 31 | :undoc-members: 32 | :members: 33 | :private-members: 34 | :show-inheritance: 35 | 36 | Utils 37 | ----- 38 | .. automodule:: blocks.utils.containers 39 | :undoc-members: 40 | :members: 41 | :private-members: 42 | :show-inheritance: 43 | 44 | .. automodule:: blocks.utils.profile 45 | :undoc-members: 46 | :members: 47 | :private-members: 48 | :show-inheritance: 49 | -------------------------------------------------------------------------------- /libs/blocks/req-rtd.txt: -------------------------------------------------------------------------------- 1 | picklable-itertools==0.1.1 2 | progressbar2==3.6.0 3 | pyyaml==3.11 4 | six==1.9.0 5 | toolz==0.7.2 6 | 7 | --allow-external theano 8 | --allow-unverified theano 9 | git+https://github.com/Theano/Theano.git#egg=theano 10 | -------------------------------------------------------------------------------- /libs/blocks/req-scrutinizer.txt: -------------------------------------------------------------------------------- 1 | flake8==2.3.0 # rq.filter: <2.4.0 2 | 3 | --allow-external pep257 4 | --allow-unverified pep257 5 | git+https://github.com/bartvm/pep257.git@numpy#egg=pep257 6 | -------------------------------------------------------------------------------- /libs/blocks/req-travis-conda.txt: -------------------------------------------------------------------------------- 1 | coverage==4.0 2 | h5py==2.5.0 3 | mock==1.3.0 4 | nose==1.3.7 5 | numpy==1.9.3 6 | pillow==3.0.0 7 | pytables==3.2.1.1 8 | pyyaml==3.11 9 | pyzmq==14.7.0 10 | scipy==0.16.0 11 | six==1.9.0 12 | toolz==0.7.4 13 | -------------------------------------------------------------------------------- /libs/blocks/req-travis-pip.txt: -------------------------------------------------------------------------------- 1 | coveralls==1.0 2 | nose2[coverage-plugin]==0.5.0 3 | picklable-itertools==0.1.1 4 | progressbar2==3.6.0 5 | 6 | --allow-external theano 7 | --allow-unverified theano 8 | git+https://github.com/Theano/Theano.git#egg=theano 9 | 10 | --allow-external fuel 11 | --allow-unverified fuel 12 | git+https://github.com/mila-udem/fuel#egg=fuel 13 | -------------------------------------------------------------------------------- /libs/blocks/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy==1.9.3 2 | picklable-itertools==0.1.1 3 | progressbar2==3.6.0 4 | pyyaml==3.11 5 | six==1.9.0 6 | toolz==0.7.2 7 | 8 | --allow-external theano 9 | --allow-unverified theano 10 | git+https://github.com/Theano/Theano.git#egg=theano 11 | 12 | --allow-external fuel 13 | --allow-unverified fuel 14 | git+https://github.com/mila-udem/fuel#egg=fuel 15 | -------------------------------------------------------------------------------- /libs/blocks/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/tests/__init__.py -------------------------------------------------------------------------------- /libs/blocks/tests/algorithms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/tests/algorithms/__init__.py -------------------------------------------------------------------------------- /libs/blocks/tests/bricks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/tests/bricks/__init__.py -------------------------------------------------------------------------------- /libs/blocks/tests/bricks/test_interfaces.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | import theano 3 | from theano import tensor 4 | from blocks.bricks import Linear 5 | from blocks.initialization import Constant, IsotropicGaussian 6 | 7 | 8 | def test_linearlike_subclass_initialize_works_overridden_w(): 9 | class NotQuiteLinear(Linear): 10 | @property 11 | def W(self): 12 | W = super(NotQuiteLinear, self).W 13 | return W / tensor.sqrt((W ** 2).sum(axis=0)) 14 | 15 | brick = NotQuiteLinear(5, 10, weights_init=IsotropicGaussian(0.02), 16 | biases_init=Constant(1)) 17 | brick.initialize() 18 | assert not numpy.isnan(brick.parameters[0].get_value()).any() 19 | numpy.testing.assert_allclose((brick.W ** 2).sum(axis=0).eval(), 1, 20 | rtol=1e-6) 21 | -------------------------------------------------------------------------------- /libs/blocks/tests/extensions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/tests/extensions/__init__.py -------------------------------------------------------------------------------- /libs/blocks/tests/extensions/test_timing.py: -------------------------------------------------------------------------------- 1 | from blocks.extensions import Timing, FinishAfter 2 | from blocks.utils.testing import MockMainLoop 3 | 4 | 5 | def test_timing(): 6 | main_loop = MockMainLoop(extensions=[Timing(), 7 | FinishAfter(after_n_epochs=2)]) 8 | main_loop.run() 9 | -------------------------------------------------------------------------------- /libs/blocks/tests/monitoring/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/tests/monitoring/__init__.py -------------------------------------------------------------------------------- /libs/blocks/tests/test_roles.py: -------------------------------------------------------------------------------- 1 | import blocks.roles 2 | from six.moves import cPickle 3 | 4 | 5 | def test_role_serialization(): 6 | """Test that roles compare equal before and after serialization.""" 7 | roles = [blocks.roles.INPUT, 8 | blocks.roles.OUTPUT, 9 | blocks.roles.COST, 10 | blocks.roles.PARAMETER, 11 | blocks.roles.AUXILIARY, 12 | blocks.roles.WEIGHT, 13 | blocks.roles.BIAS, 14 | blocks.roles.FILTER] 15 | 16 | for role in roles: 17 | deserialized = cPickle.loads(cPickle.dumps(role)) 18 | assert deserialized == role 19 | -------------------------------------------------------------------------------- /libs/blocks/tests/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/blocks/tests/utils/__init__.py -------------------------------------------------------------------------------- /libs/blocks/tests/utils/test_containers.py: -------------------------------------------------------------------------------- 1 | from blocks.utils.containers import AnnotatingList 2 | 3 | 4 | def test_annotating_list(): 5 | l = AnnotatingList(range(10)) 6 | assert repr(l) == repr(list(range(10))) 7 | assert l == list(range(10)) 8 | assert l != list(range(9)) 9 | assert l[0] == 0 10 | l[0] = 10 11 | del l[0] 12 | l.insert(0, 0) 13 | assert l == list(range(10)) 14 | -------------------------------------------------------------------------------- /libs/fuel/.coveragerc: -------------------------------------------------------------------------------- 1 | [report] 2 | omit = 3 | fuel/bin/* 4 | -------------------------------------------------------------------------------- /libs/fuel/.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 | # Editors 57 | *~ 58 | *.sw[op] 59 | -------------------------------------------------------------------------------- /libs/fuel/.travis-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Download and convert given datasets if not present already 3 | # Usage: .travis-download.sh [dataset ...] 4 | set -ev 5 | 6 | function download { 7 | if [ ! -f $FUEL_DATA_PATH/$1.hdf5 ]; then 8 | fuel-download $@ 9 | fuel-convert $@ 10 | fuel-download $@ --clear 11 | fi 12 | } 13 | 14 | cd $FUEL_DATA_PATH 15 | 16 | for dataset in "$@"; do 17 | if [ "$dataset" == "ilsvrc2010" ]; then 18 | wget "http://www.image-net.org/challenges/LSVRC/2010/download/ILSVRC2010_devkit-1.0.tar.gz" 19 | wget "http://www.image-net.org/challenges/LSVRC/2010/ILSVRC2010_test_ground_truth.txt" 20 | else 21 | download $dataset 22 | fi 23 | done 24 | 25 | 26 | 27 | cd - 28 | -------------------------------------------------------------------------------- /libs/fuel/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Bart van Merriënboer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /libs/fuel/docs/api/data_streams.rst: -------------------------------------------------------------------------------- 1 | Data streams 2 | ============ 3 | 4 | .. automodule:: fuel.streams 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /libs/fuel/docs/api/index.rst: -------------------------------------------------------------------------------- 1 | API Reference 2 | ============= 3 | 4 | .. warning:: 5 | 6 | This API reference is currently nothing but a dump of docstrings, ordered 7 | alphabetically. 8 | 9 | .. toctree:: 10 | :glob: 11 | 12 | * 13 | -------------------------------------------------------------------------------- /libs/fuel/docs/api/iteration_schemes.rst: -------------------------------------------------------------------------------- 1 | Iteration schemes 2 | ================= 3 | 4 | .. automodule:: fuel.schemes 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /libs/fuel/docs/api/transformers.rst: -------------------------------------------------------------------------------- 1 | Transformers 2 | ============ 3 | 4 | General transformers 5 | -------------------- 6 | 7 | .. automodule:: fuel.transformers.defaults 8 | :members: 9 | :undoc-members: 10 | :show-inheritance: 11 | 12 | Transformers for image 13 | ---------------------- 14 | 15 | .. automodule:: fuel.transformers.image 16 | :members: 17 | :undoc-members: 18 | :show-inheritance: 19 | 20 | Transformers for text 21 | --------------------- 22 | 23 | .. automodule:: fuel.transformers.text 24 | :members: 25 | :undoc-members: 26 | :show-inheritance: 27 | 28 | -------------------------------------------------------------------------------- /libs/fuel/fuel/__init__.py: -------------------------------------------------------------------------------- 1 | import fuel.version 2 | from fuel.config_parser import config # noqa 3 | 4 | __version__ = fuel.version.version 5 | -------------------------------------------------------------------------------- /libs/fuel/fuel/bin/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/fuel/fuel/bin/__init__.py -------------------------------------------------------------------------------- /libs/fuel/fuel/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | from fuel.datasets.base import (Dataset, IterableDataset, 3 | IndexableDataset) 4 | 5 | from fuel.datasets.hdf5 import H5PYDataset 6 | from fuel.datasets.adult import Adult 7 | from fuel.datasets.binarized_mnist import BinarizedMNIST 8 | from fuel.datasets.cifar10 import CIFAR10 9 | from fuel.datasets.cifar100 import CIFAR100 10 | from fuel.datasets.caltech101_silhouettes import CalTech101Silhouettes 11 | from fuel.datasets.iris import Iris 12 | from fuel.datasets.mnist import MNIST 13 | from fuel.datasets.svhn import SVHN 14 | from fuel.datasets.text import TextFile 15 | from fuel.datasets.billion import OneBillionWord 16 | -------------------------------------------------------------------------------- /libs/fuel/fuel/datasets/adult.py: -------------------------------------------------------------------------------- 1 | from fuel.datasets import H5PYDataset 2 | from fuel.utils import find_in_data_path 3 | 4 | 5 | class Adult(H5PYDataset): 6 | filename = 'adult.hdf5' 7 | 8 | def __init__(self, which_sets, **kwargs): 9 | kwargs.setdefault('load_in_memory', True) 10 | super(Adult, self).__init__( 11 | file_or_path=find_in_data_path(self.filename), 12 | which_sets=which_sets, **kwargs 13 | ) 14 | -------------------------------------------------------------------------------- /libs/fuel/fuel/downloaders/__init__.py: -------------------------------------------------------------------------------- 1 | """Download modules for built-in datasets. 2 | 3 | Download functions accept two arguments: 4 | 5 | * `save_directory` : Where to save the downloaded files 6 | * `clear` : If `True`, clear the downloaded files. Defaults to `False`. 7 | 8 | """ 9 | from fuel.downloaders import adult 10 | from fuel.downloaders import binarized_mnist 11 | from fuel.downloaders import caltech101_silhouettes 12 | from fuel.downloaders import cifar10 13 | from fuel.downloaders import cifar100 14 | from fuel.downloaders import iris 15 | from fuel.downloaders import mnist 16 | from fuel.downloaders import svhn 17 | from fuel.downloaders import ilsvrc2010 18 | 19 | all_downloaders = ( 20 | ('adult', adult.fill_subparser), 21 | ('binarized_mnist', binarized_mnist.fill_subparser), 22 | ('caltech101_silhouettes', caltech101_silhouettes.fill_subparser), 23 | ('cifar10', cifar10.fill_subparser), 24 | ('cifar100', cifar100.fill_subparser), 25 | ('iris', iris.fill_subparser), 26 | ('mnist', mnist.fill_subparser), 27 | ('svhn', svhn.fill_subparser), 28 | ('ilsvrc2010', ilsvrc2010.fill_subparser)) 29 | -------------------------------------------------------------------------------- /libs/fuel/fuel/downloaders/adult.py: -------------------------------------------------------------------------------- 1 | from fuel.downloaders.base import default_downloader 2 | 3 | 4 | def fill_subparser(subparser): 5 | """Set up a subparser to download the adult dataset file. 6 | 7 | The Adult dataset file `adult.data` and `adult.test` is downloaded from 8 | the UCI Machine Learning Repository [UCIADULT]. 9 | 10 | .. [UCIADULT] https://archive.ics.uci.edu/ml/datasets/Adult 11 | 12 | Parameters 13 | ---------- 14 | subparser : :class:`argparse.ArgumentParser` 15 | Subparser handling the adult command. 16 | 17 | """ 18 | subparser.set_defaults( 19 | urls=['https://archive.ics.uci.edu/ml/machine-learning-databases/' 20 | 'adult/adult.data', 21 | 'https://archive.ics.uci.edu/ml/machine-learning-databases/' 22 | 'adult/adult.test'], 23 | filenames=['adult.data', 'adult.test']) 24 | return default_downloader 25 | -------------------------------------------------------------------------------- /libs/fuel/fuel/downloaders/binarized_mnist.py: -------------------------------------------------------------------------------- 1 | from fuel.downloaders.base import default_downloader 2 | 3 | 4 | def fill_subparser(subparser): 5 | """Sets up a subparser to download the binarized MNIST dataset files. 6 | 7 | The binarized MNIST dataset files 8 | (`binarized_mnist_{train,valid,test}.amat`) are downloaded from 9 | Hugo Larochelle's website [HUGO]. 10 | 11 | .. [HUGO] http://www.cs.toronto.edu/~larocheh/public/datasets/ 12 | binarized_mnist/binarized_mnist_{train,valid,test}.amat 13 | 14 | Parameters 15 | ---------- 16 | subparser : :class:`argparse.ArgumentParser` 17 | Subparser handling the `binarized_mnist` command. 18 | 19 | """ 20 | sets = ['train', 'valid', 'test'] 21 | urls = ['http://www.cs.toronto.edu/~larocheh/public/datasets/' + 22 | 'binarized_mnist/binarized_mnist_{}.amat'.format(s) for s in sets] 23 | filenames = ['binarized_mnist_{}.amat'.format(s) for s in sets] 24 | subparser.set_defaults(urls=urls, filenames=filenames) 25 | return default_downloader 26 | -------------------------------------------------------------------------------- /libs/fuel/fuel/downloaders/cifar10.py: -------------------------------------------------------------------------------- 1 | from fuel.downloaders.base import default_downloader 2 | 3 | 4 | def fill_subparser(subparser): 5 | """Sets up a subparser to download the CIFAR-10 dataset file. 6 | 7 | The CIFAR-10 dataset file is downloaded from Alex Krizhevsky's 8 | website [ALEX]. 9 | 10 | Parameters 11 | ---------- 12 | subparser : :class:`argparse.ArgumentParser` 13 | Subparser handling the `cifar10` command. 14 | 15 | """ 16 | url = 'http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz' 17 | filename = 'cifar-10-python.tar.gz' 18 | subparser.set_defaults(urls=[url], filenames=[filename]) 19 | return default_downloader 20 | -------------------------------------------------------------------------------- /libs/fuel/fuel/downloaders/cifar100.py: -------------------------------------------------------------------------------- 1 | from fuel.downloaders.base import default_downloader 2 | 3 | 4 | def fill_subparser(subparser): 5 | """Sets up a subparser to download the CIFAR-100 dataset file. 6 | 7 | The CIFAR-100 dataset file is downloaded from Alex Krizhevsky's 8 | website [ALEX]. 9 | 10 | .. [ALEX] http://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz 11 | 12 | Parameters 13 | ---------- 14 | subparser : :class:`argparse.ArgumentParser` 15 | Subparser handling the `cifar100` command. 16 | 17 | """ 18 | url = 'http://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz' 19 | filename = 'cifar-100-python.tar.gz' 20 | subparser.set_defaults(urls=[url], filenames=[filename]) 21 | return default_downloader 22 | -------------------------------------------------------------------------------- /libs/fuel/fuel/downloaders/iris.py: -------------------------------------------------------------------------------- 1 | from fuel.downloaders.base import default_downloader 2 | 3 | 4 | def fill_subparser(subparser): 5 | """Set up a subparser to download the Iris dataset file. 6 | 7 | The Iris dataset file `iris.data` is downloaded from the UCI 8 | Machine Learning Repository [UCIIRIS]. 9 | 10 | Parameters 11 | ---------- 12 | subparser : :class:`argparse.ArgumentParser` 13 | Subparser handling the iris command. 14 | 15 | """ 16 | subparser.set_defaults( 17 | urls=['https://archive.ics.uci.edu/ml/machine-learning-databases/' 18 | 'iris/iris.data'], 19 | filenames=['iris.data']) 20 | return default_downloader 21 | -------------------------------------------------------------------------------- /libs/fuel/fuel/downloaders/mnist.py: -------------------------------------------------------------------------------- 1 | from fuel.downloaders.base import default_downloader 2 | 3 | 4 | def fill_subparser(subparser): 5 | """Sets up a subparser to download the MNIST dataset files. 6 | 7 | The following MNIST dataset files are downloaded from Yann LeCun's 8 | website [LECUN]: 9 | `train-images-idx3-ubyte.gz`, `train-labels-idx1-ubyte.gz`, 10 | `t10k-images-idx3-ubyte.gz`, `t10k-labels-idx1-ubyte.gz`. 11 | 12 | Parameters 13 | ---------- 14 | subparser : :class:`argparse.ArgumentParser` 15 | Subparser handling the `mnist` command. 16 | 17 | """ 18 | filenames = ['train-images-idx3-ubyte.gz', 'train-labels-idx1-ubyte.gz', 19 | 't10k-images-idx3-ubyte.gz', 't10k-labels-idx1-ubyte.gz'] 20 | urls = ['http://yann.lecun.com/exdb/mnist/' + f for f in filenames] 21 | subparser.set_defaults(urls=urls, filenames=filenames) 22 | return default_downloader 23 | -------------------------------------------------------------------------------- /libs/fuel/fuel/downloaders/svhn.py: -------------------------------------------------------------------------------- 1 | from fuel.downloaders.base import default_downloader 2 | 3 | 4 | def svhn_downloader(which_format, directory, clear=False): 5 | suffix = {1: '.tar.gz', 2: '_32x32.mat'}[which_format] 6 | sets = ['train', 'test', 'extra'] 7 | default_downloader( 8 | directory=directory, 9 | urls=[None for f in sets], 10 | filenames=['{}{}'.format(s, suffix) for s in sets], 11 | url_prefix='http://ufldl.stanford.edu/housenumbers/', 12 | clear=clear) 13 | 14 | 15 | def fill_subparser(subparser): 16 | """Sets up a subparser to download the SVHN dataset files. 17 | 18 | The SVHN dataset files (`{train,test,extra}{.tar.gz,_32x32.mat}`) 19 | are downloaded from the official website [SVHNSITE]. 20 | 21 | Parameters 22 | ---------- 23 | subparser : :class:`argparse.ArgumentParser` 24 | Subparser handling the `svhn` command. 25 | 26 | """ 27 | subparser.add_argument( 28 | "which_format", help="which dataset format", type=int, choices=(1, 2)) 29 | return svhn_downloader 30 | -------------------------------------------------------------------------------- /libs/fuel/fuel/exceptions.py: -------------------------------------------------------------------------------- 1 | class AxisLabelsMismatchError(ValueError): 2 | """Raised when a pair of axis labels tuples do not match.""" 3 | 4 | 5 | class ConfigurationError(Exception): 6 | """Error raised when a configuration value is requested but not set.""" 7 | 8 | 9 | class MissingInputFiles(Exception): 10 | """Exception raised by a converter when input files are not found. 11 | 12 | Parameters 13 | ---------- 14 | message : str 15 | The error message to be associated with this exception. 16 | filenames : list 17 | A list of filenames that were not found. 18 | 19 | """ 20 | def __init__(self, message, filenames): 21 | self.filenames = filenames 22 | super(MissingInputFiles, self).__init__(message, filenames) 23 | 24 | 25 | class NeedURLPrefix(Exception): 26 | """Raised when a URL is not provided for a file.""" 27 | -------------------------------------------------------------------------------- /libs/fuel/fuel/utils/formats.py: -------------------------------------------------------------------------------- 1 | """Low-level utilities for reading a variety of source formats.""" 2 | import tarfile 3 | import six 4 | 5 | 6 | def tar_open(f): 7 | """Open either a filename or a file-like object as a TarFile. 8 | 9 | Parameters 10 | ---------- 11 | f : str or file-like object 12 | The filename or file-like object from which to read. 13 | 14 | Returns 15 | ------- 16 | TarFile 17 | A `TarFile` instance. 18 | 19 | """ 20 | if isinstance(f, six.string_types): 21 | return tarfile.open(name=f) 22 | else: 23 | return tarfile.open(fileobj=f) 24 | -------------------------------------------------------------------------------- /libs/fuel/fuel/version.py: -------------------------------------------------------------------------------- 1 | version = '0.1.1' 2 | -------------------------------------------------------------------------------- /libs/fuel/req-rtd.txt: -------------------------------------------------------------------------------- 1 | picklable-itertools==0.1.1 2 | progressbar2==2.7.3 3 | pyyaml==3.11 4 | requests==2.7.0 5 | six==1.9.0 6 | -------------------------------------------------------------------------------- /libs/fuel/req-travis-conda.txt: -------------------------------------------------------------------------------- 1 | coverage==4.0 2 | h5py==2.5.0 3 | mock==1.3.0 4 | nose==1.3.7 5 | numpy==1.9.3 6 | pillow==3.0.0 7 | pytables==3.2.2 8 | pyyaml==3.11 9 | pyzmq==14.7.0 10 | requests==2.7.0 11 | scipy==0.16.0 12 | six==1.9.0 13 | -------------------------------------------------------------------------------- /libs/fuel/req-travis-pip.txt: -------------------------------------------------------------------------------- 1 | nose2[coverage-plugin]==0.5.0 2 | coveralls==1.0 3 | picklable-itertools==0.1.1 4 | progressbar2==2.7.3 5 | -------------------------------------------------------------------------------- /libs/fuel/requirements.txt: -------------------------------------------------------------------------------- 1 | h5py==2.5.0 2 | numpy==1.9.3 3 | tables==3.2.2 4 | picklable-itertools==0.1.1 5 | pillow==2.9.0 6 | progressbar2==2.7.3 7 | pyyaml==3.11 8 | pyzmq==14.7.0 9 | requests==2.7.0 10 | scipy==0.16.0 11 | six==1.9.0 12 | -------------------------------------------------------------------------------- /libs/fuel/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.rst 3 | -------------------------------------------------------------------------------- /libs/fuel/tests/converters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/fuel/tests/converters/__init__.py -------------------------------------------------------------------------------- /libs/fuel/tests/test_billion.py: -------------------------------------------------------------------------------- 1 | from numpy.testing import assert_raises 2 | 3 | from fuel.datasets.billion import OneBillionWord 4 | 5 | 6 | class TestOneBillionWord(object): 7 | def setUp(self): 8 | all_chars = ([chr(ord('a') + i) for i in range(26)] + 9 | [chr(ord('0') + i) for i in range(10)] + 10 | [',', '.', '!', '?', ''] + 11 | [' ', '', '']) 12 | code2char = dict(enumerate(all_chars)) 13 | self.char2code = {v: k for k, v in code2char.items()} 14 | 15 | def test_value_error_wrong_set(self): 16 | assert_raises( 17 | ValueError, OneBillionWord, 'dummy', [0, 1], self.char2code) 18 | 19 | def test_value_error_training_partition(self): 20 | assert_raises( 21 | ValueError, OneBillionWord, 'training', [101], self.char2code) 22 | 23 | def test_value_error_heldout_partition(self): 24 | assert_raises( 25 | ValueError, OneBillionWord, 'heldout', [101], self.char2code) 26 | -------------------------------------------------------------------------------- /libs/fuel/tests/test_iris.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | 3 | from numpy.testing import assert_raises, assert_equal, assert_allclose 4 | 5 | from fuel.datasets import Iris 6 | from tests import skip_if_not_available 7 | 8 | 9 | def test_iris_all(): 10 | skip_if_not_available(datasets=['iris.hdf5']) 11 | 12 | dataset = Iris(('all',), load_in_memory=False) 13 | handle = dataset.open() 14 | data, labels = dataset.get_data(handle, slice(0, 10)) 15 | assert data.dtype == 'float32' 16 | assert data.shape == (10, 4) 17 | assert labels.shape == (10, 1) 18 | known = numpy.array([5.1, 3.5, 1.4, 0.2]) 19 | assert_allclose(data[0], known) 20 | assert labels[0][0] == 0 21 | assert dataset.num_examples == 150 22 | dataset.close(handle) 23 | 24 | 25 | def test_iris_axes(): 26 | skip_if_not_available(datasets=['iris.hdf5']) 27 | 28 | dataset = Iris(('all',), load_in_memory=False) 29 | assert_equal(dataset.axis_labels['features'], 30 | ('batch', 'feature')) 31 | 32 | 33 | def test_iris_invalid_split(): 34 | skip_if_not_available(datasets=['iris.hdf5']) 35 | 36 | assert_raises(ValueError, Iris, ('dummy',)) 37 | -------------------------------------------------------------------------------- /libs/fuel/tests/test_svhn.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import h5py 4 | import numpy 5 | from numpy.testing import assert_equal 6 | 7 | from fuel import config 8 | from fuel.datasets import H5PYDataset, SVHN 9 | 10 | 11 | def test_svhn(): 12 | data_path = config.data_path 13 | try: 14 | config.data_path = '.' 15 | f = h5py.File('svhn_format_2.hdf5', 'w') 16 | f['features'] = numpy.arange(100, dtype='uint8').reshape((10, 10)) 17 | f['targets'] = numpy.arange(10, dtype='uint8').reshape((10, 1)) 18 | split_dict = {'train': {'features': (0, 8), 'targets': (0, 8)}, 19 | 'test': {'features': (8, 10), 'targets': (8, 10)}} 20 | f.attrs['split'] = H5PYDataset.create_split_array(split_dict) 21 | f.close() 22 | dataset = SVHN(which_format=2, which_sets=('train',)) 23 | assert_equal(dataset.filename, 'svhn_format_2.hdf5') 24 | finally: 25 | config.data_path = data_path 26 | os.remove('svhn_format_2.hdf5') 27 | -------------------------------------------------------------------------------- /libs/fuel/tests/test_toy.py: -------------------------------------------------------------------------------- 1 | 2 | from fuel.datasets.toy import Spiral, SwissRoll 3 | 4 | 5 | def test_spiral(): 6 | ds = Spiral(num_examples=1000, classes=2) 7 | 8 | features, position, label = ds.get_data(None, slice(0, 1000)) 9 | 10 | assert features.ndim == 2 11 | assert features.shape[0] == 1000 12 | assert features.shape[1] == 2 13 | 14 | assert position.ndim == 1 15 | assert position.shape[0] == 1000 16 | 17 | assert label.ndim == 1 18 | assert label.shape[0] == 1000 19 | 20 | assert features.max() <= 1. 21 | assert position.max() <= 1. 22 | assert label.max() == 1 23 | 24 | 25 | def test_swiossroll(): 26 | ds = SwissRoll(num_examples=1000) 27 | 28 | features, position = ds.get_data(None, slice(0, 1000)) 29 | 30 | assert features.ndim == 2 31 | assert features.shape[0] == 1000 32 | assert features.shape[1] == 3 33 | 34 | assert position.ndim == 2 35 | assert position.shape[0] == 1000 36 | assert position.shape[1] == 2 37 | 38 | assert features.max() <= 1. 39 | assert position.max() <= 1. 40 | -------------------------------------------------------------------------------- /libs/fuel/tests/transformers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/fuel/tests/transformers/__init__.py -------------------------------------------------------------------------------- /lvsr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/lvsr/__init__.py -------------------------------------------------------------------------------- /lvsr/configs/prototype_autoencoder.yaml: -------------------------------------------------------------------------------- 1 | data: 2 | batch_size: 10 3 | net: 4 | dim_dec: 100 5 | dims_bidir: [100] 6 | bottom: 7 | bottom_class: !!python/name:lvsr.bricks.recognizer.LookupBottom 8 | dim: 100 9 | 10 | enc_transition: !!python/name:blocks.bricks.recurrent.GatedRecurrent 11 | dec_transition: !!python/name:blocks.bricks.recurrent.GatedRecurrent 12 | attention_type: content 13 | use_states_for_readout: True 14 | criterion: 15 | name: log_likelihood 16 | lm: {} 17 | max_decoded_length_scale: 0.75 18 | initialization: 19 | /recognizer: 20 | weights_init: 21 | !!python/object/apply:blocks.initialization.Uniform [0.0, 0.1] 22 | biases_init: 23 | !!python/object/apply:blocks.initialization.Constant [0.0] 24 | training: 25 | gradient_threshold: 100.0 26 | scale: 0.01 27 | momentum: 0.0 28 | monitoring: 29 | validate_every_epochs: 1 30 | validate_every_batches: 0 31 | search_every_epochs: 1 32 | search_every_batches: 0 33 | search: 34 | beam_size: 10 35 | stop_on: optimistic_future_cost 36 | -------------------------------------------------------------------------------- /lvsr/utils.py: -------------------------------------------------------------------------------- 1 | def global_push_initialization_config(brick, initialization_config, 2 | filter_type=object): 3 | #TODO: this needs proper selectors! NOW! 4 | if not brick.initialization_config_pushed: 5 | raise Exception("Please push_initializatio_config first to prevent it " 6 | "form overriding the changes made by " 7 | "global_push_initialization_config") 8 | if isinstance(brick, filter_type): 9 | for k,v in initialization_config.items(): 10 | if hasattr(brick, k): 11 | setattr(brick, k, v) 12 | for c in brick.children: 13 | global_push_initialization_config( 14 | c, initialization_config, filter_type) 15 | 16 | 17 | def rename(var, name): 18 | var.name = name 19 | return var 20 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from os import path 2 | from setuptools import find_packages, setup 3 | 4 | here = path.abspath(path.dirname(__file__)) 5 | 6 | setup( 7 | name='lvsr', 8 | description='Fully Neural LVSR', 9 | url='https://github.com/rizar/fully-neural-lvsr', 10 | author='Dzmitry Bahdanau', 11 | license='MIT', 12 | packages=find_packages(exclude=['examples', 'docs', 'tests']), 13 | zip_safe=False, 14 | install_requires=['numpy', 'pykwalify', 'toposort', 'pyyaml', 15 | 'picklable-itertools', 'pandas', 'pyfst'] 16 | ) 17 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizar/attention-lvcsr/1ae52cafdd8419874846f9544a299eef9c758f3b/tests/__init__.py -------------------------------------------------------------------------------- /tests/test_conv1d.py: -------------------------------------------------------------------------------- 1 | from numpy.testing import assert_allclose 2 | 3 | from lvsr.expressions import conv1d 4 | 5 | 6 | def test_conv1d(): 7 | a = [[1.0, 2, 3], [1, 0, 1]] 8 | b = [[2, 1], [1, 3.0]] 9 | c = conv1d(a, b).eval() 10 | assert_allclose(c, [[[5, 8], [5, 9]], [[1, 2], [3, 1]]]) 11 | d = conv1d(a, b, border_mode='full').eval() 12 | assert_allclose(d, [[[2, 5, 8, 3], [1, 5, 9, 9]], 13 | [[2, 1, 2, 1], [1, 3, 1, 3]]]) 14 | -------------------------------------------------------------------------------- /tests/test_expressions.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | from numpy.testing import assert_allclose 3 | from theano import tensor 4 | 5 | from lvsr.expressions import pad_to_a_multiple 6 | 7 | def test_pad_to_a_multiple(): 8 | a = numpy.array([[1, 2], [3, 4], [5, 6]]) 9 | b = numpy.vstack([a, [[0, 0]]]) 10 | assert_allclose( 11 | pad_to_a_multiple(tensor.as_tensor_variable(a), 2, 0).eval(), b) 12 | --------------------------------------------------------------------------------