├── .clang-format ├── .gitattributes ├── .travis.yml ├── .travis └── install.sh ├── AUTHORS ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── README_ORIGINAL.md ├── U96 ├── README.md ├── create_project.tcl ├── design_1.pdf ├── regs.init ├── src │ └── design_1_bd.tcl ├── system-user.dtsi └── zcu100_96b_sensors.xdc ├── Zturn ├── README.md ├── create_project.tcl ├── design_1.pdf ├── src │ └── bd_afc3_bd.tcl └── system-user.dtsi ├── appveyor.yml ├── benchmarks ├── CMakeLists.txt ├── benchmarks.cpp └── bm_global_avepool.h ├── cereal ├── access.hpp ├── archives │ ├── adapters.hpp │ ├── binary.hpp │ ├── json.hpp │ ├── portable_binary.hpp │ └── xml.hpp ├── cereal.hpp ├── details │ ├── helpers.hpp │ ├── polymorphic_impl.hpp │ ├── polymorphic_impl_fwd.hpp │ ├── static_object.hpp │ ├── traits.hpp │ └── util.hpp ├── external │ ├── base64.hpp │ ├── rapidjson │ │ ├── allocators.h │ │ ├── document.h │ │ ├── encodedstream.h │ │ ├── encodings.h │ │ ├── error │ │ │ ├── en.h │ │ │ └── error.h │ │ ├── filereadstream.h │ │ ├── filestream.h │ │ ├── filewritestream.h │ │ ├── fwd.h │ │ ├── genericstream.h │ │ ├── internal │ │ │ ├── biginteger.h │ │ │ ├── diyfp.h │ │ │ ├── dtoa.h │ │ │ ├── ieee754.h │ │ │ ├── itoa.h │ │ │ ├── meta.h │ │ │ ├── pow10.h │ │ │ ├── regex.h │ │ │ ├── stack.h │ │ │ ├── strfunc.h │ │ │ ├── strtod.h │ │ │ └── swap.h │ │ ├── istreamwrapper.h │ │ ├── license.txt │ │ ├── memorybuffer.h │ │ ├── memorystream.h │ │ ├── msinttypes │ │ │ ├── inttypes.h │ │ │ └── stdint.h │ │ ├── ostreamwrapper.h │ │ ├── pointer.h │ │ ├── prettywriter.h │ │ ├── rapidjson.h │ │ ├── reader.h │ │ ├── schema.h │ │ ├── stream.h │ │ ├── stringbuffer.h │ │ └── writer.h │ └── rapidxml │ │ ├── license.txt │ │ ├── manual.html │ │ ├── rapidxml.hpp │ │ ├── rapidxml_iterators.hpp │ │ ├── rapidxml_print.hpp │ │ └── rapidxml_utils.hpp ├── macros.hpp └── types │ ├── array.hpp │ ├── base_class.hpp │ ├── bitset.hpp │ ├── boost_variant.hpp │ ├── chrono.hpp │ ├── common.hpp │ ├── complex.hpp │ ├── concepts │ └── pair_associative_container.hpp │ ├── deque.hpp │ ├── forward_list.hpp │ ├── functional.hpp │ ├── list.hpp │ ├── map.hpp │ ├── memory.hpp │ ├── polymorphic.hpp │ ├── queue.hpp │ ├── set.hpp │ ├── stack.hpp │ ├── string.hpp │ ├── tuple.hpp │ ├── unordered_map.hpp │ ├── unordered_set.hpp │ ├── utility.hpp │ ├── valarray.hpp │ └── vector.hpp ├── cmake ├── DownloadProject │ ├── .gitignore │ ├── .travis.yml │ ├── CMakeLists.txt │ ├── DownloadProject.CMakeLists.cmake.in │ ├── DownloadProject.cmake │ ├── LICENSE │ ├── README.md │ └── example.cpp ├── Modules │ ├── FindINTELMKL.cmake │ ├── FindNNPACK.cmake │ ├── FindTBB.cmake │ └── cotire.cmake ├── Templates │ ├── cmake-uninstall.cmake.in │ ├── tinydnn-config-version.cmake.in │ ├── tinydnn-config.cmake.in │ └── tinydnn_config.h.in ├── clang-cxx-dev-tools.cmake ├── protoc.cmake └── summary.cmake ├── core.svg ├── data ├── t10k-images.idx3-ubyte ├── t10k-labels.idx1-ubyte ├── train-images.idx3-ubyte └── train-labels.idx1-ubyte ├── dev-env.sh ├── docker └── dev-env │ ├── Dockerfile │ ├── Dockerfile.full │ └── build.sh ├── docs ├── CMakeLists.txt ├── Doxyfile ├── Doxyfile.in ├── Makefile ├── autodoc.py ├── conf.py ├── developer_guides │ ├── Adding-a-new-layer.md │ ├── Writing-Custom-Activations.md │ └── index.rst ├── device-abstraction-uml.puml ├── getting_started │ ├── Getting-started.md │ └── index.rst ├── how_tos │ ├── How-Tos.md │ ├── Integrate-with-your-application.md │ ├── Train-network-with-your-dataset.md │ └── index.rst ├── index.rst ├── layers │ ├── Layers.md │ └── index.rst ├── logo │ ├── TinyDNN-logo-B-W.png │ ├── TinyDNN-logo-letters-B-W.png │ ├── TinyDNN-logo-letters-alpha-version.png │ ├── TinyDNN-logo-letters.png │ ├── TinyDNN-logo.png │ └── raw │ │ ├── GidoleFont │ │ ├── Gidole-Regular.ttf │ │ ├── Gidolinya-Regular.otf │ │ ├── License.txt │ │ └── Readme-Characters.pdf │ │ ├── TinyDNN-logo-B-W.svg │ │ ├── TinyDNN-logo-letters-B-W.svg │ │ ├── TinyDNN-logo-letters-EDITABLE-LETTERS.svg │ │ ├── TinyDNN-logo-letters-alpha-version.svg │ │ ├── TinyDNN-logo-letters.svg │ │ └── TinyDNN-logo.svg ├── make.bat ├── readme.md ├── resource │ └── graph.gif └── update_log │ ├── index.rst │ └── v0_0_1-to-v0_1_0.md ├── examples ├── CMakeLists.txt ├── DW-conv │ ├── Makefile │ ├── README.md │ ├── model.svg │ ├── speed.svg │ ├── train.cpp │ ├── train_mp.cpp │ ├── train_tb.cpp │ └── train_z7.cpp ├── backends │ └── cblas │ │ └── test_mlp.cpp ├── benchmarks │ └── main.cpp ├── build.bat ├── caffe_converter │ ├── CMakeLists.txt │ ├── caffe_converter.cpp │ └── readme.md ├── char_rnn │ ├── README.md │ ├── char_rnn.cpp │ ├── data │ │ ├── char_rnn_weights │ │ └── encoding.raw │ ├── python │ │ ├── __init__.py │ │ ├── gitter_server.py │ │ ├── prepare_dataset.py │ │ ├── setup.sh │ │ ├── tiny_dnn │ │ │ ├── __init__.py │ │ │ ├── setup.py │ │ │ ├── tiny_char_rnn.h │ │ │ └── tiny_char_rnn.i │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── dataset.py │ │ │ ├── encoder.py │ │ │ ├── gitter.py │ │ │ └── preprocessor.py │ └── test_char_rnn.cpp ├── cifar10 │ ├── cifar-weights │ ├── readme.md │ ├── test.cpp │ └── train.cpp ├── deconv │ ├── readme.md │ ├── train.cpp │ └── visual.cpp ├── ios │ └── readme.md ├── main.cpp ├── mnist │ ├── quantized.cpp │ ├── readme.md │ ├── test.cpp │ └── train.cpp ├── recurrent_addition │ ├── README.md │ └── addition.cpp ├── simple-conv │ ├── Makefile │ ├── README.md │ ├── model.svg │ ├── speed.svg │ ├── train.cpp │ ├── train_mp.cpp │ ├── train_tb.cpp │ └── train_z7.cpp ├── sinus_fit │ └── sinus_fit.cpp └── ssd_detection │ ├── README.md │ ├── convert_models.py │ └── test.cpp ├── function.md ├── scripts ├── clang-format.sh ├── cpplint_test.sh ├── run_lints.sh └── update-authors.sh ├── src ├── loop_lib.sv ├── tiny_dnn_buf.sv ├── tiny_dnn_control.sv ├── tiny_dnn_core.sv ├── tiny_dnn_ex_ctl.sv ├── tiny_dnn_pool.sv ├── tiny_dnn_sc_ctl.cpp ├── tiny_dnn_sc_ctl.h └── tiny_dnn_top.sv ├── src_c ├── fpga │ └── tiny_dnn │ │ └── core │ │ └── kernels │ │ ├── conv2d_op_internal.h │ │ ├── dwconv2d_op_internal.h │ │ └── maxpool_op_internal.h ├── hardfp │ └── tiny_dnn │ │ └── core │ │ └── kernels │ │ ├── conv2d_op_internal.h │ │ ├── dwconv2d_op_internal.h │ │ └── maxpool_op_internal.h ├── soft │ └── tiny_dnn │ │ ├── activations │ │ └── relu_layer.h │ │ ├── config.h │ │ └── core │ │ └── kernels │ │ ├── conv2d_op_internal.h │ │ ├── dwconv2d_op_internal.h │ │ └── maxpool_op_internal.h └── softfp │ └── tiny_dnn │ ├── core │ └── kernels │ │ ├── conv2d_op_internal.h │ │ ├── dwconv2d_op_internal.h │ │ ├── maxpool_op.h │ │ ├── maxpool_op_avx.h │ │ └── maxpool_op_internal.h │ └── node.h ├── src_fp ├── tiny_dnn_buf.sv ├── tiny_dnn_core.sv ├── tiny_dnn_pool.sv └── tiny_dnn_top.sv ├── src_fpga ├── tiny_dnn_reg.v └── tiny_dnn_top.v ├── test ├── CMakeLists.txt ├── print_device.cpp ├── test.cpp ├── test_activation_layer.h ├── test_average_pooling_layer.h ├── test_average_unpooling_layer.h ├── test_batch_norm_layer.h ├── test_caffe_converter.h ├── test_concat_layer.h ├── test_convolutional_layer.h ├── test_core.h ├── test_deconvolutional_layer.h ├── test_dropout_layer.h ├── test_fully_connected_layer.h ├── test_global_average_pooling_layer.h ├── test_gru_cell.h ├── test_image.h ├── test_integration.h ├── test_l2_norm_layer.h ├── test_large_thread_count.h ├── test_lrn_layer.h ├── test_lstm_cell.h ├── test_main.cpp ├── test_max_pooling_layer.h ├── test_models.h ├── test_network.h ├── test_nms.h ├── test_node.h ├── test_nodes.h ├── test_optimizers.h ├── test_power_layer.h ├── test_quantization.h ├── test_quantized_convolutional_layer.h ├── test_quantized_deconvolutional_layer.h ├── test_quantized_fully_connected_layer.h ├── test_rnn_cell.h ├── test_serialization.h ├── test_slice_layer.h ├── test_target_cost.h ├── test_tensor.h ├── test_zero_pad_layer.h ├── testhelper.h └── testimage │ ├── bmp │ ├── 24bit.bmp │ └── 8bit.bmp │ └── pngsuite │ ├── 16bit │ ├── basi0g16.png │ ├── basi2c16.png │ ├── basi4a16.png │ ├── basi6a16.png │ ├── basn0g16.png │ ├── basn2c16.png │ ├── basn4a16.png │ ├── basn6a16.png │ ├── bgai4a16.png │ ├── bgan6a16.png │ ├── bggn4a16.png │ ├── bgyn6a16.png │ ├── oi1n0g16.png │ ├── oi1n2c16.png │ ├── oi2n0g16.png │ ├── oi2n2c16.png │ ├── oi4n0g16.png │ ├── oi4n2c16.png │ ├── oi9n0g16.png │ ├── oi9n2c16.png │ ├── tbbn2c16.png │ ├── tbgn2c16.png │ └── tbwn0g16.png │ ├── PngSuite.LICENSE │ ├── corrupt │ ├── xc1n0g08.png │ ├── xc9n2c08.png │ ├── xcrn0g04.png │ ├── xcsn0g01.png │ ├── xd0n2c08.png │ ├── xd3n2c08.png │ ├── xd9n2c08.png │ ├── xdtn0g01.png │ ├── xhdn0g08.png │ ├── xlfn0g04.png │ ├── xs1n0g01.png │ ├── xs2n0g01.png │ ├── xs4n0g01.png │ └── xs7n0g01.png │ ├── primary │ ├── basi0g01.png │ ├── basi0g02.png │ ├── basi0g04.png │ ├── basi0g08.png │ ├── basi2c08.png │ ├── basi3p01.png │ ├── basi3p02.png │ ├── basi3p04.png │ ├── basi3p08.png │ ├── basi4a08.png │ ├── basi6a08.png │ ├── basn0g01.png │ ├── basn0g02.png │ ├── basn0g04.png │ ├── basn0g08.png │ ├── basn2c08.png │ ├── basn3p01.png │ ├── basn3p02.png │ ├── basn3p04.png │ ├── basn3p08.png │ ├── basn4a08.png │ ├── basn6a08.png │ ├── bgai4a08.png │ ├── bgan6a08.png │ ├── bgbn4a08.png │ ├── bgwn6a08.png │ ├── s01i3p01.png │ ├── s01n3p01.png │ ├── s02i3p01.png │ ├── s02n3p01.png │ ├── s03i3p01.png │ ├── s03n3p01.png │ ├── s04i3p01.png │ ├── s04n3p01.png │ ├── s05i3p02.png │ ├── s05n3p02.png │ ├── s06i3p02.png │ ├── s06n3p02.png │ ├── s07i3p02.png │ ├── s07n3p02.png │ ├── s08i3p02.png │ ├── s08n3p02.png │ ├── s09i3p02.png │ ├── s09n3p02.png │ ├── s32i3p04.png │ ├── s32n3p04.png │ ├── s33i3p04.png │ ├── s33n3p04.png │ ├── s34i3p04.png │ ├── s34n3p04.png │ ├── s35i3p04.png │ ├── s35n3p04.png │ ├── s36i3p04.png │ ├── s36n3p04.png │ ├── s37i3p04.png │ ├── s37n3p04.png │ ├── s38i3p04.png │ ├── s38n3p04.png │ ├── s39i3p04.png │ ├── s39n3p04.png │ ├── s40i3p04.png │ ├── s40n3p04.png │ ├── tbbn0g04.png │ ├── tbbn3p08.png │ ├── tbgn3p08.png │ ├── tbrn2c08.png │ ├── tbwn3p08.png │ ├── tbyn3p08.png │ ├── tm3n3p02.png │ ├── tp0n0g08.png │ ├── tp0n2c08.png │ ├── tp0n3p08.png │ ├── tp1n3p08.png │ ├── z00n2c08.png │ ├── z03n2c08.png │ ├── z06n2c08.png │ └── z09n2c08.png │ ├── primary_check │ ├── basi0g01.png │ ├── basi0g02.png │ ├── basi0g04.png │ ├── basi0g08.png │ ├── basi2c08.png │ ├── basi3p01.png │ ├── basi3p02.png │ ├── basi3p04.png │ ├── basi3p08.png │ ├── basi4a08.png │ ├── basi6a08.png │ ├── basn0g01.png │ ├── basn0g02.png │ ├── basn0g04.png │ ├── basn0g08.png │ ├── basn2c08.png │ ├── basn3p01.png │ ├── basn3p02.png │ ├── basn3p04.png │ ├── basn3p08.png │ ├── basn4a08.png │ ├── basn6a08.png │ ├── bgai4a08.png │ ├── bgan6a08.png │ ├── bgbn4a08.png │ ├── bgwn6a08.png │ ├── s01i3p01.png │ ├── s01n3p01.png │ ├── s02i3p01.png │ ├── s02n3p01.png │ ├── s03i3p01.png │ ├── s03n3p01.png │ ├── s04i3p01.png │ ├── s04n3p01.png │ ├── s05i3p02.png │ ├── s05n3p02.png │ ├── s06i3p02.png │ ├── s06n3p02.png │ ├── s07i3p02.png │ ├── s07n3p02.png │ ├── s08i3p02.png │ ├── s08n3p02.png │ ├── s09i3p02.png │ ├── s09n3p02.png │ ├── s32i3p04.png │ ├── s32n3p04.png │ ├── s33i3p04.png │ ├── s33n3p04.png │ ├── s34i3p04.png │ ├── s34n3p04.png │ ├── s35i3p04.png │ ├── s35n3p04.png │ ├── s36i3p04.png │ ├── s36n3p04.png │ ├── s37i3p04.png │ ├── s37n3p04.png │ ├── s38i3p04.png │ ├── s38n3p04.png │ ├── s39i3p04.png │ ├── s39n3p04.png │ ├── s40i3p04.png │ ├── s40n3p04.png │ ├── tbbn0g04.png │ ├── tbbn3p08.png │ ├── tbgn3p08.png │ ├── tbrn2c08.png │ ├── tbwn3p08.png │ ├── tbyn3p08.png │ ├── tm3n3p02.png │ ├── tp0n0g08.png │ ├── tp0n2c08.png │ ├── tp0n3p08.png │ ├── tp1n3p08.png │ ├── z00n2c08.png │ ├── z03n2c08.png │ ├── z06n2c08.png │ └── z09n2c08.png │ └── unused │ ├── ccwn2c08.png │ ├── ccwn3p08.png │ ├── cdfn2c08.png │ ├── cdhn2c08.png │ ├── cdsn2c08.png │ ├── cdun2c08.png │ ├── ch1n3p04.png │ ├── ch2n3p08.png │ ├── cm0n0g04.png │ ├── cm7n0g04.png │ ├── cm9n0g04.png │ ├── cs3n2c16.png │ ├── cs3n3p08.png │ ├── cs5n2c08.png │ ├── cs5n3p08.png │ ├── cs8n2c08.png │ ├── cs8n3p08.png │ ├── ct0n0g04.png │ ├── ct1n0g04.png │ ├── cten0g04.png │ ├── ctfn0g04.png │ ├── ctgn0g04.png │ ├── cthn0g04.png │ ├── ctjn0g04.png │ ├── ctzn0g04.png │ ├── f00n0g08.png │ ├── f00n2c08.png │ ├── f01n0g08.png │ ├── f01n2c08.png │ ├── f02n0g08.png │ ├── f02n2c08.png │ ├── f03n0g08.png │ ├── f03n2c08.png │ ├── f04n0g08.png │ ├── f04n2c08.png │ ├── f99n0g04.png │ ├── g03n0g16.png │ ├── g03n2c08.png │ ├── g03n3p04.png │ ├── g04n0g16.png │ ├── g04n2c08.png │ ├── g04n3p04.png │ ├── g05n0g16.png │ ├── g05n2c08.png │ ├── g05n3p04.png │ ├── g07n0g16.png │ ├── g07n2c08.png │ ├── g07n3p04.png │ ├── g10n0g16.png │ ├── g10n2c08.png │ ├── g10n3p04.png │ ├── g25n0g16.png │ ├── g25n2c08.png │ ├── g25n3p04.png │ ├── pp0n2c16.png │ ├── pp0n6a08.png │ ├── ps1n0g08.png │ ├── ps1n2c16.png │ ├── ps2n0g08.png │ └── ps2n2c16.png ├── third_party ├── CLCudaAPI │ ├── clpp11.h │ └── cupp11.h ├── catch2 │ └── catch.hpp ├── cl_kernels │ ├── activation.cl │ ├── auxiliary.cl │ ├── batch_reindex.cl │ ├── benchmark.cl │ ├── bias.cl │ ├── bnll.cl │ ├── channel.cl │ ├── concat.cl │ ├── contrastive_loss.cl │ ├── conv_layer_spatial.cl │ ├── conv_spatial_helper.cl │ ├── crop.cl │ ├── dropout.cl │ ├── eltwise.cl │ ├── elu.cl │ ├── embed.cl │ ├── fft.cl │ ├── fillbuffer.cl │ ├── im2col.cl │ ├── im2col_nd.cl │ ├── lrn.cl │ ├── lstm_unit.cl │ ├── math.cl │ ├── mergecrop.cl │ ├── pooling.cl │ ├── pooling_nd.cl │ ├── pooling_sk.cl │ ├── slice.cl │ ├── softmax_loss.cl │ ├── solvers.cl │ └── tile.cl ├── cpplint.py ├── gemmlowp │ ├── eight_bit_int_gemm │ │ ├── eight_bit_int_gemm.cc │ │ └── eight_bit_int_gemm.h │ ├── internal │ │ ├── allocator.h │ │ ├── block_params.h │ │ ├── common.h │ │ ├── compute.h │ │ ├── fixedpoint.h │ │ ├── fixedpoint_neon.h │ │ ├── iterator.h │ │ ├── kernel.h │ │ ├── kernel_SSE.h │ │ ├── kernel_default.h │ │ ├── kernel_neon.h │ │ ├── kernel_reference.h │ │ ├── multi_thread_gemm.h │ │ ├── output.h │ │ ├── output_neon.h │ │ ├── pack.h │ │ ├── pack_SSE.h │ │ ├── pack_neon.h │ │ ├── single_thread_gemm.h │ │ ├── unpack.h │ │ └── unpack_neon.h │ ├── meta │ │ ├── README │ │ ├── generators │ │ │ ├── cc_emitter.py │ │ │ ├── gemm_MxNxK.py │ │ │ ├── gemv_1xMxK.py │ │ │ ├── meta.py │ │ │ ├── meta_arm_32.py │ │ │ ├── meta_arm_64.py │ │ │ ├── meta_arm_common.py │ │ │ ├── mul_1x8_Mx8_neon.py │ │ │ ├── mul_Nx8_Mx8_neon.py │ │ │ ├── neon_emitter.py │ │ │ ├── neon_emitter_64.py │ │ │ ├── qnt_Nx8_neon.py │ │ │ └── zip_Nx8_neon.py │ │ ├── multi_thread_common.h │ │ ├── multi_thread_gemm.h │ │ ├── multi_thread_gemv.h │ │ ├── operations_common.h │ │ ├── single_thread_gemm.h │ │ ├── single_thread_gemm_arm32.h │ │ └── single_thread_gemm_arm64.h │ ├── profiling │ │ ├── instrumentation.h │ │ └── profiler.h │ └── public │ │ ├── bit_depth.h │ │ ├── gemmlowp.h │ │ ├── map.h │ │ ├── output_stages.h │ │ └── reference_gemm.h └── stb │ ├── stb_image.h │ ├── stb_image_resize.h │ └── stb_image_write.h ├── tiny_dnn ├── activations │ ├── activation_layer.h │ ├── asinh_layer.h │ ├── elu_layer.h │ ├── leaky_relu_layer.h │ ├── relu_layer.h │ ├── selu_layer.h │ ├── sigmoid_layer.h │ ├── softmax_layer.h │ ├── softplus_layer.h │ ├── softsign_layer.h │ ├── tanh_layer.h │ └── tanh_p1m2_layer.h ├── config.h ├── core │ ├── backend.h │ ├── backend_avx.h │ ├── backend_tiny.h │ ├── framework │ │ ├── device.fwd.h │ │ ├── device.h │ │ ├── op_kernel.h │ │ ├── program.h │ │ ├── program_manager.h │ │ ├── tensor.h │ │ └── tensor_utils.h │ ├── kernels │ │ ├── avx_deconv2d_back_kernel.h │ │ ├── avx_deconv2d_kernel.h │ │ ├── avx_kernel_common.h │ │ ├── conv2d_grad_op.h │ │ ├── conv2d_grad_op_avx.h │ │ ├── conv2d_op.h │ │ ├── conv2d_op_avx.h │ │ ├── conv2d_op_internal.h │ │ ├── conv2d_op_libdnn.h │ │ ├── conv2d_op_nnpack.h │ │ ├── conv2d_op_opencl.h │ │ ├── dwconv2d_grad_op.h │ │ ├── dwconv2d_op.h │ │ ├── dwconv2d_op_internal.h │ │ ├── fully_connected_grad_op.h │ │ ├── fully_connected_op.h │ │ ├── fully_connected_op_avx.h │ │ ├── fully_connected_op_cblas.h │ │ ├── fully_connected_op_intel_mkl.h │ │ ├── fully_connected_op_internal.h │ │ ├── fully_connected_op_nnpack.h │ │ ├── global_avepool_grad_op.h │ │ ├── global_avepool_op.h │ │ ├── global_avepool_op_avx.h │ │ ├── global_avepool_op_internal.h │ │ ├── gru_cell_grad_op.h │ │ ├── gru_cell_op.h │ │ ├── gru_cell_op_internal.h │ │ ├── lstm_cell_grad_op.h │ │ ├── lstm_cell_op.h │ │ ├── lstm_cell_op_internal.h │ │ ├── maxpool_grad_op.h │ │ ├── maxpool_op.h │ │ ├── maxpool_op_avx.h │ │ ├── maxpool_op_internal.h │ │ ├── maxpool_op_nnpack.h │ │ ├── nnp_deconv2d_kernel.h │ │ ├── rnn_cell_grad_op.h │ │ ├── rnn_cell_op.h │ │ ├── rnn_cell_op_internal.h │ │ ├── tiny_deconv2d_back_kernel.h │ │ ├── tiny_deconv2d_kernel.h │ │ ├── tiny_quantization_kernel.h │ │ ├── tiny_quantized_conv2d_kernel.h │ │ ├── tiny_quantized_deconv2d_kernel.h │ │ ├── tiny_quantized_fully_connected_kernel.h │ │ └── tiny_quantized_matmul_kernel.h │ ├── params │ │ ├── conv_params.h │ │ ├── deconv_params.h │ │ ├── dwconv_params.h │ │ ├── fully_params.h │ │ ├── global_avepool_params.h │ │ ├── gru_cell_params.h │ │ ├── lstm_cell_params.h │ │ ├── maxpool_params.h │ │ ├── params.h │ │ └── rnn_cell_params.h │ └── session.h ├── io │ ├── caffe │ │ ├── CPPLINT.cfg │ │ ├── caffe.proto │ │ ├── layer_factory.h │ │ └── layer_factory_impl.h │ ├── cifar10_parser.h │ ├── display.h │ ├── layer_factory.h │ └── mnist_parser.h ├── layers │ ├── arithmetic_layer.h │ ├── average_pooling_layer.h │ ├── average_unpooling_layer.h │ ├── batch_normalization_layer.h │ ├── cell.h │ ├── cells.h │ ├── concat_layer.h │ ├── convolutional_layer.h │ ├── deconvolutional_layer.h │ ├── dropout_layer.h │ ├── dwconvolutional_layer.h │ ├── fully_connected_layer.h │ ├── global_average_pooling_layer.h │ ├── gru_cell.h │ ├── input_layer.h │ ├── l2_normalization_layer.h │ ├── layer.h │ ├── layers.h │ ├── linear_layer.h │ ├── lrn_layer.h │ ├── lstm_cell.h │ ├── max_pooling_layer.h │ ├── max_unpooling_layer.h │ ├── partial_connected_layer.h │ ├── power_layer.h │ ├── quantized_convolutional_layer.h │ ├── quantized_deconvolutional_layer.h │ ├── quantized_fully_connected_layer.h │ ├── recurrent_layer.h │ ├── rnn_cell.h │ ├── slice_layer.h │ └── zero_pad_layer.h ├── lossfunctions │ └── loss_function.h ├── models │ └── alexnet.h ├── network.h ├── node.h ├── nodes.h ├── optimizers │ └── optimizer.h ├── tiny_dnn.h ├── util │ ├── aligned_allocator.h │ ├── colored_print.h │ ├── deform.h │ ├── deserialization_helper.h │ ├── gradient_check.h │ ├── graph_visualizer.h │ ├── image.h │ ├── macro.h │ ├── math_functions.h │ ├── nms.h │ ├── nn_error.h │ ├── parallel_for.h │ ├── product.h │ ├── random.h │ ├── serialization_functions.h │ ├── serialization_helper.h │ ├── serialization_layer_list.h │ ├── target_cost.h │ ├── util.h │ └── weight_init.h └── xtensor │ ├── xadapt.hpp │ ├── xarray.hpp │ ├── xassign.hpp │ ├── xaxis_iterator.hpp │ ├── xbroadcast.hpp │ ├── xbuffer_adaptor.hpp │ ├── xbuilder.hpp │ ├── xcomplex.hpp │ ├── xcontainer.hpp │ ├── xcsv.hpp │ ├── xeval.hpp │ ├── xexception.hpp │ ├── xexpression.hpp │ ├── xfunction.hpp │ ├── xfunctorview.hpp │ ├── xgenerator.hpp │ ├── xindexview.hpp │ ├── xinfo.hpp │ ├── xio.hpp │ ├── xiterable.hpp │ ├── xiterator.hpp │ ├── xlayout.hpp │ ├── xmath.hpp │ ├── xmissing.hpp │ ├── xnoalias.hpp │ ├── xoffsetview.hpp │ ├── xoperation.hpp │ ├── xoptional.hpp │ ├── xrandom.hpp │ ├── xreducer.hpp │ ├── xscalar.hpp │ ├── xsemantic.hpp │ ├── xslice.hpp │ ├── xstorage.hpp │ ├── xstridedview.hpp │ ├── xstrides.hpp │ ├── xtensor.hpp │ ├── xtensor_config.hpp │ ├── xtensor_forward.hpp │ ├── xutils.hpp │ ├── xvectorize.hpp │ ├── xview.hpp │ └── xview_utils.hpp ├── top.svg └── vc └── vc14 ├── 2653-9246-1821-1976 ├── 2952-0039-1819-5325 ├── tiny_cnn.sln ├── tiny_cnn.vcxproj ├── tiny_cnn.vcxproj.filters └── tiny_cnn_test.vcxproj /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.travis/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [ "$TRAVIS_OS_NAME" == "osx" ]; then 5 | brew update >/dev/null 6 | [ -z $( brew tap | grep 'homebrew/core' ) ] && brew tap homebrew/core 7 | # TODO download homebrew-cache.tar.gz from s3 or similar to speed up the build 8 | # Travis OSX boxes don't provide caching unfortunately 9 | if [ -f "${HOME}/homebrew-cache/homebrew-cache.tar.gz" ]; then 10 | tar -xvzf "${HOME}/homebrew-cache/homebrew-cache.tar.gz" --directory /usr/local/Cellar 11 | brew link --force tbb cmake 12 | brew install pkg-config 13 | else 14 | # Fix errors on Travis CI with macOS due to the conflict of python@2 15 | brew unlink python 16 | # Install tbb and its dependencies 17 | [ -z "$( brew ls --versions tbb )" ] && brew install --c++11 tbb 18 | [ -z "$( brew ls --versions cmake )" ] && brew install cmake 19 | mkdir "${HOME}/homebrew-cache" 20 | tar -czvf "${HOME}/homebrew-cache/homebrew-cache.tar.gz" --directory /usr/local/Cellar tbb cmake 21 | fi 22 | fi 23 | 24 | if [ "$TRAVIS_OS_NAME" == "linux" ]; then 25 | curl http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -; 26 | echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main" | sudo tee -a /etc/apt/sources.list; 27 | sudo apt-get update -qq; 28 | sudo apt-get install clang-format-4.0 -y; 29 | fi 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tiny-dnn を FPGA で加速する 2 | 3 | tiny-dnn の各レイヤを Zynq の PL 部に作ったアクセラレータ回路にオフロードすることで、CNN の学習を加速します。 4 | 5 | 以前は [ここ](https://github.com/tom01h/tiny-dnn) で開発していました。履歴の見たい方はぜひ。 6 | IP の機能以外 (DMA とか petalinux とか) を参考にしたい方は [こっち](https://github.com/tom01h/TIL/tree/master/petalinux_dma) のほうがわかりやすいと思います。 7 | 8 | オリジナルの [tiny-dnn のリポジトリ](https://github.com/tiny-dnn/tiny-dnn) 9 | 10 | ## 構成概要 11 | 12 | 畳み込みの行列乗算を 16MAC (bfloat16) で並列に計算して学習を加速します。 13 | AXI Stream で 1サンプル分のデータを受け取り、core で畳み込み計算をして、AXI Stream で 1サンプル分の結果を吐き出します。 14 | im2col は on the fly で実行するので、転送データとバッファメモリを節約できます。 15 | [詳しくは](https://github.com/tom01h/tiny-dnn-fpga/blob/master/function.md) 16 | 17 | ![](top.svg) 18 | 19 | ## 実装例1: シンプル畳み込みニューラルネット 20 | 21 | 実装は ```examples/simple-conv``` です。課題は MNIST。 22 | 23 | このくらい高速になります。 24 | ただし、次の変更をソフトウェアに入れています。 25 | 26 | 1. 入力データの傾きを求める計算をスキップする 27 | 2. 畳み込みレイヤで ΔW をミニバッチ分だけ累積する (FPGA(wPL)のみ) 28 | 29 | ![](examples/simple-conv/speed.svg) 30 | 31 | ### 使っている NN モデル 32 | ![](examples/simple-conv/model.svg) 33 | 34 | ## 実装例2: Separable 畳み込みニューラルネット 35 | 36 | 実装は ```examples/DW-conv``` で作成中です。課題は MNIST。 37 | 普通の convolution と pooling レイヤをアクセラレータ対応済みです。 38 | DW-conv レイヤーは順方向と逆方向がアクセラレータ対応済みです。 39 | 40 | ![](examples/DW-conv/speed.svg) 41 | 42 | ### 使っている NN モデル 43 | 44 | 真ん中の2個の conv3x3 は Depthwise Separable Convolution です。 45 | 46 | ![](examples/DW-conv/model.svg) 47 | 48 | -------------------------------------------------------------------------------- /U96/design_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/U96/design_1.pdf -------------------------------------------------------------------------------- /U96/regs.init: -------------------------------------------------------------------------------- 1 | .set. 0xFF41A040 = 0x3; 2 | -------------------------------------------------------------------------------- /U96/system-user.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "system-conf.dtsi" 2 | /{ 3 | chosen { 4 | bootargs = "earlycon clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait uio_pdrv_genirq.of_id=generic-uio"; 5 | stdout-path = "serial0:115200n8"; 6 | }; 7 | udmabuf@0 { 8 | compatible = "ikwzm,udmabuf-0.10.a"; 9 | device-name = "udmabuf0"; 10 | size = <0x080000>; // 512KB 11 | dma-coherent; 12 | }; 13 | udmabuf@1 { 14 | compatible = "ikwzm,udmabuf-0.10.a"; 15 | device-name = "udmabuf1"; 16 | size = <0x080000>; // 512KB 17 | dma-coherent; 18 | }; 19 | }; 20 | 21 | &axi_dma_0 { 22 | compatible = "generic-uio"; 23 | dma-coherent; 24 | }; 25 | &tiny_dnn_top_0 { 26 | compatible = "generic-uio"; 27 | }; 28 | -------------------------------------------------------------------------------- /U96/zcu100_96b_sensors.xdc: -------------------------------------------------------------------------------- 1 | set_property IOSTANDARD LVCMOS18 [get_ports UART*] 2 | #set_property IOSTANDARD LVCMOS18 [get_ports loopback_out*] 3 | 4 | #HD_GPIO_5 on FPGA / Connector pin 13 / UART1_rxd 5 | set_property PACKAGE_PIN G5 [get_ports UART1_rxd] 6 | #HD_GPIO_4 on FPGA / Connector pin 11 / UART1_txd 7 | set_property PACKAGE_PIN F6 [get_ports UART1_txd] 8 | 9 | set_property IOSTANDARD LVCMOS18 [get_ports BT*] 10 | 11 | #BT_HCI_RTS on FPGA / emio_uart0_ctsn connect to 12 | set_property PACKAGE_PIN B7 [get_ports BT_ctsn] 13 | #BT_HCI_CTS on FPGA / emio_uart0_rtsn 14 | set_property PACKAGE_PIN B5 [get_ports BT_rtsn] 15 | -------------------------------------------------------------------------------- /Zturn/design_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/Zturn/design_1.pdf -------------------------------------------------------------------------------- /Zturn/system-user.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "system-conf.dtsi" 2 | / { 3 | chosen { 4 | bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio root=/dev/mmcblk0p2 rw rootwait"; 5 | stdout-path = "serial0:115200n8"; 6 | }; 7 | udmabuf@0 { 8 | compatible = "ikwzm,udmabuf-0.10.a"; 9 | device-name = "udmabuf0"; 10 | size = <0x080000>; // 512KB 11 | dma-coherent; 12 | }; 13 | udmabuf@1 { 14 | compatible = "ikwzm,udmabuf-0.10.a"; 15 | device-name = "udmabuf1"; 16 | size = <0x080000>; // 512KB 17 | dma-coherent; 18 | }; 19 | }; 20 | 21 | &axi_dma_0 { 22 | compatible = "generic-uio"; 23 | dma-coherent; 24 | }; 25 | &tiny_dnn_top_0 { 26 | compatible = "generic-uio"; 27 | }; 28 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | init: 2 | - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) 3 | 4 | environment: 5 | home: C:\projects 6 | cmake: C:\projects\cmake-3.4.1-win32-x86\bin\cmake.exe 7 | matrix: 8 | - generator : Visual Studio 14 9 | - generator : Visual Studio 14 Win64 10 | 11 | version: '{branch}-{build}' 12 | 13 | os: Visual Studio 2015 14 | 15 | branches: 16 | only: 17 | - master 18 | - feat/xtensor_integration 19 | 20 | install: 21 | # Clone submodule 22 | - git submodule update --init --recursive 23 | # Get a recent CMake: 24 | - cmd: cd %home% 25 | - ps: wget https://cmake.org/files/v3.4/cmake-3.4.1-win32-x86.zip -OutFile cmake.zip 26 | - cmd: 7z x cmake.zip -o"C:\projects" -y > nul # will extract to cmake-3.4.1-win32-x86\ 27 | - cmd: '%cmake% --version' 28 | 29 | # gradient-check test is too slow to execute on debug mode 30 | configuration: Release 31 | 32 | before_build: 33 | - cmd: mkdir build 34 | - cmd: cd build 35 | - cmd: '%cmake% -G "%generator%" -DUSE_SSE=ON -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=..\install ..\tiny-dnn' 36 | 37 | after_build: 38 | - cmd: 'cd C:\projects\build\test\Release' 39 | - cmd: tiny_dnn_test.exe 40 | 41 | build_script: 42 | - msbuild C:\projects\build\tiny_dnn.sln 43 | -------------------------------------------------------------------------------- /benchmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(../cmake/DownloadProject/DownloadProject.cmake) 2 | download_project( 3 | PROJ benchmark 4 | GIT_REPOSITORY https://github.com/google/benchmark.git 5 | GIT_TAG v1.1.0 6 | UPDATE_DISCONNECTED 1 7 | ) 8 | 9 | unset(CMAKE_CXX_STANDARD) 10 | unset(CMAKE_CXX_STANDARD_REQUIRED) 11 | 12 | add_subdirectory(${benchmark_SOURCE_DIR} ${benchmark_BINARY_DIR}) 13 | include_directories("${benchmark_SOURCE_DIR}/include") 14 | 15 | set(CMAKE_CXX_STANDARD 14) 16 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 17 | 18 | add_executable(tiny_dnn_benchmarks benchmarks.cpp) 19 | target_link_libraries(tiny_dnn_benchmarks 20 | ${project_library_target_name} ${REQUIRED_LIBRARIES} benchmark) 21 | 22 | #### Clang-tidy check 23 | #include(../cmake/clang-cxx-dev-tools.cmake) 24 | -------------------------------------------------------------------------------- /benchmarks/benchmarks.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #ifndef _CRT_SECURE_NO_WARNINGS 9 | #define _CRT_SECURE_NO_WARNINGS 10 | #endif 11 | #include "benchmark/benchmark.h" 12 | #include "tiny_dnn/tiny_dnn.h" 13 | 14 | #include "bm_global_avepool.h" 15 | using namespace tiny_dnn::benchmarks; 16 | 17 | BENCHMARK_MAIN(); 18 | -------------------------------------------------------------------------------- /cereal/external/rapidjson/filestream.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_FILESTREAM_H_ 2 | #define RAPIDJSON_FILESTREAM_H_ 3 | 4 | #include 5 | 6 | namespace rapidjson { 7 | 8 | //! Wrapper of C file stream for input or output. 9 | /*! 10 | This simple wrapper does not check the validity of the stream. 11 | \implements Stream 12 | */ 13 | class FileStream { 14 | public: 15 | typedef char Ch; //!< Character type. Only support char. 16 | 17 | FileStream(FILE* fp) : fp_(fp), count_(0) { Read(); } 18 | 19 | char Peek() const { return current_; } 20 | char Take() { char c = current_; Read(); return c; } 21 | size_t Tell() const { return count_; } 22 | void Put(char c) { fputc(c, fp_); } 23 | 24 | // Not implemented 25 | char* PutBegin() { return 0; } 26 | size_t PutEnd(char*) { return 0; } 27 | 28 | private: 29 | void Read() { 30 | RAPIDJSON_ASSERT(fp_ != 0); 31 | int c = fgetc(fp_); 32 | if (c != EOF) { 33 | current_ = (char)c; 34 | count_++; 35 | } 36 | else 37 | current_ = '\0'; 38 | } 39 | 40 | FILE* fp_; 41 | char current_; 42 | size_t count_; 43 | }; 44 | 45 | } // namespace rapidjson 46 | 47 | #endif // RAPIDJSON_FILESTREAM_H_ 48 | -------------------------------------------------------------------------------- /cereal/external/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 2 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 3 | 4 | namespace rapidjson { 5 | namespace internal { 6 | 7 | //! Custom strlen() which works on different character types. 8 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 9 | \param s Null-terminated input string. 10 | \return Number of characters in the string. 11 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 12 | */ 13 | template 14 | inline SizeType StrLen(const Ch* s) { 15 | const Ch* p = s; 16 | while (*p != '\0') 17 | ++p; 18 | return SizeType(p - s); 19 | } 20 | 21 | } // namespace internal 22 | } // namespace rapidjson 23 | 24 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 25 | -------------------------------------------------------------------------------- /cereal/external/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | CEREAL_RAPIDJSON_DIAG_PUSH 22 | CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | CEREAL_RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) CEREAL_RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | CEREAL_RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | CEREAL_RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /cereal/external/rapidjson/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 Milo Yip 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /cereal/external/rapidjson/stringbuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_STRINGBUFFER_H_ 2 | #define RAPIDJSON_STRINGBUFFER_H_ 3 | 4 | #include "rapidjson.h" 5 | #include "internal/stack.h" 6 | 7 | namespace rapidjson { 8 | 9 | //! Represents an in-memory output stream. 10 | /*! 11 | \tparam Encoding Encoding of the stream. 12 | \tparam Allocator type for allocating memory buffer. 13 | \implements Stream 14 | */ 15 | template 16 | struct GenericStringBuffer { 17 | typedef typename Encoding::Ch Ch; 18 | 19 | GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} 20 | 21 | void Put(Ch c) { *stack_.template Push() = c; } 22 | 23 | void Clear() { stack_.Clear(); } 24 | 25 | const char* GetString() const { 26 | // Push and pop a null terminator. This is safe. 27 | *stack_.template Push() = '\0'; 28 | stack_.template Pop(1); 29 | 30 | return stack_.template Bottom(); 31 | } 32 | 33 | size_t Size() const { return stack_.GetSize(); } 34 | 35 | static const size_t kDefaultCapacity = 256; 36 | mutable internal::Stack stack_; 37 | }; 38 | 39 | typedef GenericStringBuffer > StringBuffer; 40 | 41 | //! Implement specialized version of PutN() with memset() for better performance. 42 | template<> 43 | inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { 44 | memset(stream.stack_.Push(n), c, n * sizeof(c)); 45 | } 46 | 47 | } // namespace rapidjson 48 | 49 | #endif // RAPIDJSON_STRINGBUFFER_H_ 50 | -------------------------------------------------------------------------------- /cmake/DownloadProject/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | CMakeLists.txt.user 3 | -------------------------------------------------------------------------------- /cmake/DownloadProject/.travis.yml: -------------------------------------------------------------------------------- 1 | # Need these for a more recent CMake on Linux 2 | sudo: required 3 | dist: trusty 4 | 5 | os: 6 | - linux 7 | - osx 8 | 9 | language: cpp 10 | 11 | before_script: 12 | - mkdir build 13 | - cd build 14 | - cmake .. 15 | 16 | script: 17 | - cmake --build . 18 | 19 | after_script: 20 | - cmake --build . --target test 21 | 22 | -------------------------------------------------------------------------------- /cmake/DownloadProject/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.2) 2 | 3 | project(Example) 4 | 5 | include(CTest) 6 | 7 | if (CMAKE_VERSION VERSION_LESS 3.2) 8 | set(UPDATE_DISCONNECTED_IF_AVAILABLE "") 9 | else() 10 | set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1") 11 | endif() 12 | 13 | include(DownloadProject.cmake) 14 | download_project(PROJ googletest 15 | GIT_REPOSITORY https://github.com/google/googletest.git 16 | GIT_TAG master 17 | ${UPDATE_DISCONNECTED_IF_AVAILABLE} 18 | ) 19 | 20 | # Prevent GoogleTest from overriding our compiler/linker options 21 | # when building with Visual Studio 22 | set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) 23 | 24 | add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) 25 | 26 | # When using CMake 2.8.11 or later, header path dependencies 27 | # are automatically added to the gtest and gmock targets. 28 | # For earlier CMake versions, we have to explicitly add the 29 | # required directories to the header search path ourselves. 30 | if (CMAKE_VERSION VERSION_LESS 2.8.11) 31 | include_directories("${gtest_SOURCE_DIR}/include" 32 | "${gmock_SOURCE_DIR}/include") 33 | endif() 34 | 35 | # Trivial example using gtest and gmock 36 | add_executable(example example.cpp) 37 | target_link_libraries(example gtest gmock_main) 38 | add_test(NAME example_test COMMAND example) 39 | -------------------------------------------------------------------------------- /cmake/DownloadProject/DownloadProject.CMakeLists.cmake.in: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.2) 2 | 3 | project(${DL_ARGS_PROJ}-download NONE) 4 | 5 | include(ExternalProject) 6 | ExternalProject_Add(${DL_ARGS_PROJ}-download 7 | ${DL_ARGS_UNPARSED_ARGUMENTS} 8 | SOURCE_DIR "${DL_ARGS_SOURCE_DIR}" 9 | BINARY_DIR "${DL_ARGS_BINARY_DIR}" 10 | CONFIGURE_COMMAND "" 11 | BUILD_COMMAND "" 12 | INSTALL_COMMAND "" 13 | TEST_COMMAND "" 14 | ) 15 | -------------------------------------------------------------------------------- /cmake/DownloadProject/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Crascit 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 | -------------------------------------------------------------------------------- /cmake/DownloadProject/README.md: -------------------------------------------------------------------------------- 1 | # DownloadProject 2 | 3 | 4 | Platform | Build status 5 | ---------|-------------: 6 | Linux
Mac OSX | [![Build Status](https://travis-ci.org/Crascit/DownloadProject.svg?branch=master)](https://travis-ci.org/Crascit/DownloadProject) 7 | Windows (VS2015) | [![Build status](https://ci.appveyor.com/api/projects/status/1qdjq4fpef25tftw/branch/master?svg=true)](https://ci.appveyor.com/project/Crascit/downloadproject/branch/master) 8 | 9 | This repository contains a generalized implementation for downloading an 10 | external project's source at CMake's configure step rather than as part 11 | of the main build. The primary advantage of this is that the project's source 12 | code can then be included directly in the main CMake build using the 13 | add_subdirectory() command, making all of the external project's targets, 14 | etc. available without any further effort. The technique is fully explained 15 | in the article available at: 16 | 17 | http://crascit.com/2015/07/25/cmake-gtest/ 18 | 19 | An example as described in that article is provided here to demonstrate 20 | how to use the DownloadProject module. It uses [googletest][1] as the 21 | example, downloading and building trivial gtest and gmock test cases 22 | to show the technique. 23 | 24 | [1]: https://github.com/google/googletest 25 | -------------------------------------------------------------------------------- /cmake/DownloadProject/example.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "gmock/gmock.h" 3 | 4 | 5 | // Simple test, does not use gmock 6 | TEST(Dummy, foobar) 7 | { 8 | EXPECT_EQ(1, 1); 9 | } 10 | 11 | 12 | // Real class we want to mock 13 | class TeaBreak 14 | { 15 | public: 16 | ~TeaBreak() {} 17 | 18 | // Return minutes taken to make the drinks 19 | int morningTea() 20 | { 21 | return makeCoffee(true, 1) + 22 | makeCoffee(false, 0.5) + 23 | makeHerbalTea(); 24 | } 25 | 26 | private: 27 | virtual int makeCoffee(bool milk, double sugars) = 0; 28 | virtual int makeHerbalTea() = 0; 29 | }; 30 | 31 | // Mock class 32 | class MockTeaBreak : public TeaBreak 33 | { 34 | public: 35 | MOCK_METHOD2(makeCoffee, int(bool milk, double sugars)); 36 | MOCK_METHOD0(makeHerbalTea, int()); 37 | }; 38 | 39 | 40 | using ::testing::Return; 41 | using ::testing::_; 42 | 43 | // Mocked test 44 | TEST(TeaBreakTest, MorningTea) 45 | { 46 | MockTeaBreak teaBreak; 47 | EXPECT_CALL(teaBreak, makeCoffee(_,_)) 48 | .WillOnce(Return(2)) 49 | .WillOnce(Return(1)); 50 | EXPECT_CALL(teaBreak, makeHerbalTea()) 51 | .WillOnce(Return(3)); 52 | 53 | EXPECT_LE(teaBreak.morningTea(), 6); 54 | } 55 | -------------------------------------------------------------------------------- /cmake/Modules/FindNNPACK.cmake: -------------------------------------------------------------------------------- 1 | SET(NNPACK_INCLUDE_SEARCH_PATHS 2 | /usr/include 3 | /usr/local/include 4 | /opt/NNPACK/include 5 | ${NNPACK_ROOT} 6 | ${NNPACK_ROOT}/include 7 | ) 8 | 9 | SET(NNPACK_LIB_SEARCH_PATHS 10 | /lib/ 11 | /lib64/ 12 | /usr/lib 13 | /usr/lib64 14 | /usr/local/lib 15 | /usr/local/lib64 16 | /opt/NNPACK/lib 17 | ${NNPACK_ROOT} 18 | ${NNPACK_ROOT}/lib 19 | ) 20 | 21 | FIND_PATH(NNPACK_INCLUDE_DIR NAMES nnpack.h PATHS ${NNPACK_INCLUDE_SEARCH_PATHS}) 22 | FIND_LIBRARY(NNPACK_LIB NAMES nnpack PATHS ${NNPACK_LIB_SEARCH_PATHS}) 23 | 24 | SET(NNPACK_FOUND ON) 25 | 26 | # Check include files 27 | IF(NOT NNPACK_INCLUDE_DIR) 28 | SET(NNPACK_FOUND OFF) 29 | MESSAGE(STATUS "Could not find NNPACK include. Turning NNPACK_FOUND off") 30 | ENDIF() 31 | 32 | # Check libraries 33 | IF(NOT NNPACK_LIB) 34 | SET(NNPACK_FOUND OFF) 35 | MESSAGE(STATUS "Could not find NNPACK lib. Turning NNPACK_FOUND off") 36 | ENDIF() 37 | 38 | IF (NNPACK_FOUND) 39 | add_definitions(-DUSE_NNPACK) 40 | IF (NOT NNPACK_FIND_QUIETLY) 41 | MESSAGE(STATUS "Found NNPACK libraries: ${NNPACK_LIB}") 42 | MESSAGE(STATUS "Found NNPACK include: ${NNPACK_INCLUDE_DIR}") 43 | ENDIF (NOT NNPACK_FIND_QUIETLY) 44 | ELSE (NNPACK_FOUND) 45 | IF (NNPACK_FIND_REQUIRED) 46 | MESSAGE(FATAL_ERROR "Could not find NNPACK") 47 | ENDIF (NNPACK_FIND_REQUIRED) 48 | ENDIF (NNPACK_FOUND) 49 | 50 | MARK_AS_ADVANCED( 51 | NNPACK_INCLUDE_DIR 52 | NNPACK_LIB 53 | NNPACK 54 | ) 55 | -------------------------------------------------------------------------------- /cmake/Templates/cmake-uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 9 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if(NOT "${rm_retval}" STREQUAL 0) 16 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 17 | endif(NOT "${rm_retval}" STREQUAL 0) 18 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 19 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 20 | endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 21 | endforeach(file) 22 | -------------------------------------------------------------------------------- /cmake/Templates/tinydnn-config-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION "@TINYDNN_VERSION@") 2 | 3 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 4 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 5 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 6 | else() 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 9 | set(PACKAGE_VERSION_EXACT TRUE) 10 | endif() 11 | endif() 12 | -------------------------------------------------------------------------------- /cmake/Templates/tinydnn_config.h.in: -------------------------------------------------------------------------------- 1 | #ifndef TINYDNN_CONFIG_HPP_ 2 | #define TINYDNN_CONFIG_HPP_ 3 | 4 | /* Define if you want to use intel TBB library */ 5 | #cmakedefine CNN_USE_TBB 6 | 7 | /* define to enable OMP parallelization */ 8 | #cmakedefine CNN_USE_OMP 9 | 10 | /* Define to use NNPACK */ 11 | #cmakedefine CNN_USE_NNPACK 12 | 13 | /* Define to enable sse2 vectorization */ 14 | #cmakedefine CNN_USE_SSE 15 | 16 | /* Define to enable avx vectorization */ 17 | #cmakedefine CNN_USE_AVX 18 | 19 | #endif // TINYDNN_CONFIG_HPP_ 20 | -------------------------------------------------------------------------------- /cmake/clang-cxx-dev-tools.cmake: -------------------------------------------------------------------------------- 1 | # Additional target to perform clang-format/clang-tidy run 2 | # Requires clang-format and clang-tidy 3 | 4 | file(GLOB_RECURSE ALL_CXX_SOURCE_FILES 5 | ${CMAKE_SOURCE_DIR}/tiny_dnn/*.h 6 | ${CMAKE_SOURCE_DIR}/benchmarks/*.h 7 | ${CMAKE_SOURCE_DIR}/test/*.h 8 | ${CMAKE_SOURCE_DIR}/examples/*.h 9 | ${CMAKE_SOURCE_DIR}/examples/*.cpp 10 | ) 11 | 12 | set(clang-format "clang-format-4.0") 13 | 14 | # Adding clang-format target if executable is found 15 | find_program(CLANG_FORMAT ${clang-format}) 16 | if(CLANG_FORMAT) 17 | add_custom_target( 18 | clang-format 19 | COMMAND /usr/bin/${clang-format} 20 | -i 21 | ${ALL_CXX_SOURCE_FILES} 22 | ) 23 | 24 | add_custom_target( 25 | clang-format-check 26 | COMMAND /bin/bash ${CMAKE_SOURCE_DIR}/.travis/clang-format.sh 27 | ) 28 | else() 29 | message(STATUS "${clang-format} was not found") 30 | endif() 31 | 32 | # Adding clang-tidy target if executable is found 33 | find_program(CLANG_TIDY "clang-tidy") 34 | if(CLANG_TIDY) 35 | add_custom_target( 36 | clang-tidy 37 | COMMAND /usr/bin/clang-tidy 38 | ${ALL_CXX_SOURCE_FILES} 39 | -config='' 40 | -checks=* 41 | -- 42 | -std=c++11 43 | ${INCLUDE_DIRECTORIES} 44 | ) 45 | endif() 46 | 47 | add_custom_target( 48 | test_lints 49 | COMMAND /bin/bash ${CMAKE_SOURCE_DIR}/scripts/run_lints.sh 50 | ${ALL_CXX_SOURCE_FILES} 51 | ) 52 | -------------------------------------------------------------------------------- /data/t10k-images.idx3-ubyte: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/data/t10k-images.idx3-ubyte -------------------------------------------------------------------------------- /data/train-images.idx3-ubyte: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/data/train-images.idx3-ubyte -------------------------------------------------------------------------------- /data/train-labels.idx1-ubyte: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/data/train-labels.idx1-ubyte -------------------------------------------------------------------------------- /dev-env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | script_link="${BASH_SOURCE[0]}" 4 | while [ -h "$script_link" ]; do # resolve $script_link until the file is no longer a symlink 5 | lib_dir="$( cd -P "$( dirname "$script_link" )" && pwd )" 6 | script_link="$(readlink "$script_link")" 7 | [[ $script_link != /* ]] && script_link="$lib_dir/$script_link" # if $script_link was a relative symlink, we need to resolve it relative to the path where the symlink file was located 8 | done 9 | lib_dir="$( cd -P "$( dirname "$script_link" )" && pwd )" 10 | 11 | docker run --rm -it -v $lib_dir:/opt/tiny-dnn tinydnn/tinydnn 12 | -------------------------------------------------------------------------------- /docker/dev-env/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:17.04 2 | 3 | MAINTAINER Edgar Riba 4 | 5 | # install basic stuff 6 | 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ 8 | build-essential \ 9 | cmake \ 10 | python-pip \ 11 | python-setuptools \ 12 | git \ 13 | vim 14 | 15 | RUN pip install --upgrade pip 16 | 17 | # install optional dependencies 18 | 19 | RUN apt-get install -y \ 20 | libpthread-stubs0-dev \ 21 | libtbb-dev 22 | 23 | # install linters 24 | 25 | RUN apt-get install -y \ 26 | clang-format-4.0 27 | 28 | RUN pip install cpplint 29 | -------------------------------------------------------------------------------- /docker/dev-env/Dockerfile.full: -------------------------------------------------------------------------------- 1 | FROM ubuntu:17.04 2 | 3 | MAINTAINER Edgar Riba 4 | 5 | # install basic stuff 6 | 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ 8 | build-essential \ 9 | cmake \ 10 | python-pip \ 11 | python-setuptools \ 12 | git \ 13 | vim 14 | 15 | RUN pip install --upgrade pip 16 | 17 | # install optional dependencies 18 | 19 | RUN apt-get install -y \ 20 | libpthread-stubs0-dev \ 21 | libtbb-dev 22 | 23 | # install linters 24 | 25 | RUN apt-get install -y \ 26 | clang-format-4.0 27 | 28 | RUN pip install cpplint 29 | 30 | # configure and build NNPACK 31 | 32 | RUN apt-get install ninja-build 33 | 34 | RUN pip install --upgrade setuptools && \ 35 | pip install wheel && \ 36 | pip install ninja-syntax 37 | 38 | RUN pip install --upgrade git+https://github.com/tiny-dnn/PeachPy 39 | RUN pip install --upgrade git+https://github.com/tiny-dnn/confu 40 | 41 | WORKDIR /opt 42 | RUN git clone https://github.com/tiny-dnn/NNPACK.git && \ 43 | cd NNPACK && \ 44 | confu setup && \ 45 | python ./configure.py && \ 46 | ninja 47 | 48 | # install opencl and viennacl 49 | 50 | RUN apt-get install -y \ 51 | ocl-icd-opencl-dev \ 52 | libviennacl-dev 53 | 54 | # build and configure libdnn 55 | 56 | WORKDIR /opt 57 | RUN git clone https://github.com/naibaf7/libdnn.git && \ 58 | cd libdnn && mkdir build && cd build && \ 59 | cmake .. && make -j2 60 | -------------------------------------------------------------------------------- /docker/dev-env/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tag_prefix="tinydnn/tinydnn" 3 | 4 | docker_images=('dev-ubuntu17.04' 'dev-full-ubuntu17.04') 5 | 6 | if [ $# -eq 0 ] ; then 7 | docker_tag=$tag_prefix/${docker_images[0]} 8 | docker_file="Dockerfile" 9 | echo "** No arguments supplied, building default image. **" 10 | else 11 | match=0 12 | for img in "${docker_images[@]}"; do 13 | if [[ $img = "$1" ]]; then 14 | match=1 15 | break 16 | fi 17 | done 18 | if [[ $match = 0 ]]; then 19 | echo "** Not supported image $1, options are: ${docker_images[@]} **" 20 | echo "** Aborting building docker image." 21 | exit 1 22 | fi 23 | docker_tag=$tag_prefix/$1 24 | if [ $1 == ${docker_images[0]} ] ; then 25 | docker_file="Dockerfile" 26 | elif [ $1 == ${docker_images[1]} ] ; then 27 | docker_file="Dockerfile.full" 28 | else 29 | echo "** Something went really wrong !**" 30 | fi 31 | fi 32 | 33 | echo "** running command: docker build -t ${docker_tag} -f ${docker_file}" 34 | 35 | docker build -t ${docker_tag} -f ${docker_file} . 36 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========= Doxygen docs ========= 2 | 3 | find_package(Doxygen QUIET) 4 | if(NOT DOXYGEN_FOUND) 5 | message(FATAL_ERROR "Doxygen is needed to build the documentation.") 6 | endif() 7 | 8 | set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) 9 | set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) 10 | 11 | configure_file(${doxyfile_in} ${doxyfile} @ONLY) 12 | 13 | add_custom_target(docs 14 | COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} 15 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 16 | COMMENT "Generating API documentation with Doxygen" 17 | VERBATIM) 18 | 19 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/${PROJECT_NAME}/doc) 20 | 21 | -------------------------------------------------------------------------------- /docs/Doxyfile.in: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = @PROJECT_NAME@ 2 | PROJECT_NUMBER = @PROJECT_VERSION@ 3 | PROJECT_BRIEF = "A header only, dependency-free deep learning framework in C++11" 4 | STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ \ 5 | @PROJECT_BINARY_DIR@ 6 | OUTPUT_LANGUAGE = English 7 | INPUT = @CMAKE_SOURCE_DIR@/tiny_dnn \ 8 | @CMAKE_SOURCE_DIR@/examples \ 9 | @CMAKE_SOURCE_DIR@/docs 10 | FILE_PATTERNS = *.h *.md 11 | RECURSIVE = YES 12 | IMAGE_PATH = @CMAKE_SOURCE_DIR@/docs 13 | USE_MDFILE_AS_MAINPAGE = @CMAKE_SOURCE_DIR@/docs/readme.md 14 | JAVADOC_AUTOBRIEF = YES 15 | GENERATE_HTML = YES 16 | GENERATE_LATEX = NO 17 | OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/docs 18 | EXCLUDE_PATTERNS = */caffe.pb.h 19 | -------------------------------------------------------------------------------- /docs/developer_guides/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | Adding-a-new-layer 3 | How-to-contribute 4 | -------------------------------------------------------------------------------- /docs/device-abstraction-uml.puml: -------------------------------------------------------------------------------- 1 | @startuml 2 | class Session { 3 | -String name 4 | void schedule_session() 5 | void run_session() 6 | } 7 | 8 | abstract class Device { 9 | -int id 10 | } 11 | 12 | class Node { 13 | } 14 | 15 | class Edge { 16 | - shape3d shape 17 | } 18 | 19 | abstract class Layer { 20 | - String layer_type 21 | virtual void forward_propagation() 22 | virtual void backward_propagation() 23 | } 24 | 25 | class ConvolutionalLayer { 26 | } 27 | 28 | class MaxPoolingLayer { 29 | } 30 | 31 | abstract class Backend { 32 | virtual void matmul() 33 | virtual pool2d() 34 | virtual conv2d() 35 | virtual conv2d_back() 36 | } 37 | 38 | class TinyCNNBackend { 39 | } 40 | 41 | class NNPackBackend { 42 | } 43 | 44 | class LibDNNBackend { 45 | } 46 | 47 | Session *-- Device 48 | 49 | Device <|-- CPUDevice 50 | Device <|-- OCLDevice 51 | 52 | Node <|-- Layer 53 | Node *-- Edge : prev 54 | Node *-- Edge : next 55 | 56 | Edge --> Node : prev 57 | Edge *-- Node : next 58 | Edge *-- Data : data 59 | Edge *-- Data : grad 60 | 61 | Layer <|-- ConvolutionalLayer 62 | Layer <|-- MaxPoolingLayer 63 | 64 | Device *-- Backend : own_list 65 | ConvolutionalLayer *-- Backend : backend 66 | MaxPoolingLayer *-- Backend : backend 67 | 68 | Backend <|-- TinyCNNBackend 69 | Backend <|-- NNPackBackend 70 | Backend <|-- LibDNNBackend 71 | 72 | @enduml 73 | -------------------------------------------------------------------------------- /docs/getting_started/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | Getting-started 3 | -------------------------------------------------------------------------------- /docs/how_tos/Integrate-with-your-application.md: -------------------------------------------------------------------------------- 1 | # Integrate with your application 2 | Because tiny-dnn is header-only, integrating it with your application is extremely easy. We explain how to do it step-by-step. 3 | 4 | ## Step1/3: Include tiny_dnn.h in your application 5 | Just add the following line: 6 | ```cpp 7 | #include "tiny_dnn/tiny_dnn.h" 8 | ``` 9 | 10 | ## Step2/3: Enable C++11 options 11 | tiny-dnn uses C++11's core features and libraries. You must use the c++11 compliant compiler and compile with c++11-mode. 12 | 13 | ### Visual Studio(2013-) 14 | C++11 features are enabled by default, you have nothing to do about it. 15 | 16 | ### gcc(4.8-)/clang(3.3-) 17 | Use ```-std=c++11``` option to enable c++11-mode. 18 | 19 | > From gcc 6.0, the default compile mode for c++ is -std=gnu++14, so you don't need to add this option. 20 | 21 | 22 | ## Step3/3: Add include path of tiny-dnn to your build system 23 | Tell your build system where tiny-dnn exists. In gcc: 24 | 25 | ``` 26 | g++ -std=c++11 -Iyour-downloaded-path -O3 your-app.cpp -o your-app 27 | ``` 28 | 29 | > Another solution: place tiny-dnn's header files under your project root 30 | -------------------------------------------------------------------------------- /docs/how_tos/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | How-Tos 3 | Integrate-with-your-application 4 | Train-network-with-your-dataset 5 | -------------------------------------------------------------------------------- /docs/layers/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | Layers 3 | -------------------------------------------------------------------------------- /docs/logo/TinyDNN-logo-B-W.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/docs/logo/TinyDNN-logo-B-W.png -------------------------------------------------------------------------------- /docs/logo/TinyDNN-logo-letters-B-W.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/docs/logo/TinyDNN-logo-letters-B-W.png -------------------------------------------------------------------------------- /docs/logo/TinyDNN-logo-letters-alpha-version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/docs/logo/TinyDNN-logo-letters-alpha-version.png -------------------------------------------------------------------------------- /docs/logo/TinyDNN-logo-letters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/docs/logo/TinyDNN-logo-letters.png -------------------------------------------------------------------------------- /docs/logo/TinyDNN-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/docs/logo/TinyDNN-logo.png -------------------------------------------------------------------------------- /docs/logo/raw/GidoleFont/Gidole-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/docs/logo/raw/GidoleFont/Gidole-Regular.ttf -------------------------------------------------------------------------------- /docs/logo/raw/GidoleFont/Gidolinya-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/docs/logo/raw/GidoleFont/Gidolinya-Regular.otf -------------------------------------------------------------------------------- /docs/logo/raw/GidoleFont/Readme-Characters.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/docs/logo/raw/GidoleFont/Readme-Characters.pdf -------------------------------------------------------------------------------- /docs/readme.md: -------------------------------------------------------------------------------- 1 | # tiny-dnn documentation 2 | 3 | A built version of documentation is available [here](http://tiny-dnn.readthedocs.io/en/latest/index.html). 4 | 5 | ## Local build 6 | 7 | You can build html documents in your local machine if you prefer. 8 | Assuming you have python already, install Sphinx and recommonmark at first: 9 | 10 | ```bash 11 | $ pip install sphinx sphinx-autobuild 12 | $ pip install recommonmark 13 | ``` 14 | 15 | #### Build on Windows 16 | ```bach 17 | cd docs 18 | make.bat html 19 | ``` 20 | 21 | #### Build on Linux 22 | ```bash 23 | cd docs 24 | make html 25 | ``` -------------------------------------------------------------------------------- /docs/resource/graph.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/docs/resource/graph.gif -------------------------------------------------------------------------------- /docs/update_log/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | v0_0_1-to-v0_1_0 3 | -------------------------------------------------------------------------------- /examples/backends/cblas/test_mlp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #include 9 | #include 10 | 11 | #include "tiny_dnn/tiny_dnn.h" 12 | 13 | const int SIZE = 100; 14 | 15 | template 16 | void construct_net(N &nn, tiny_dnn::core::backend_t backend_type) { 17 | using relu = tiny_dnn::relu_layer; 18 | using fc = tiny_dnn::fully_connected_layer; 19 | using softmax = tiny_dnn::softmax_layer; 20 | 21 | nn << fc(SIZE, SIZE, false, backend_type) << relu() 22 | << fc(SIZE, SIZE, false, backend_type) << softmax(); 23 | } 24 | 25 | int main(int argc, char **argv) { 26 | try { 27 | tiny_dnn::network nn_internal; 28 | construct_net(nn_internal, tiny_dnn::core::backend_t::internal); 29 | 30 | tiny_dnn::network nn_cblas; 31 | construct_net(nn_cblas, tiny_dnn::core::backend_t::cblas); 32 | 33 | tiny_dnn::vec_t input; 34 | for (size_t i = 0; i < SIZE; i++) { 35 | input.push_back(rand_r() / RAND_MAX); 36 | } 37 | auto output_internal = nn_internal.fprop(input); 38 | auto output_cblas = nn_cblas.fprop(input); 39 | 40 | for (size_t i = 0; i < SIZE; i++) { 41 | std::cout << output_internal[i] << "|" << output_cblas[i] << "\t"; 42 | } 43 | std::cout << std::endl; 44 | } catch (tiny_dnn::nn_error &err) { 45 | std::cerr << "Exception: " << err.what() << std::endl; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/benchmarks/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | 9 | #include 10 | 11 | #include "tiny_dnn/tiny_dnn.h" 12 | 13 | int main() { 14 | tiny_dnn::models::alexnet nn; 15 | 16 | // change all layers at once 17 | nn.weight_init(tiny_dnn::weight_init::constant(2.0)); 18 | nn.bias_init(tiny_dnn::weight_init::constant(2.0)); 19 | nn.init_weight(); 20 | 21 | tiny_dnn::vec_t in(224 * 224 * 3); 22 | 23 | // generate random variables 24 | tiny_dnn::uniform_rand(in.begin(), in.end(), 0, 1); 25 | 26 | tiny_dnn::timer t; // start the timer 27 | 28 | // predict 29 | auto res = nn.predict(in); 30 | 31 | double elapsed_s = t.elapsed(); 32 | t.stop(); 33 | 34 | std::cout << "Elapsed time(s): " << elapsed_s << std::endl; 35 | } 36 | -------------------------------------------------------------------------------- /examples/build.bat: -------------------------------------------------------------------------------- 1 | g++ -std=c++11 -Wall -Werror -Wextra -pedantic -I ../ -O3 main.cpp -o main 2 | -------------------------------------------------------------------------------- /examples/caffe_converter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required( VERSION 3.2 ) 2 | 3 | project( caffe_converter ) 4 | 5 | find_package( Protobuf REQUIRED ) 6 | 7 | # generate CPP file for connexion between protobuf and tiny_dnn 8 | PROTOBUF_GENERATE_CPP( PROTO_SRC PROTO_HDR ${CMAKE_CURRENT_SOURCE_DIR}/../../tiny_dnn/io/caffe/caffe.proto ) 9 | 10 | # set the executable (main cpp + protobuf generated caffe.pb.h/caffe.pb.cc ) 11 | add_executable( caffe_converter caffe_converter.cpp ${PROTO_SRC} ${PROTO_HDR} ) 12 | 13 | # Set the include dir (binary for caffe.pb.h, protobuf and location of tiny-dnn source) 14 | target_include_directories( caffe_converter PRIVATE ${CMAKE_CURRENT_BINARY_DIR} 15 | ${PROTOBUF_INCLUDE_DIR} 16 | ${CMAKE_CURRENT_SOURCE_DIR}/../../ ) 17 | 18 | # Link with protobuf 19 | target_link_libraries( caffe_converter ${PROTOBUF_LIBRARY} ) 20 | 21 | # Set C++11 mode 22 | set_target_properties( caffe_converter PROPERTIES CXX_STANDARD 11 ) 23 | 24 | cotire(caffe_converter) 25 | -------------------------------------------------------------------------------- /examples/caffe_converter/readme.md: -------------------------------------------------------------------------------- 1 | # Import Caffe Model to tiny-dnn 2 | tiny-dnn can import Caffe's trained models. 3 | 4 | ## Prerequisites for this example 5 | - Google protobuf 6 | - OpenCV 7 | 8 | ## Build 9 | 10 | 1 Use ```protoc``` to generte caffe.pb.cc and caffe.pb.h. 11 | ```bash 12 | cd tiny_dnn/io/caffe 13 | protoc caffe.proto --cpp_out=./ 14 | ``` 15 | 16 | 2 Compile ```tiny_dnn/io/caffe/caffe.pb.cc``` and ```examples/caffe_converter/caffe_converter.cpp``` and link them. 17 | 18 | ## Usage 19 | ```bash 20 | ./caffe_converter.bin [model-file] [trained-file] [mean-file] [label-file] [img-file] 21 | ``` 22 | 23 | In the [pre-trained CaffeNet](https://github.com/BVLC/caffe/tree/master/examples/cpp_classification) model, 24 | ``` 25 | ./caffe_converter.bin\ 26 | deploy.prototxt\ 27 | bvlc_reference_caffenet.caffemodel\ 28 | imagenet_mean.binaryproto\ 29 | synset_words.txt\ 30 | cat.jpg 31 | ``` 32 | 33 | ## Restrictions 34 | - tiny-dnn's converter only supports single input/single output network without branch. -------------------------------------------------------------------------------- /examples/char_rnn/data/encoding.raw: -------------------------------------------------------------------------------- 1 | 2 | !"#$%&'()*+,-./0123456789:;<=>?@[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ -------------------------------------------------------------------------------- /examples/char_rnn/python/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/examples/char_rnn/python/__init__.py -------------------------------------------------------------------------------- /examples/char_rnn/python/setup.sh: -------------------------------------------------------------------------------- 1 | cd tiny_dnn 2 | swig -c++ -python tiny_char_rnn.i 3 | python3 setup.py build_ext --inplace 4 | -------------------------------------------------------------------------------- /examples/char_rnn/python/tiny_dnn/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/examples/char_rnn/python/tiny_dnn/__init__.py -------------------------------------------------------------------------------- /examples/char_rnn/python/tiny_dnn/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | setup.py file for SWIG example 5 | """ 6 | import os 7 | from distutils.core import setup, Extension 8 | 9 | tiny_char_rnn = Extension('_tiny_char_rnn', 10 | include_dirs=[os.path.abspath('../../../../')], 11 | extra_compile_args=['-std=c++14', '-O3', '-DNDEBUG', '-O3', '-msse3', '-mavx', '-Wall', 12 | '-Wpedantic', '-Wno-narrowing', '-Wno-deprecated', '-msse3', '-mavx', 13 | '-Wall', '-Wpedantic', '-Wno-narrowing', '-Wno-deprecated'], 14 | sources=['tiny_char_rnn_wrap.cxx'], 15 | ) 16 | 17 | setup(name='tiny_char_rnn', 18 | version='0.1', 19 | author="prlz77", 20 | description="""Simple swig example from docs""", 21 | ext_modules=[tiny_char_rnn], 22 | py_modules=["tiny_char_rnn"], 23 | ) 24 | -------------------------------------------------------------------------------- /examples/char_rnn/python/tiny_dnn/tiny_char_rnn.i: -------------------------------------------------------------------------------- 1 | %module(package="tiny_dnn") tiny_char_rnn 2 | 3 | %{ 4 | #define SWIG_FILE_WITH_INIT 5 | #include "tiny_char_rnn.h" 6 | %} 7 | 8 | %include "tiny_char_rnn.h" 9 | -------------------------------------------------------------------------------- /examples/char_rnn/python/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/examples/char_rnn/python/utils/__init__.py -------------------------------------------------------------------------------- /examples/char_rnn/python/utils/dataset.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def split(messages, chunks=5, train_ratio=0.9): 5 | length = chunks * (len(messages) // chunks) 6 | indices = np.arange(length).reshape(-1, chunks) 7 | chunk_indices = np.arange(indices.shape[0]) 8 | np.random.shuffle(chunk_indices) 9 | n_train = int(np.ceil(chunk_indices.shape[0] * train_ratio)) 10 | train_indices = np.sort(indices[chunk_indices[:n_train], :].ravel()) 11 | val_indices = np.sort(indices[chunk_indices[n_train:], :].ravel()) 12 | 13 | train = [] 14 | val = [] 15 | 16 | for idx in train_indices: 17 | train.append(messages[idx]) 18 | for idx in val_indices: 19 | val.append(messages[idx]) 20 | 21 | return train, val 22 | 23 | 24 | def msg2txt(messages): 25 | ret = "" 26 | for m in messages: 27 | user = m['fromUser']['username'] 28 | text = m['text'] 29 | ret += user + '\t' + text 30 | return ret 31 | 32 | 33 | def random_batch_interleaving(messages, batch_size, seq_len, max_size=0): 34 | text = msg2txt(messages) 35 | if max_size == 0: 36 | max_size = len(text)**2 37 | input = "" 38 | output = "" 39 | while len(input) < max_size: 40 | print('%.02f' %(100 * float(len(input)) / max_size), '%') 41 | batches = np.random.randint(0, len(text) - seq_len - 1, batch_size) 42 | for s in range(seq_len): 43 | for i in batches: 44 | input += text[i] 45 | output += text[i + 1] 46 | batches += 1 47 | 48 | return input, output 49 | 50 | -------------------------------------------------------------------------------- /examples/char_rnn/python/utils/gitter.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from gitterpy.client import GitterClient, BaseApi 4 | 5 | 6 | def get_all_messages(gitter_token="", 7 | chat="tiny-dnn/developers", out_path='messages.json'): 8 | gitter = GitterClient(gitter_token) 9 | 10 | messages = [] 11 | ret = gitter.messages.list(chat) 12 | messages += ret 13 | while len(ret) != 0: 14 | before_id = messages[0]['id'] 15 | BaseApi.footers = "?limit=100&beforeId=%s" % str(before_id) 16 | try: 17 | ret = gitter.messages.list(chat) 18 | except: 19 | break 20 | messages = ret + messages 21 | if len(ret) > 0: 22 | print(ret[0]) 23 | 24 | with open(out_path, 'w') as output: 25 | json.dump(messages, output) 26 | -------------------------------------------------------------------------------- /examples/ssd_detection/README.md: -------------------------------------------------------------------------------- 1 | # Single Shot MultiBox Detector (SSD) 2 | 3 | A TinyDNN implementation of [Single Shot MultiBox Detector](http://arxiv.org/abs/1512.02325) from the 2016 paper by Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang, and Alexander C. Berg. The official and original Caffe code can be found [here](https://github.com/weiliu89/caffe/tree/ssd). 4 | 5 | ## Prerequisites for this example 6 | 7 | - Download PyTorch pretrained models from [here](https://s3.amazonaws.com/amdegroot-models/ssd300_mAP_77.43_v2.pth) 8 | - Convert PyTorch models to TinyDNN with following commands 9 | 10 | ``` 11 | mkdir models 12 | python convert_models.py /path/to/model models 13 | ``` 14 | 15 | ## Use SSD in Object Detection 16 | 17 | ``` 18 | ./example_ssd_test /folder/to/models/ /path/to/image 19 | ``` 20 | 21 | You will get output similar to following: 22 | 23 | ``` 24 | Bounding box coordinates: 25 | x_min = 19.6578, x_max = 66.2639, y_min = 240.801, y_max = 270.333, class = 1, score = 0.989524 26 | x_min = -3.73388, x_max = 302.883, y_min = 43.5821, y_max = 202.043, class = 1, score = 0.900133 27 | x_min = 17.771, x_max = 54.9812, y_min = 237.505, y_max = 259.987, class = 1, score = 0.660543 28 | ``` 29 | 30 | If you see the following message: 31 | 32 | ``` 33 | Failed to load weights from models/01.weights 34 | Failed to load weights from models/02.weights 35 | ... 36 | Failed to load weights from models/18.weights 37 | ``` 38 | 39 | Please make sure the path of weight files. 40 | 41 | ## Detection Results 42 | 43 | Here's an example of object detection results produced by SSD. 44 | 45 | ![Airplane](https://user-images.githubusercontent.com/1730504/47263759-67bc1900-d53a-11e8-91cd-4bb4648668b7.png) 46 | 47 | ![Sofa](https://user-images.githubusercontent.com/1730504/47264055-d9976100-d540-11e8-98a5-0af7871374fd.png) 48 | -------------------------------------------------------------------------------- /scripts/clang-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # set color test 4 | COLOR_OFF="\033[0m" 5 | RED="\033[0;31m" 6 | GREEN="\033[0;32m" 7 | 8 | # based on https://github.com/lemire/SIMDCompressionAndIntersection/blob/master/tools/clang-format.sh 9 | STYLE=$(which clang-format-4.0) 10 | if [ $? -ne 0 ]; then 11 | echo "$RED clang-format not installed. Unable to check source file format policy.$COLOR_OFF" >&2 12 | exit 1 13 | fi 14 | 15 | RE=0 16 | BASE=$(git rev-parse --show-toplevel) 17 | 18 | ALLFILES=$(git ls-tree --full-tree --name-only -r HEAD tiny_dnn test examples| grep -e ".*\.\(c\|h\|cc\|cpp\|hh\)\$") 19 | for FILE in $ALLFILES; do 20 | "$STYLE" "$BASE/$FILE" | cmp -s "$BASE/$FILE" - 21 | if [ $? -ne 0 ]; then 22 | echo -e "$RED$FILE does not respect the coding style.$COLOR_OFF" >&2 23 | RE=1 24 | fi 25 | done 26 | 27 | if [ $RE -eq 0 ]; then 28 | echo -e "$GREEN All files match with clang-format.$COLOR_OFF" >&2 29 | else 30 | echo -e "$RED Failed matching files with clang-format.$COLOR_OFF" >&2 31 | fi 32 | 33 | exit $RE 34 | -------------------------------------------------------------------------------- /scripts/cpplint_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python third_party/cpplint.py \ 4 | --filter=-runtime/references \ 5 | tiny_dnn/*/*/*.h examples/*/*.cpp examples/*/*/*.cpp test/*.h 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /scripts/run_lints.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$1" ]; then 4 | echo "Error, no files provided." 5 | fi 6 | 7 | all_cpp_files=$@ 8 | 9 | clang_format_bin=$(which clang-format-4.0) 10 | if [ $? -ne 0 ]; then 11 | echo "clang-format-4.0 not installed. Please, install it and try again." 12 | exit 1 13 | fi 14 | 15 | cpplint_bin=$(which cpplint) 16 | if [ $? -ne 0 ]; then 17 | echo "cpplint not installed. Please, install it and try again." 18 | exit 1 19 | fi 20 | 21 | for cpp_file in $all_cpp_files; do 22 | 23 | $clang_format_bin -style=file -output-replacements-xml $cpp_file | grep " /dev/null 24 | if [ $? -ne 1 ]; then 25 | echo "Error, clang-format not clean: $cpp_file" 26 | exit 1 27 | fi 28 | 29 | # enforce google style guide. cpplint.py is chatty so pipe non-errors to /dev/null. 30 | python $cpplint_bin --filter=-runtime/references $cpp_file > /dev/null 31 | if [ $? -ne 0 ]; then 32 | echo "Error, cpplint.py failed google style: $cpp_file" 33 | exit 1 34 | fi 35 | 36 | done 37 | -------------------------------------------------------------------------------- /scripts/update-authors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | 4 | SCRIPT_DIRECTORY=`dirname $0` 5 | 6 | git log --reverse --format='%aN <%aE>' | perl -we ' 7 | 8 | BEGIN { 9 | %seen = (), @authors = (); 10 | } 11 | 12 | while (<>) { 13 | next if $seen{$_}; 14 | next if /\@chromium.org/; 15 | next if //; 16 | $seen{$_} = push @authors, $_; 17 | } 18 | 19 | END { 20 | print "# Authors ordered by first contribution.\n"; 21 | print "\n", @authors, "\n"; 22 | print "# Generated by scripts/update-authors.sh\n"; 23 | } 24 | 25 | ' > "$SCRIPT_DIRECTORY/../AUTHORS" 26 | -------------------------------------------------------------------------------- /src/loop_lib.sv: -------------------------------------------------------------------------------- 1 | module loop1 2 | #( 3 | parameter W = 32 4 | ) 5 | ( 6 | input wire [W-1:0] ini, 7 | input wire [W-1:0] fin, 8 | output reg [W-1:0] data, 9 | input wire clk, 10 | input wire rst, 11 | input wire start, 12 | input wire en, 13 | output wire next, 14 | output wire last 15 | ); 16 | 17 | reg next0; 18 | reg run; 19 | assign next = start | next0; 20 | assign last = (data==fin)&(run|start)&en; 21 | 22 | always @(posedge clk)begin 23 | next0 <= (run|start)&en&!last; 24 | if(rst)begin 25 | run <= 1'b0; 26 | data <= ini; 27 | end else if(start|run)begin 28 | if(last)begin 29 | if(en)begin 30 | data <= ini; 31 | run <= 1'b0; 32 | end 33 | end else begin 34 | run <= 1'b1; 35 | if(en)begin 36 | data <= data+1; 37 | end 38 | end 39 | end 40 | end 41 | 42 | endmodule 43 | 44 | module dff 45 | #( 46 | parameter W = 32 47 | ) 48 | ( 49 | input wire [W-1:0] in, 50 | output reg [W-1:0] data, 51 | input wire clk, 52 | input wire rst, 53 | input wire en 54 | ); 55 | 56 | always @(posedge clk)begin 57 | if(rst)begin 58 | data <= 'h0; 59 | end else if(en)begin 60 | data <= in; 61 | end 62 | end 63 | endmodule 64 | -------------------------------------------------------------------------------- /src/tiny_dnn_sc_ctl.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | SC_MODULE(tiny_dnn_sc_ctl) 4 | { 5 | //Ports 6 | sc_in clk; 7 | sc_in backprop; 8 | sc_in run; 9 | sc_in wwrite; 10 | sc_in bwrite; 11 | sc_in s_init; 12 | sc_in out_busy; 13 | sc_in outrf; 14 | sc_out s_fin; 15 | sc_out k_init; 16 | sc_out k_fin; 17 | sc_out exec; 18 | sc_out > ia; 19 | sc_out > wa; 20 | 21 | sc_in > dd; 22 | sc_in > id; 23 | sc_in > is; 24 | sc_in > ih; 25 | sc_in > iw; 26 | sc_in > od; 27 | sc_in > os; 28 | sc_in > oh; 29 | sc_in > ow; 30 | sc_in > fs; 31 | sc_in > ks; 32 | sc_in > kh; 33 | sc_in > kw; 34 | 35 | //Thread Declaration 36 | void exect(); 37 | 38 | //Constructor 39 | SC_CTOR(tiny_dnn_sc_ctl) 40 | { 41 | SC_CTHREAD(exect,clk.pos()); 42 | 43 | } 44 | }; 45 | -------------------------------------------------------------------------------- /src_c/soft/tiny_dnn/activations/relu_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "tiny_dnn/activations/activation_layer.h" 15 | #include "tiny_dnn/layers/layer.h" 16 | 17 | #include // for high_resolution_clock, NOLINT 18 | 19 | int af=0; 20 | int ab=0; 21 | 22 | namespace tiny_dnn { 23 | 24 | class relu_layer : public activation_layer { 25 | public: 26 | using activation_layer::activation_layer; 27 | 28 | std::string layer_type() const override { return "relu-activation"; } 29 | 30 | void forward_activation(const vec_t &x, vec_t &y) override { 31 | ast = std::chrono::high_resolution_clock::now(); 32 | for (size_t j = 0; j < x.size(); j++) { 33 | y[j] = std::max(float_t(0), x[j]); 34 | } 35 | aft += std::chrono::high_resolution_clock::now() - ast; 36 | } 37 | 38 | void backward_activation(const vec_t &x, 39 | const vec_t &y, 40 | vec_t &dx, 41 | const vec_t &dy) override { 42 | ast = std::chrono::high_resolution_clock::now(); 43 | for (size_t j = 0; j < x.size(); j++) { 44 | // dx = dy * (gradient of relu) 45 | dx[j] = dy[j] * (y[j] > float_t(0) ? float_t(1) : float_t(0)); 46 | } 47 | abt += std::chrono::high_resolution_clock::now() - ast; 48 | } 49 | 50 | std::pair scale() const override { 51 | return std::make_pair(float_t(0.1), float_t(0.9)); 52 | } 53 | 54 | friend struct serialization_buddy; 55 | }; 56 | 57 | } // namespace tiny_dnn 58 | -------------------------------------------------------------------------------- /src_c/softfp/tiny_dnn/core/kernels/maxpool_op_avx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "tiny_dnn/core/kernels/maxpool_op_internal.h" 13 | 14 | namespace tiny_dnn { 15 | namespace kernels { 16 | 17 | inline void maxpool_op_avx(const tensor_t &in_data, 18 | tensor_t &out_data, 19 | core::maxpool_params ¶ms, 20 | const bool layer_parallelize) { 21 | maxpool_op_internal(in_data, out_data, params, layer_parallelize); 22 | } 23 | 24 | inline void maxpool_grad_op_avx(tensor_t &prev_delta, 25 | const tensor_t &curr_delta, 26 | std::vector> &max_idx, 27 | const std::vector &in2out, 28 | const bool layer_parallelize) { 29 | maxpool_grad_op_internal(prev_delta, curr_delta, max_idx, in2out, 30 | layer_parallelize); 31 | } 32 | 33 | } // namespace kernels 34 | } // namespace tiny_dnn 35 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(CTest) 2 | enable_testing() 3 | 4 | add_executable(print_device print_device.cpp) 5 | target_link_libraries(print_device 6 | ${project_library_target_name} ${REQUIRED_LIBRARIES}) 7 | 8 | add_executable(tiny_dnn_test test.cpp test_main.cpp) 9 | 10 | set_target_properties(tiny_dnn_test PROPERTIES LINKER_LANGUAGE CXX) 11 | 12 | target_link_libraries(tiny_dnn_test 13 | ${project_library_target_name} ${REQUIRED_LIBRARIES}) 14 | 15 | 16 | add_test(all_tests tiny_dnn_test) 17 | # workaround for https://gitlab.kitware.com/cmake/cmake/issues/8774 18 | add_custom_target(run_tests COMMAND ${CMAKE_CTEST_COMMAND} 19 | DEPENDS tiny_dnn_test) 20 | 21 | if(COVERALLS) 22 | message(STATUS "Code coverage: Enabled") 23 | set_target_properties(tiny_dnn_test 24 | PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -g -fprofile-arcs -ftest-coverage" 25 | LINK_FLAGS "-lgcov --coverage") 26 | 27 | else(COVERALLS) 28 | message(STATUS "Code coverage: Disabled") 29 | endif(COVERALLS) 30 | 31 | if(PROTO_CPP_AVAILABLE) 32 | set_source_files_properties(${proto_file} PROPERTIES GENERATED TRUE) 33 | target_sources(tiny_dnn_test PUBLIC ${proto_file}) 34 | set_source_files_properties(test.cpp PROPERTIES COMPILE_DEFINITIONS 35 | CNN_USE_CAFFE_CONVERTER) 36 | target_link_libraries(tiny_dnn_test 37 | ${project_library_target_name} 38 | ${PROTOBUF_LIBRARIES} ${REQUIRED_LIBRARIES}) 39 | endif() 40 | 41 | if(PROTO_CPP_GENERATE) 42 | add_dependencies(tiny_dnn_test generated_proto) 43 | endif() 44 | 45 | ### Clang-tidy check 46 | include(../cmake/clang-cxx-dev-tools.cmake) 47 | 48 | cotire(print_device tiny_dnn_test) 49 | -------------------------------------------------------------------------------- /test/print_device.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | 9 | #include "tiny_dnn/tiny_dnn.h" 10 | 11 | using namespace tiny_dnn; 12 | 13 | int main(int argc, char *argv[]) { 14 | #if defined(USE_OPENCL) || defined(USE_CUDA) 15 | if (argc < 3) { 16 | nn_warn("Need two parameters: platform_id and device_id."); 17 | return 0; 18 | } 19 | 20 | const int platform_id = atoi(argv[1]); 21 | const int device_id = atoi(argv[2]); 22 | 23 | printAvailableDevice(platform_id, device_id); 24 | #else 25 | CNN_UNREFERENCED_PARAMETER(argc); 26 | CNN_UNREFERENCED_PARAMETER(argv); 27 | nn_warn("TinyDNN was not compiled with OpenCL or CUDA support."); 28 | #endif 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /test/test_activation_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace tiny_dnn { 13 | 14 | TEST(selu, gradient_check) { 15 | const size_t width = 3; 16 | const size_t height = 3; 17 | const size_t channels = 10; 18 | selu slu(width, height, channels); 19 | std::vector input_data = 20 | generate_test_data({1}, {width * height * channels}); 21 | std::vector in_grad = input_data; // copy constructor 22 | std::vector out_data = 23 | generate_test_data({1}, {width * height * channels}); 24 | std::vector out_grad = 25 | generate_test_data({1}, {width * height * channels}); 26 | const size_t trials = 100; 27 | for (size_t i = 0; i < trials; i++) { 28 | const size_t in_edge = uniform_idx(input_data); 29 | const size_t in_idx = uniform_idx(input_data[in_edge][0]); 30 | const size_t out_edge = uniform_idx(out_data); 31 | const size_t out_idx = uniform_idx(out_data[out_edge][0]); 32 | float_t ngrad = numeric_gradient(slu, input_data, in_edge, in_idx, out_data, 33 | out_edge, out_idx); 34 | float_t cgrad = analytical_gradient(slu, input_data, in_edge, in_idx, 35 | out_data, out_grad, out_edge, out_idx); 36 | EXPECT_NEAR(ngrad, cgrad, epsilon()); 37 | } 38 | } 39 | 40 | } // namespace tiny_dnn 41 | -------------------------------------------------------------------------------- /test/test_l2_norm_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace tiny_dnn { 13 | 14 | TEST(l2norm, forward) { 15 | l2_normalization_layer l2_norm(4, 3, 1e-10, 20); 16 | 17 | // clang-format off 18 | tensor_t in = { 19 | { 20 | 0.0, 0.0, 0.0, 0.0, // ch-0 of data#0 21 | -4.0, 0.0, -1.0, 2.0, // ch-1 of data#0 22 | 1.0, 0.0, 1.0, 3.0, // ch-2 of data#0 23 | }, { 24 | 0.0, 0.0, 0.0, 0.0, // ch-0 of data#1 25 | 2.0, 0.0, -4.0, -3.0, // ch-1 of data#1 26 | 2.0, 5.0, 1.0, 10.0 // ch-2 of data#1 27 | } 28 | }; 29 | 30 | tensor_t expect = { 31 | { 32 | 0.0000, 0.0000, 0.0000, 0.0000, // ch-0 of data#0 33 | -19.4029, 0.0000, -14.1421, 11.0940, // ch-1 of data#0 34 | 4.8507, 0.0000, 14.1421, 16.6410, // ch-2 of data#0 35 | }, { 36 | 0.0000, 0.0000, 0.0000, 0.0000, // ch-0 of data#1 37 | 14.1421, 0.0000, -19.4029, -5.7470, // ch-1 of data#1 38 | 14.1421, 20.0000, 4.8507, 19.1565 // ch-2 of data#1 39 | } 40 | }; 41 | // clang-format on 42 | 43 | std::vector result; 44 | l2_norm.forward({in}, result); 45 | 46 | for (size_t i = 0; i < 2; i++) { 47 | for (size_t j = 0; j < 3 * 4; j++) { 48 | EXPECT_NEAR(expect[i][j], (*result[0])[i][j], 1e-3); 49 | } 50 | } 51 | } 52 | 53 | } // namespace tiny_dnn 54 | -------------------------------------------------------------------------------- /test/test_large_thread_count.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace tiny_dnn { 13 | 14 | TEST(test_large_thread_count, test_large_thread_count) { 15 | network net; 16 | net << fully_connected_layer(1, 2) << tanh_layer(); 17 | adagrad optimizer; 18 | 19 | std::vector data; 20 | std::vector labels; 21 | 22 | const size_t tnum = 300; 23 | 24 | for (size_t i = 0; i < tnum; i++) { 25 | bool in = bernoulli(0.5); 26 | bool label = bernoulli(0.5); 27 | 28 | data.push_back({static_cast(in)}); 29 | labels.push_back(label ? 1 : 0); 30 | } 31 | 32 | const int n_threads = 200; 33 | 34 | // test different batch sizes 35 | net.train(optimizer, data, labels, 1, 1, nop, nop, true, n_threads); 36 | net.train(optimizer, data, labels, 100, 1, nop, nop, true, n_threads); 37 | net.train(optimizer, data, labels, 200, 1, nop, nop, true, n_threads); 38 | net.train(optimizer, data, labels, 300, 1, nop, nop, true, n_threads); 39 | } 40 | 41 | } // namespace tiny_dnn 42 | -------------------------------------------------------------------------------- /test/test_main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #define CATCH_CONFIG_MAIN 3 | #define CATCH_CONFIG_FAST_COMPILE 4 | #include "third_party/catch2/catch.hpp" 5 | 6 | -------------------------------------------------------------------------------- /test/test_models.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | namespace tiny_dnn { 11 | 12 | TEST(models, alexnet) { 13 | models::alexnet nn("alexnet"); 14 | 15 | ASSERT_EQ(nn.name(), "alexnet"); 16 | EXPECT_EQ(nn.in_data_size(), size_t(224 * 224 * 3)); 17 | 18 | vec_t in(nn.in_data_size()); 19 | 20 | // generate random variables 21 | uniform_rand(in.begin(), in.end(), 0, 1); 22 | 23 | // init wieghts and biases 24 | nn.weight_init(weight_init::constant(2.0)); 25 | nn.bias_init(weight_init::constant(2.0)); 26 | nn.init_weight(); 27 | 28 | // predict 29 | auto res = nn.predict(in); 30 | } 31 | 32 | } // namespace tiny_dnn 33 | -------------------------------------------------------------------------------- /test/testimage/bmp/24bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/bmp/24bit.bmp -------------------------------------------------------------------------------- /test/testimage/bmp/8bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/bmp/8bit.bmp -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/basi0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/basi0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/basi2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/basi2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/basi4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/basi4a16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/basi6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/basi6a16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/basn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/basn0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/basn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/basn2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/basn4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/basn4a16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/basn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/basn6a16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/bgai4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/bgai4a16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/bgan6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/bgan6a16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/bggn4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/bggn4a16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/bgyn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/bgyn6a16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/oi1n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/oi1n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/oi1n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/oi1n2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/oi2n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/oi2n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/oi2n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/oi2n2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/oi4n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/oi4n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/oi4n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/oi4n2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/oi9n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/oi9n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/oi9n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/oi9n2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/tbbn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/tbbn2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/tbgn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/tbgn2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/16bit/tbwn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/16bit/tbwn0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/PngSuite.LICENSE: -------------------------------------------------------------------------------- 1 | PngSuite 2 | -------- 3 | 4 | Permission to use, copy, modify and distribute these images for any 5 | purpose and without fee is hereby granted. 6 | 7 | 8 | (c) Willem van Schaik, 1996, 2011 9 | 10 | -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xc1n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xc1n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xc9n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xc9n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xcrn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xcrn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xcsn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xcsn0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xd0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xd0n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xd3n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xd3n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xd9n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xd9n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xdtn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xdtn0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xhdn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xhdn0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xlfn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xlfn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xs1n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xs1n0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xs2n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xs2n0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xs4n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xs4n0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/corrupt/xs7n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/corrupt/xs7n0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi0g02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi4a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basi6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basi6a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn0g02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn4a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/basn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/basn6a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/bgai4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/bgai4a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/bgan6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/bgan6a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/bgbn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/bgbn4a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/bgwn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/bgwn6a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s01i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s01i3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s01n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s01n3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s02i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s02i3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s02n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s02n3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s03i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s03i3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s03n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s03n3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s04i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s04i3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s04n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s04n3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s05i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s05i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s05n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s05n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s06i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s06i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s06n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s06n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s07i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s07i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s07n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s07n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s08i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s08i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s08n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s08n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s09i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s09i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s09n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s09n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s32i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s32i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s32n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s32n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s33i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s33i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s33n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s33n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s34i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s34i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s34n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s34n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s35i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s35i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s35n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s35n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s36i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s36i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s36n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s36n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s37i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s37i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s37n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s37n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s38i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s38i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s38n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s38n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s39i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s39i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s39n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s39n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s40i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s40i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/s40n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/s40n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tbbn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tbbn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tbbn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tbbn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tbgn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tbgn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tbrn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tbrn2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tbwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tbwn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tbyn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tbyn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tm3n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tm3n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tp0n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tp0n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tp0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tp0n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tp0n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tp0n3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/tp1n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/tp1n3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/z00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/z00n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/z03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/z03n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/z06n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/z06n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary/z09n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary/z09n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi0g02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi4a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basi6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basi6a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn0g01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn0g02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn4a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/basn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/basn6a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/bgai4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/bgai4a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/bgan6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/bgan6a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/bgbn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/bgbn4a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/bgwn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/bgwn6a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s01i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s01i3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s01n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s01n3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s02i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s02i3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s02n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s02n3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s03i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s03i3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s03n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s03n3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s04i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s04i3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s04n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s04n3p01.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s05i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s05i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s05n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s05n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s06i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s06i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s06n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s06n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s07i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s07i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s07n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s07n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s08i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s08i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s08n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s08n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s09i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s09i3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s09n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s09n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s32i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s32i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s32n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s32n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s33i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s33i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s33n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s33n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s34i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s34i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s34n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s34n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s35i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s35i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s35n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s35n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s36i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s36i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s36n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s36n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s37i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s37i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s37n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s37n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s38i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s38i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s38n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s38n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s39i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s39i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s39n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s39n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s40i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s40i3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/s40n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/s40n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tbbn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tbbn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tbbn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tbbn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tbgn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tbgn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tbrn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tbrn2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tbwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tbwn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tbyn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tbyn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tm3n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tm3n3p02.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tp0n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tp0n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tp0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tp0n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tp0n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tp0n3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/tp1n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/tp1n3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/z00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/z00n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/z03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/z03n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/z06n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/z06n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/primary_check/z09n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/primary_check/z09n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ccwn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ccwn2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ccwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ccwn3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cdfn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cdfn2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cdhn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cdhn2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cdsn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cdsn2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cdun2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cdun2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ch1n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ch1n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ch2n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ch2n3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cm0n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cm0n0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cm7n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cm7n0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cm9n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cm9n0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cs3n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cs3n2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cs3n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cs3n3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cs5n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cs5n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cs5n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cs5n3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cs8n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cs8n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cs8n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cs8n3p08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ct0n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ct0n0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ct1n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ct1n0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cten0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cten0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ctfn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ctfn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ctgn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ctgn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/cthn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/cthn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ctjn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ctjn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ctzn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ctzn0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f00n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f00n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f00n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f01n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f01n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f01n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f01n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f02n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f02n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f02n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f02n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f03n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f03n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f03n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f04n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f04n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f04n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f04n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/f99n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/f99n0g04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g03n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g03n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g03n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g03n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g03n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g04n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g04n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g04n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g04n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g04n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g04n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g05n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g05n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g05n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g05n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g05n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g05n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g07n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g07n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g07n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g07n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g07n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g07n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g10n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g10n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g10n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g10n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g10n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g10n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g25n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g25n0g16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g25n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g25n2c08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/g25n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/g25n3p04.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/pp0n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/pp0n2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/pp0n6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/pp0n6a08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ps1n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ps1n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ps1n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ps1n2c16.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ps2n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ps2n0g08.png -------------------------------------------------------------------------------- /test/testimage/pngsuite/unused/ps2n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/test/testimage/pngsuite/unused/ps2n2c16.png -------------------------------------------------------------------------------- /third_party/cl_kernels/auxiliary.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(gpu_set,Dtype)(const int_tp n, const Dtype alpha, __global Dtype* y) { 6 | for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) { 7 | y[index] = alpha; 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /third_party/cl_kernels/batch_reindex.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(br_forward,Dtype)(const int_tp count, const int_tp inner_dim, 6 | __global const Dtype* in, 7 | __global const Dtype* permut, 8 | __global Dtype* out) { 9 | for (int_tp index = get_global_id(0); index < count; 10 | index += get_global_size(0)) { 11 | int_tp n = index / (inner_dim); 12 | int_tp in_n = (int_tp) (permut[n]); 13 | out[index] = in[in_n * (inner_dim) + index % (inner_dim)]; 14 | } 15 | } 16 | 17 | __kernel void TEMPLATE(br_backward,Dtype)(const int_tp count, const int_tp inner_dim, 18 | __global const Dtype* in, 19 | __global const Dtype* top_indexes, 20 | __global const Dtype* begins, 21 | __global const Dtype* counts, 22 | __global Dtype* out) { 23 | for (int_tp index = get_global_id(0); index < count; 24 | index += get_global_size(0)) { 25 | int_tp n = index / (inner_dim); 26 | out[index] = 0; 27 | int_tp lower = (int_tp) (begins[n]); 28 | int_tp upper = lower + (int_tp) (counts[n]); 29 | for (int_tp i = lower; i < upper; ++i) { 30 | int_tp in_n = (int_tp) (top_indexes[i]); 31 | out[index] += in[in_n * (inner_dim) + index % (inner_dim)]; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /third_party/cl_kernels/benchmark.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(null_kernel,Dtype)(void) { 6 | } 7 | -------------------------------------------------------------------------------- /third_party/cl_kernels/bnll.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(bnll_forward,Dtype)(const int_tp n, 6 | __global const Dtype* in, 7 | __global Dtype* out) { 8 | for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) { 9 | if (in[index] > 0.0f) { 10 | out[index] = in[index] + log((Dtype) (1.0 + exp(-in[index]))); 11 | } else { 12 | out[index] = log((Dtype) (1.0 + exp(in[index]))); 13 | } 14 | } 15 | } 16 | 17 | __kernel void TEMPLATE(bnll_backward,Dtype)(const int_tp n, 18 | __global const Dtype* in_diff, 19 | __global const Dtype* in_data, 20 | __global Dtype* out_diff) { 21 | Dtype kBNLL_THRESHOLD = 50.; 22 | for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) { 23 | Dtype expval = exp(min(in_data[index], kBNLL_THRESHOLD)); 24 | out_diff[index] = in_diff[index] * expval / (expval + 1.); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /third_party/cl_kernels/concat.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(concat,Dtype)(const int_tp nthreads, __global const Dtype* in_data, 6 | const int forward, const int_tp num_concats, 7 | const int_tp concat_size, 8 | const int_tp top_concat_axis, 9 | const int_tp bottom_concat_axis, 10 | const int_tp offset_concat_axis, 11 | __global Dtype* out_data) { 12 | 13 | for (int_tp index = get_global_id(0); index < nthreads; 14 | index += get_global_size(0)) { 15 | const int_tp total_concat_size = concat_size * bottom_concat_axis; 16 | const int_tp concat_num = index / total_concat_size; 17 | const int_tp concat_index = index % total_concat_size; 18 | const int_tp top_index = concat_index 19 | + (concat_num * top_concat_axis + offset_concat_axis) * concat_size; 20 | if (forward == 1) { 21 | out_data[top_index] = in_data[index]; 22 | } else { 23 | out_data[index] = in_data[top_index]; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /third_party/cl_kernels/contrastive_loss.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(cll_backward,Dtype)(const int_tp count, const int_tp channels, 6 | const Dtype margin, const Dtype alpha, __global const Dtype* y, 7 | __global const Dtype* diff, __global const Dtype* dist_sq, 8 | __global Dtype *bottom_diff) { 9 | for (int_tp i = get_global_id(0); i < count; 10 | i += get_global_size(0)) { 11 | int_tp n = i / channels; // the num index, to access y and dist_sq 12 | if (trunc(y[n]) != 0.) { // similar pairs 13 | bottom_diff[i] = alpha * diff[i]; 14 | } else { // dissimilar pairs 15 | Dtype mdist = 0.; 16 | Dtype beta = 0.; 17 | Dtype dist = sqrt(dist_sq[n]); 18 | mdist = (margin - dist); 19 | beta = -alpha * mdist / (dist + 1e-4) * diff[i]; 20 | if (mdist > 0.) { 21 | bottom_diff[i] = beta; 22 | } else { 23 | bottom_diff[i] = 0; 24 | } 25 | } 26 | } 27 | } 28 | 29 | __kernel void TEMPLATE(cll_backward_legacy,Dtype)(const int count, const int channels, 30 | const Dtype margin, const Dtype alpha, __global Dtype* y, 31 | __global Dtype* diff, __global Dtype* dist_sq, 32 | __global Dtype* bottom_diff) { 33 | for (int_tp i = get_global_id(0); i < count; 34 | i += get_global_size(0)) { 35 | int n = i / channels; // the num index, to access y and dist_sq 36 | if (trunc(y[n]) != 0.) { // similar pairs 37 | bottom_diff[i] = alpha * diff[i]; 38 | } else { // dissimilar pairs 39 | Dtype mdist = 0.; 40 | Dtype beta = 0.; 41 | mdist = (margin - dist_sq[n]); 42 | beta = -alpha; 43 | if (mdist > 0.) { 44 | bottom_diff[i] = beta; 45 | } else { 46 | bottom_diff[i] = 0; 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /third_party/cl_kernels/crop.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(crop_copy, Dtype)(const int_tp n, const int_tp height, 6 | const int_tp width, 7 | const int_tp src_outer_stride, 8 | const int_tp src_inner_stride, 9 | const int_tp dest_outer_stride, 10 | const int_tp dest_inner_stride, 11 | __global const Dtype* src, 12 | const int_tp src_off, 13 | __global Dtype* dest, 14 | const int_tp dest_off) { 15 | for (int_tp index = get_global_id(0); index < n; 16 | index += get_global_size(0)) { 17 | int_tp src_start = index / height * src_outer_stride 18 | + index % height * src_inner_stride; 19 | int_tp dest_start = index / height * dest_outer_stride 20 | + index % height * dest_inner_stride; 21 | for (int_tp i = 0; i < width; ++i) { 22 | dest[dest_off + dest_start + i] = src[src_off + src_start + i]; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /third_party/cl_kernels/dropout.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(dropout_forward,Dtype)(const int_tp n, 6 | __global const Dtype* in, 7 | __global const uint_tp* mask, 8 | const uint_tp threshold, 9 | const Dtype scale, 10 | __global Dtype* out) { 11 | for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) { 12 | out[index] = in[index] * ((mask[index] > threshold)?1.0:0.0) * scale; 13 | } 14 | } 15 | 16 | __kernel void TEMPLATE(dropout_backward,Dtype)( 17 | const int_tp n, __global const Dtype* in_diff, 18 | __global const uint_tp* mask, const uint_tp threshold, 19 | const Dtype scale, 20 | __global Dtype* out_diff) { 21 | for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) { 22 | out_diff[index] = in_diff[index] * ((mask[index] > threshold)?1.0:0.0) * scale; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /third_party/cl_kernels/eltwise.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(eltwise_max_forward,Dtype)( 6 | const int_tp nthreads, __global const Dtype* bottom_data_a, 7 | __global const Dtype* bottom_data_b, const int_tp blob_idx, 8 | __global Dtype* top_data, 9 | __global int_tp* mask) { 10 | for (int_tp index = get_global_id(0); index < nthreads; 11 | index += get_global_size(0)) { 12 | Dtype maxval = -FLT_MAX; 13 | int_tp maxidx = -1; 14 | if (bottom_data_a[index] > bottom_data_b[index]) { 15 | // only update for very first bottom_data blob (blob_idx == 0) 16 | if (blob_idx == 0) { 17 | maxval = bottom_data_a[index]; 18 | top_data[index] = maxval; 19 | maxidx = blob_idx; 20 | mask[index] = maxidx; 21 | } 22 | } else { 23 | maxval = bottom_data_b[index]; 24 | top_data[index] = maxval; 25 | maxidx = blob_idx + 1; 26 | mask[index] = maxidx; 27 | } 28 | } 29 | } 30 | 31 | __kernel void TEMPLATE(eltwise_max_backward,Dtype)(const int_tp nthreads, 32 | __global const Dtype* top_diff, 33 | const int_tp blob_idx, 34 | __global const int_tp* mask, 35 | __global Dtype* bottom_diff) { 36 | for (int_tp index = get_global_id(0); index < nthreads; 37 | index += get_global_size(0)) { 38 | Dtype gradient = 0; 39 | if (mask[index] == blob_idx) { 40 | gradient += top_diff[index]; 41 | } 42 | bottom_diff[index] = gradient; 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /third_party/cl_kernels/elu.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(elu_forward,Dtype)(const int n, __global const Dtype* in, 6 | __global Dtype* out, 7 | Dtype alpha) { 8 | for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) { 9 | out[index] = in[index] > 0 ? in[index] : alpha * (exp(in[index]) - 1.0); 10 | } 11 | } 12 | 13 | __kernel void TEMPLATE(elu_backward,Dtype)(const int n, __global const Dtype* in_diff, 14 | __global const Dtype* out_data, 15 | __global const Dtype* in_data, 16 | __global Dtype* out_diff, 17 | Dtype alpha) { 18 | for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) { 19 | out_diff[index] = 20 | in_data[index] > 0 ? 21 | in_diff[index] : in_diff[index] * (out_data[index] + alpha); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /third_party/cl_kernels/fillbuffer.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(fillbuffer,Dtype)(const int_tp n, const char alpha, __global char* x, 6 | const int_tp offx) { 7 | for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) { 8 | x[index + offx] = alpha; 9 | } 10 | } 11 | 12 | __kernel void TEMPLATE(fill,Dtype)(const int_tp n, const Dtype alpha, __global Dtype* x, 13 | const int_tp offx) { 14 | for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) { 15 | x[index + offx] = alpha; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /third_party/cl_kernels/slice.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | __kernel void TEMPLATE(slice,Dtype)(const int_tp nthreads, 6 | __global const Dtype* in_data, 7 | const int forward, const int_tp num_slices, 8 | const int_tp slice_size, 9 | const int_tp bottom_slice_axis, 10 | const int_tp top_slice_axis, 11 | const int_tp offset_slice_axis, 12 | __global Dtype* out_data) { 13 | for (int_tp index = get_global_id(0); index < nthreads; 14 | index += get_global_size(0)) { 15 | const int_tp total_slice_size = slice_size * top_slice_axis; 16 | const int_tp slice_num = index / total_slice_size; 17 | const int_tp slice_index = index % total_slice_size; 18 | const int_tp bottom_index = slice_index 19 | + (slice_num * bottom_slice_axis + offset_slice_axis) * slice_size; 20 | if (forward == 1) { 21 | out_data[index] = in_data[bottom_index]; 22 | } else { 23 | out_data[bottom_index] = in_data[index]; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /third_party/cl_kernels/tile.cl: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCL_VERSION__ 2 | #include "header.cl" 3 | #endif 4 | 5 | 6 | __kernel void TEMPLATE(tile,Dtype)(const int_tp nthreads, __global const Dtype* bottom_data, 7 | const int_tp tile_size, const int_tp num_tiles, 8 | const int_tp bottom_tile_axis, 9 | __global Dtype* top_data) { 10 | for (int_tp index = get_global_id(0); index < nthreads; 11 | index += get_global_size(0)) { 12 | const int_tp d = index % tile_size; 13 | const int_tp b = (index / tile_size / num_tiles) % bottom_tile_axis; 14 | const int_tp n = index / tile_size / num_tiles / bottom_tile_axis; 15 | const int_tp bottom_index = (n * bottom_tile_axis + b) * tile_size + d; 16 | top_data[index] = bottom_data[bottom_index]; 17 | } 18 | } 19 | 20 | 21 | __kernel void TEMPLATE(tile_backward,Dtype)(const int_tp nthreads, 22 | __global const Dtype* top_diff, 23 | const int_tp tile_size, 24 | const int_tp num_tiles, 25 | const int_tp bottom_tile_axis, 26 | __global Dtype* bottom_diff) { 27 | for (int_tp index = get_global_id(0); index < nthreads; 28 | index += get_global_size(0)) { 29 | const int_tp d = index % tile_size; 30 | const int_tp b = (index / tile_size) % bottom_tile_axis; 31 | const int_tp n = index / tile_size / bottom_tile_axis; 32 | bottom_diff[index] = 0; 33 | int_tp top_index = (n * num_tiles * bottom_tile_axis + b) * tile_size + d; 34 | for (int_tp t = 0; t < num_tiles; ++t) { 35 | bottom_diff[index] += top_diff[top_index]; 36 | top_index += bottom_tile_axis * tile_size; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /third_party/gemmlowp/meta/generators/meta_arm_32.py: -------------------------------------------------------------------------------- 1 | """Generates the arm32 headers used by the gemm/gemv lib.""" 2 | 3 | import cc_emitter 4 | import meta_arm_common 5 | import neon_emitter 6 | 7 | 8 | def Main(): 9 | """Generate the single threaded meta gemm library.""" 10 | cc = cc_emitter.CCEmitter() 11 | meta_arm_common.GenerateHeader(cc, 'gemmlowp_meta_single_thread_gemm_arm32', 12 | 'GEMMLOWP_NEON_32') 13 | 14 | cc.EmitNamespaceBegin('gemmlowp') 15 | cc.EmitNamespaceBegin('meta') 16 | cc.EmitNamespaceBegin('internal') 17 | cc.EmitNewline() 18 | 19 | meta_arm_common.GenerateInternalFunctions(cc, neon_emitter.NeonEmitter()) 20 | 21 | cc.EmitNamespaceEnd() 22 | cc.EmitNamespaceEnd() 23 | cc.EmitNamespaceEnd() 24 | cc.EmitNewline() 25 | 26 | meta_arm_common.GenerateFooter( 27 | cc, 'Meta gemm for arm32 requires: GEMMLOWP_NEON_32!') 28 | 29 | 30 | if __name__ == '__main__': 31 | Main() 32 | -------------------------------------------------------------------------------- /third_party/gemmlowp/meta/generators/meta_arm_64.py: -------------------------------------------------------------------------------- 1 | """Generates the arm32 headers used by the gemm/gemv lib.""" 2 | 3 | import cc_emitter 4 | import meta_arm_common 5 | import neon_emitter_64 6 | 7 | 8 | def Main(): 9 | """Generate the single threaded meta gemm library.""" 10 | cc = cc_emitter.CCEmitter() 11 | meta_arm_common.GenerateHeader(cc, 'gemmlowp_meta_single_thread_gemm_arm64', 12 | 'GEMMLOWP_NEON_64') 13 | 14 | cc.EmitNamespaceBegin('gemmlowp') 15 | cc.EmitNamespaceBegin('meta') 16 | cc.EmitNamespaceBegin('internal') 17 | cc.EmitNewline() 18 | 19 | meta_arm_common.GenerateInternalFunctions(cc, neon_emitter_64.NeonEmitter64()) 20 | 21 | cc.EmitNamespaceEnd() 22 | cc.EmitNamespaceEnd() 23 | cc.EmitNamespaceEnd() 24 | cc.EmitNewline() 25 | 26 | meta_arm_common.GenerateFooter( 27 | cc, 'Meta gemm for arm64 requires: GEMMLOWP_NEON_64!') 28 | 29 | 30 | if __name__ == '__main__': 31 | Main() 32 | -------------------------------------------------------------------------------- /tiny_dnn/activations/asinh_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | #include "tiny_dnn/activations/activation_layer.h" 14 | #include "tiny_dnn/layers/layer.h" 15 | 16 | namespace tiny_dnn { 17 | 18 | class asinh_layer : public activation_layer { 19 | public: 20 | using activation_layer::activation_layer; 21 | 22 | std::string layer_type() const override { return "asinh-activation"; } 23 | 24 | void forward_activation(const vec_t &x, vec_t &y) override { 25 | for (size_t j = 0; j < x.size(); j++) { 26 | y[j] = std::asinh(x[j]); 27 | } 28 | } 29 | 30 | void backward_activation(const vec_t &x, 31 | const vec_t &y, 32 | vec_t &dx, 33 | const vec_t &dy) override { 34 | for (size_t j = 0; j < x.size(); j++) { 35 | // dx = dy * (gradient of asinh) 36 | dx[j] = dy[j] / std::cosh(y[j]); 37 | } 38 | } 39 | 40 | std::pair scale() const override { 41 | return std::make_pair(float_t(-0.8), float_t(0.8)); 42 | } 43 | 44 | friend struct serialization_buddy; 45 | }; 46 | 47 | } // namespace tiny_dnn 48 | -------------------------------------------------------------------------------- /tiny_dnn/activations/relu_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "tiny_dnn/activations/activation_layer.h" 15 | #include "tiny_dnn/layers/layer.h" 16 | 17 | namespace tiny_dnn { 18 | 19 | class relu_layer : public activation_layer { 20 | public: 21 | using activation_layer::activation_layer; 22 | 23 | std::string layer_type() const override { return "relu-activation"; } 24 | 25 | void forward_activation(const vec_t &x, vec_t &y) override { 26 | for (size_t j = 0; j < x.size(); j++) { 27 | y[j] = std::max(float_t(0), x[j]); 28 | } 29 | } 30 | 31 | void backward_activation(const vec_t &x, 32 | const vec_t &y, 33 | vec_t &dx, 34 | const vec_t &dy) override { 35 | for (size_t j = 0; j < x.size(); j++) { 36 | // dx = dy * (gradient of relu) 37 | dx[j] = dy[j] * (y[j] > float_t(0) ? float_t(1) : float_t(0)); 38 | } 39 | } 40 | 41 | std::pair scale() const override { 42 | return std::make_pair(float_t(0.1), float_t(0.9)); 43 | } 44 | 45 | friend struct serialization_buddy; 46 | }; 47 | 48 | } // namespace tiny_dnn 49 | -------------------------------------------------------------------------------- /tiny_dnn/activations/sigmoid_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | #include "tiny_dnn/activations/activation_layer.h" 14 | #include "tiny_dnn/layers/layer.h" 15 | 16 | namespace tiny_dnn { 17 | 18 | class sigmoid_layer : public activation_layer { 19 | public: 20 | using activation_layer::activation_layer; 21 | 22 | std::string layer_type() const override { return "sigmoid-activation"; } 23 | 24 | void forward_activation(const vec_t &x, vec_t &y) override { 25 | for (size_t j = 0; j < x.size(); j++) { 26 | y[j] = float_t(1) / (float_t(1) + std::exp(-x[j])); 27 | } 28 | } 29 | 30 | void backward_activation(const vec_t &x, 31 | const vec_t &y, 32 | vec_t &dx, 33 | const vec_t &dy) override { 34 | for (size_t j = 0; j < x.size(); j++) { 35 | // dx = dy * (gradient of sigmoid) 36 | dx[j] = dy[j] * y[j] * (float_t(1) - y[j]); 37 | } 38 | } 39 | 40 | std::pair scale() const override { 41 | return std::make_pair(float_t(0.1), float_t(0.9)); 42 | } 43 | 44 | friend struct serialization_buddy; 45 | }; 46 | 47 | } // namespace tiny_dnn 48 | -------------------------------------------------------------------------------- /tiny_dnn/activations/softsign_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017, Taiga Nomi 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | #include "tiny_dnn/activations/activation_layer.h" 14 | #include "tiny_dnn/layers/layer.h" 15 | 16 | namespace tiny_dnn { 17 | 18 | class softsign_layer : public activation_layer { 19 | public: 20 | using activation_layer::activation_layer; 21 | 22 | std::string layer_type() const override { return "softsign-activation"; } 23 | 24 | void forward_activation(const vec_t &x, vec_t &y) override { 25 | for (size_t j = 0; j < x.size(); j++) { 26 | y[j] = x[j] / (1.0 + std::abs(x[j])); 27 | } 28 | } 29 | 30 | void backward_activation(const vec_t &x, 31 | const vec_t &y, 32 | vec_t &dx, 33 | const vec_t &dy) override { 34 | CNN_UNREFERENCED_PARAMETER(y); 35 | for (size_t j = 0; j < x.size(); j++) { 36 | // dx = dy * (gradient of softsign) 37 | auto d = 1.0 + std::abs(x[j]); 38 | dx[j] = dy[j] / (d * d); 39 | } 40 | } 41 | 42 | std::pair scale() const override { 43 | return std::make_pair(float_t(0.1), float_t(0.9)); 44 | } 45 | 46 | friend struct serialization_buddy; 47 | }; 48 | 49 | } // namespace tiny_dnn 50 | -------------------------------------------------------------------------------- /tiny_dnn/activations/tanh_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | #include "tiny_dnn/activations/activation_layer.h" 14 | #include "tiny_dnn/layers/layer.h" 15 | 16 | namespace tiny_dnn { 17 | 18 | class tanh_layer : public activation_layer { 19 | public: 20 | using activation_layer::activation_layer; 21 | 22 | std::string layer_type() const override { return "tanh-activation"; } 23 | 24 | void forward_activation(const vec_t &x, vec_t &y) override { 25 | for (size_t j = 0; j < x.size(); j++) { 26 | y[j] = std::tanh(x[j]); 27 | } 28 | } 29 | 30 | void backward_activation(const vec_t &x, 31 | const vec_t &y, 32 | vec_t &dx, 33 | const vec_t &dy) override { 34 | for (size_t j = 0; j < x.size(); j++) { 35 | // dx = dy * (gradient of tanh) 36 | dx[j] = dy[j] * (float_t(1) - sqr(y[j])); 37 | } 38 | } 39 | 40 | std::pair scale() const override { 41 | return std::make_pair(float_t(-0.8), float_t(0.8)); 42 | } 43 | 44 | friend struct serialization_buddy; 45 | }; 46 | 47 | } // namespace tiny_dnn 48 | -------------------------------------------------------------------------------- /tiny_dnn/activations/tanh_p1m2_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | #include "tiny_dnn/activations/activation_layer.h" 14 | #include "tiny_dnn/layers/layer.h" 15 | 16 | namespace tiny_dnn { 17 | 18 | class tanh_p1m2_layer : public activation_layer { 19 | public: 20 | using activation_layer::activation_layer; 21 | 22 | std::string layer_type() const override { return "tanh-scaled-activation"; } 23 | 24 | void forward_activation(const vec_t &x, vec_t &y) override { 25 | float_t ep; 26 | for (size_t j = 0; j < x.size(); j++) { 27 | ep = std::exp(x[j]); 28 | y[j] = ep / (ep + (float_t(1) / ep)); 29 | } 30 | } 31 | 32 | void backward_activation(const vec_t &x, 33 | const vec_t &y, 34 | vec_t &dx, 35 | const vec_t &dy) override { 36 | for (size_t j = 0; j < x.size(); j++) { 37 | // dx = dy * (gradient of tanh-scaled) 38 | dx[j] = dy[j] * (2 * y[j] * (float_t(1) - y[j])); 39 | } 40 | } 41 | 42 | std::pair scale() const override { 43 | return std::make_pair(float_t(0.1), float_t(0.9)); 44 | } 45 | 46 | friend struct serialization_buddy; 47 | }; 48 | 49 | } // namespace tiny_dnn 50 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/avx_deconv2d_back_kernel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include "tiny_dnn/core/params/deconv_params.h" 11 | 12 | namespace tiny_dnn { 13 | namespace core { 14 | namespace kernels { 15 | 16 | inline void avx_deconv2d_back_kernel(const deconv_params ¶ms, 17 | const tensor_t &prev_out, 18 | const vec_t &W, 19 | tensor_t &dW, 20 | tensor_t &db, 21 | tensor_t &curr_delta, 22 | tensor_t *prev_delta) { 23 | // fallback to non-avx version 24 | tiny_deconv2d_back_kernel(params, prev_out, W, dW, db, curr_delta, 25 | prev_delta); 26 | } 27 | 28 | } // namespace kernels 29 | } // namespace core 30 | } // namespace tiny_dnn 31 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/avx_deconv2d_kernel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include "tiny_dnn/core/kernels/tiny_deconv2d_kernel.h" 11 | #include "tiny_dnn/core/params/deconv_params.h" 12 | 13 | namespace tiny_dnn { 14 | namespace core { 15 | namespace kernels { 16 | 17 | inline void avx_deconv2d_kernel(const deconv_params ¶ms, 18 | const tensor_t &in, 19 | const vec_t &W, 20 | const vec_t &bias, 21 | tensor_t &out, 22 | const bool layer_parallelize) { 23 | // fallback to non-avx version 24 | tiny_deconv2d_kernel(params, in, W, bias, out, layer_parallelize); 25 | } 26 | 27 | } // namespace kernels 28 | } // namespace core 29 | } // namespace tiny_dnn 30 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/dwconv2d_grad_op.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include "tiny_dnn/core/framework/op_kernel.h" 11 | 12 | #include "tiny_dnn/core/kernels/dwconv2d_op_internal.h" 13 | 14 | namespace tiny_dnn { 15 | 16 | class DWConv2dGradOp : public core::OpKernel { 17 | public: 18 | explicit DWConv2dGradOp(const core::OpKernelConstruction &context) 19 | : core::OpKernel(context) {} 20 | 21 | void compute(core::OpKernelContext &context) override { 22 | auto params = OpKernel::params_->dwconv(); 23 | 24 | // incoming/outcoming data 25 | const tensor_t &prev_out = context.input(0); 26 | const tensor_t &W = context.input(1); 27 | tensor_t &dW = context.input_grad(1); 28 | tensor_t &db = context.input_grad(2); 29 | tensor_t &prev_delta = context.input_grad(0); 30 | tensor_t &curr_delta = context.output_grad(0); 31 | 32 | // initalize outputs 33 | fill_tensor(prev_delta, float_t{0}); 34 | 35 | // call convolution algorithm depending 36 | // on the selected engine type 37 | 38 | const core::backend_t engine = context.engine(); 39 | 40 | if (engine == core::backend_t::internal) { 41 | kernels::dwconv2d_op_internal(prev_out, W[0], dW, db, curr_delta, 42 | prev_delta, params, context.parallelize()); 43 | } else { 44 | throw nn_error("Not supported engine: " + to_string(engine)); 45 | } 46 | } 47 | }; 48 | 49 | } // namespace tiny_dnn 50 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/dwconv2d_op.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include "tiny_dnn/core/framework/op_kernel.h" 11 | 12 | #include "tiny_dnn/core/kernels/dwconv2d_op_internal.h" 13 | 14 | namespace tiny_dnn { 15 | 16 | class DWConv2dOp : public core::OpKernel { 17 | public: 18 | explicit DWConv2dOp(const core::OpKernelConstruction &context) 19 | : core::OpKernel(context) {} 20 | 21 | void compute(core::OpKernelContext &context) override { 22 | auto params = OpKernel::params_->dwconv(); 23 | 24 | // incomimg/outcoming data 25 | const tensor_t &in_data = context.input(0); 26 | const tensor_t &W = context.input(1); 27 | const tensor_t &bias = context.input(2); 28 | tensor_t &out_data = context.output(0); 29 | 30 | // initialize outputs 31 | fill_tensor(out_data, float_t{0}); 32 | 33 | // call convolution algorithm depending 34 | // on the selected engine type 35 | 36 | const core::backend_t engine = context.engine(); 37 | 38 | if (engine == core::backend_t::internal) { 39 | kernels::dwconv2d_op_internal(in_data, W[0], bias[0], out_data, params, 40 | context.parallelize()); 41 | } else { 42 | throw nn_error("Not supported engine: " + to_string(engine)); 43 | } 44 | } 45 | }; 46 | 47 | } // namespace tiny_dnn 48 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/global_avepool_grad_op.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017, Taiga Nomi 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include "tiny_dnn/core/framework/op_kernel.h" 11 | #include "tiny_dnn/core/kernels/global_avepool_op_avx.h" 12 | #include "tiny_dnn/core/kernels/global_avepool_op_internal.h" 13 | 14 | namespace tiny_dnn { 15 | 16 | class GlobalAvePoolGradOp : public core::OpKernel { 17 | public: 18 | explicit GlobalAvePoolGradOp(const core::OpKernelConstruction &context) 19 | : core::OpKernel(context) {} 20 | 21 | void compute(core::OpKernelContext &context) override { 22 | auto ¶ms = OpKernel::params_->global_avepool(); 23 | 24 | // incoming/outcoming data 25 | tensor_t &prev_delta = context.input_grad(0); 26 | tensor_t &curr_delta = context.output_grad(0); 27 | 28 | // initialize outputs 29 | fill_tensor(prev_delta, float_t{0}); 30 | 31 | const core::backend_t engine = context.engine(); 32 | 33 | if (engine == core::backend_t::avx) { 34 | #ifdef CNN_USE_AVX 35 | kernels::global_avepool_grad_op_avx(prev_delta, curr_delta, params, 36 | context.parallelize()); 37 | #endif 38 | } else { 39 | kernels::global_avepool_grad_op_internal(prev_delta, curr_delta, params, 40 | context.parallelize()); 41 | } 42 | } 43 | }; 44 | 45 | } // namespace tiny_dnn 46 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/global_avepool_op.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017, Taiga Nomi 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include "tiny_dnn/core/framework/op_kernel.h" 11 | #include "tiny_dnn/core/kernels/global_avepool_op_avx.h" 12 | #include "tiny_dnn/core/kernels/global_avepool_op_internal.h" 13 | 14 | namespace tiny_dnn { 15 | 16 | class GlobalAvePoolOp : public core::OpKernel { 17 | public: 18 | explicit GlobalAvePoolOp(const core::OpKernelConstruction &context) 19 | : core::OpKernel(context) {} 20 | 21 | void compute(core::OpKernelContext &context) override { 22 | auto ¶ms = OpKernel::params_->global_avepool(); 23 | 24 | // incomimg / outcoming data 25 | const tensor_t &in_data = context.input(0); 26 | tensor_t &out_data = context.output(0); 27 | 28 | // initialize outputs 29 | fill_tensor(out_data, float_t{0}); 30 | 31 | const core::backend_t engine = context.engine(); 32 | 33 | if (engine == core::backend_t::avx) { 34 | #ifdef CNN_USE_AVX 35 | kernels::global_avepool_op_avx(in_data, out_data, params, 36 | context.parallelize()); 37 | #endif 38 | } else { 39 | kernels::global_avepool_op_internal(in_data, out_data, params, 40 | context.parallelize()); 41 | } 42 | } 43 | }; 44 | 45 | } // namespace tiny_dnn 46 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/global_avepool_op_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017, Taiga Nomi 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | namespace tiny_dnn { 11 | namespace kernels { 12 | 13 | inline void global_avepool_op_internal( 14 | const tensor_t &in_data, 15 | tensor_t &out_data, 16 | const core::global_avepool_params ¶ms, 17 | const bool layer_parallelize) { 18 | for_i(layer_parallelize, in_data.size(), [&](size_t sample) { 19 | const vec_t &in = in_data[sample]; 20 | vec_t &out = out_data[sample]; 21 | 22 | const size_t pool_area = params.in.width_ * params.in.height_; 23 | for (size_t i = 0; i < params.in.depth_; i++) { 24 | for (size_t j = 0; j < pool_area; j++) { 25 | out[i] += in[i * pool_area + j]; 26 | } 27 | out[i] /= pool_area; 28 | } 29 | }); 30 | } 31 | 32 | inline void global_avepool_grad_op_internal( 33 | tensor_t &prev_delta, 34 | const tensor_t &curr_delta, 35 | const core::global_avepool_params ¶ms, 36 | const bool layer_parallelize) { 37 | for_i(layer_parallelize, prev_delta.size(), [&](size_t sample) { 38 | vec_t &prev = prev_delta[sample]; 39 | const vec_t &curr = curr_delta[sample]; 40 | 41 | const size_t pool_area = params.in.width_ * params.in.height_; 42 | for (size_t i = 0; i < params.in.depth_; i++) { 43 | const float_t pi = curr[i] / pool_area; 44 | for (size_t j = 0; j < pool_area; j++) { 45 | prev[i * pool_area + j] = pi; 46 | } 47 | } 48 | }); 49 | } 50 | 51 | } // namespace kernels 52 | } // namespace tiny_dnn 53 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/maxpool_grad_op.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include "tiny_dnn/core/framework/op_kernel.h" 11 | 12 | #include "tiny_dnn/core/kernels/maxpool_op_avx.h" 13 | #include "tiny_dnn/core/kernels/maxpool_op_internal.h" 14 | 15 | namespace tiny_dnn { 16 | 17 | class MaxPoolGradOp : public core::OpKernel { 18 | public: 19 | explicit MaxPoolGradOp(const core::OpKernelConstruction &context) 20 | : core::OpKernel(context) {} 21 | 22 | void compute(core::OpKernelContext &context) override { 23 | auto ¶ms = OpKernel::params_->maxpool(); 24 | 25 | // incoming/outcoming data 26 | tensor_t &prev_delta = context.input_grad(0); 27 | tensor_t &curr_delta = context.output_grad(0); 28 | 29 | // initialize outputs 30 | fill_tensor(prev_delta, float_t{0}); 31 | 32 | // call the algorithm depending on the selected engine type 33 | 34 | const core::backend_t engine = context.engine(); 35 | 36 | if (engine == core::backend_t::internal) { 37 | kernels::maxpool_grad_op_internal(prev_delta, curr_delta, 38 | params.out2inmax, params.in2out, 39 | context.parallelize()); 40 | } else if (engine == core::backend_t::avx) { 41 | kernels::maxpool_grad_op_avx(prev_delta, curr_delta, params.out2inmax, 42 | params.in2out, context.parallelize()); 43 | } else { 44 | throw nn_error("Not supported engine: " + to_string(engine)); 45 | } 46 | } 47 | }; 48 | 49 | } // namespace tiny_dnn 50 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/maxpool_op_avx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "tiny_dnn/core/kernels/maxpool_op_internal.h" 13 | 14 | namespace tiny_dnn { 15 | namespace kernels { 16 | 17 | inline void maxpool_op_avx(const tensor_t &in_data, 18 | tensor_t &out_data, 19 | std::vector> &max_idx, 20 | const std::vector> &out2in, 21 | const bool layer_parallelize) { 22 | maxpool_op_internal(in_data, out_data, max_idx, out2in, layer_parallelize); 23 | } 24 | 25 | inline void maxpool_grad_op_avx(tensor_t &prev_delta, 26 | const tensor_t &curr_delta, 27 | std::vector> &max_idx, 28 | const std::vector &in2out, 29 | const bool layer_parallelize) { 30 | maxpool_grad_op_internal(prev_delta, curr_delta, max_idx, in2out, 31 | layer_parallelize); 32 | } 33 | 34 | } // namespace kernels 35 | } // namespace tiny_dnn 36 | -------------------------------------------------------------------------------- /tiny_dnn/core/kernels/nnp_deconv2d_kernel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "tiny_dnn/core/params/deconv_params.h" 13 | 14 | #ifdef CNN_USE_NNPACK 15 | #include 16 | 17 | namespace tiny_dnn { 18 | namespace core { 19 | namespace kernels { 20 | 21 | inline void nnp_deconv2d_kernel(const conv_params ¶ms, 22 | const std::vector &in, 23 | const vec_t &W, 24 | const vec_t &bias, 25 | tensor_t &a) {} 26 | 27 | } // namespace kernels 28 | } // namespace core 29 | } // namespace tiny_dnn 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /tiny_dnn/core/params/deconv_params.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | namespace tiny_dnn { 11 | namespace core { 12 | 13 | struct deconv_layer_worker_specific_storage { 14 | const tensor_t *prev_out_; 15 | const tensor_t *curr_out_unpadded_; 16 | tensor_t curr_out_buf_; 17 | tensor_t curr_delta_padded; 18 | }; 19 | 20 | struct deconv_params { 21 | connection_table tbl; 22 | index3d in; 23 | index3d out; 24 | index3d out_unpadded; 25 | index3d weight; 26 | bool has_bias; 27 | padding pad_type; 28 | size_t w_stride; 29 | size_t h_stride; 30 | }; 31 | 32 | } // namespace core 33 | } // namespace tiny_dnn 34 | -------------------------------------------------------------------------------- /tiny_dnn/core/params/fully_params.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include "tiny_dnn/core/params/params.h" 11 | 12 | namespace tiny_dnn { 13 | namespace core { 14 | 15 | class fully_params : public Params { 16 | public: 17 | size_t in_size_; 18 | size_t out_size_; 19 | bool has_bias_; 20 | }; 21 | 22 | // TODO(nyanp): can we do better here? 23 | inline fully_params &Params::fully() { 24 | return *(static_cast(this)); 25 | } 26 | 27 | } // namespace core 28 | } // namespace tiny_dnn 29 | -------------------------------------------------------------------------------- /tiny_dnn/core/params/global_avepool_params.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017, Taiga Nomi 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | #include "tiny_dnn/core/params/params.h" 10 | 11 | namespace tiny_dnn { 12 | namespace core { 13 | 14 | class global_avepool_params : public Params { 15 | public: 16 | shape3d in; 17 | shape3d out; 18 | }; 19 | 20 | inline global_avepool_params &Params::global_avepool() { 21 | return *(static_cast(this)); 22 | } 23 | 24 | } // namespace core 25 | } // namespace tiny_dnn 26 | -------------------------------------------------------------------------------- /tiny_dnn/core/params/gru_cell_params.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include "tiny_dnn/activations/sigmoid_layer.h" 12 | #include "tiny_dnn/activations/tanh_layer.h" 13 | #include "tiny_dnn/core/params/params.h" 14 | 15 | namespace tiny_dnn { 16 | namespace core { 17 | 18 | class gru_cell_params : public Params { 19 | public: 20 | size_t in_size_; 21 | size_t out_size_; 22 | std::shared_ptr tanh_; 23 | std::shared_ptr sigmoid_; 24 | bool has_bias_; 25 | }; 26 | 27 | inline gru_cell_params &Params::gru_cell() { 28 | return *(static_cast(this)); 29 | } 30 | 31 | } // namespace core 32 | } // namespace tiny_dnn 33 | -------------------------------------------------------------------------------- /tiny_dnn/core/params/lstm_cell_params.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include "tiny_dnn/activations/sigmoid_layer.h" 12 | #include "tiny_dnn/activations/tanh_layer.h" 13 | #include "tiny_dnn/core/params/params.h" 14 | 15 | namespace tiny_dnn { 16 | namespace core { 17 | 18 | class lstm_cell_params : public Params { 19 | public: 20 | size_t in_size_; 21 | size_t out_size_; 22 | std::shared_ptr tanh_; 23 | std::shared_ptr sigmoid_; 24 | bool has_bias_; 25 | }; 26 | 27 | inline lstm_cell_params &Params::lstm_cell() { 28 | return *(static_cast(this)); 29 | } 30 | 31 | } // namespace core 32 | } // namespace tiny_dnn 33 | -------------------------------------------------------------------------------- /tiny_dnn/core/params/maxpool_params.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "tiny_dnn/core/params/params.h" 13 | 14 | namespace tiny_dnn { 15 | namespace core { 16 | 17 | class maxpool_params : public Params { 18 | public: 19 | index3d in; 20 | index3d out; 21 | size_t pool_size_x; 22 | size_t pool_size_y; 23 | size_t stride_x; 24 | size_t stride_y; 25 | bool ceil_mode; 26 | padding pad_type; 27 | 28 | /* mapping out => max_index(in) (1:1) */ 29 | std::vector> out2inmax; 30 | /* mapping out => in (1:N) */ 31 | std::vector> out2in; 32 | /* mapping in => out (N:1) */ 33 | std::vector in2out; 34 | }; 35 | 36 | struct max_pooling_layer_worker_specific_storage { 37 | /* mapping out => max_index(in) (1:1) */ 38 | std::vector> out2inmax_; 39 | }; 40 | 41 | // TODO(nyanp): can we do better here? 42 | inline maxpool_params &Params::maxpool() { 43 | return *(static_cast(this)); 44 | } 45 | 46 | } // namespace core 47 | } // namespace tiny_dnn 48 | -------------------------------------------------------------------------------- /tiny_dnn/core/params/params.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | namespace tiny_dnn { 11 | namespace core { 12 | 13 | class conv_params; 14 | class dwconv_params; 15 | class fully_params; 16 | class maxpool_params; 17 | class global_avepool_params; 18 | class gru_cell_params; 19 | class rnn_cell_params; 20 | class lstm_cell_params; 21 | 22 | /* Base class to model operation parameters */ 23 | class Params { 24 | public: 25 | Params() {} 26 | 27 | conv_params &conv(); 28 | dwconv_params &dwconv(); 29 | fully_params &fully(); 30 | maxpool_params &maxpool(); 31 | global_avepool_params &global_avepool(); 32 | gru_cell_params &gru_cell(); 33 | rnn_cell_params &rnn_cell(); 34 | lstm_cell_params &lstm_cell(); 35 | }; 36 | 37 | } // namespace core 38 | } // namespace tiny_dnn 39 | -------------------------------------------------------------------------------- /tiny_dnn/core/params/rnn_cell_params.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "tiny_dnn/activations/activation_layer.h" 13 | #include "tiny_dnn/core/params/params.h" 14 | 15 | namespace tiny_dnn { 16 | namespace core { 17 | 18 | class rnn_cell_params : public Params { 19 | public: 20 | size_t in_size_; 21 | size_t out_size_; 22 | std::shared_ptr activation_{}; 23 | bool has_bias_; 24 | }; 25 | 26 | inline rnn_cell_params &Params::rnn_cell() { 27 | return *(static_cast(this)); 28 | } 29 | 30 | } // namespace core 31 | } // namespace tiny_dnn 32 | -------------------------------------------------------------------------------- /tiny_dnn/core/session.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "tiny_dnn/core/device.h" 15 | 16 | namespace tiny_dnn { 17 | namespace core { 18 | 19 | class session { 20 | public: 21 | explicit session(const std::string name) : name_(name) {} 22 | 23 | std::string get_name() const { return name_; } 24 | size_t get_num_devices() const { return devices_.size(); } 25 | 26 | // will call construct graph 27 | // should we here specify the devices to use? 28 | void schedule_session(/* network& net */); 29 | 30 | // will call forward or backward methods 31 | void run_session(/* data */); 32 | 33 | private: 34 | std::string name_; 35 | std::vector> devices_; 36 | }; 37 | 38 | } // namespace core 39 | } // namespace tiny_dnn 40 | -------------------------------------------------------------------------------- /tiny_dnn/io/caffe/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | exclude_files=caffe.pb.h 2 | -------------------------------------------------------------------------------- /tiny_dnn/io/layer_factory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "tiny_dnn/layers/fully_connected_layer.h" 13 | #include "tiny_dnn/util/util.h" 14 | 15 | namespace tiny_dnn { 16 | 17 | /** 18 | * create multi-layer perceptron 19 | */ 20 | template 21 | network make_mlp(Iter first, Iter last) { 22 | typedef network net_t; 23 | net_t n; 24 | 25 | Iter next = first + 1; 26 | for (; next != last; ++first, ++next) 27 | n << fully_connected_layer(*first, *next) << activation(*next); 28 | return n; 29 | } 30 | 31 | /** 32 | * create multi-layer perceptron 33 | */ 34 | template 35 | network make_mlp(const std::vector &units) { 36 | return make_mlp(units.begin(), units.end()); 37 | } 38 | 39 | } // namespace tiny_dnn 40 | -------------------------------------------------------------------------------- /tiny_dnn/layers/cell.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | #include 10 | #include "tiny_dnn/core/backend.h" 11 | #include "tiny_dnn/core/framework/device.fwd.h" 12 | 13 | namespace tiny_dnn { 14 | 15 | /** 16 | * Abstract class for recurrent cells. 17 | **/ 18 | class cell : public layer { 19 | public: 20 | cell() : layer({}, {}) {} 21 | 22 | virtual std::vector input_order() = 0; 23 | 24 | virtual std::vector output_order() = 0; 25 | 26 | virtual void forward_propagation(const std::vector &in_data, 27 | std::vector &out_data) = 0; 28 | 29 | virtual void back_propagation(const std::vector &in_data, 30 | const std::vector &out_data, 31 | std::vector &out_grad, 32 | std::vector &in_grad) = 0; 33 | 34 | virtual core::backend_t backend_type() const { return wrapper_->engine(); } 35 | 36 | virtual void init_backend(const layer *wrapper) = 0; 37 | 38 | protected: 39 | inline void set_wrapper(const layer *wrapper) { wrapper_ = wrapper; } 40 | 41 | const layer *wrapper_; // every forward iteration, we must get the engine, 42 | // backend, etc from the wrapper 43 | }; 44 | 45 | } // namespace tiny_dnn 46 | -------------------------------------------------------------------------------- /tiny_dnn/layers/cells.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | #include "tiny_dnn/layers/gru_cell.h" 10 | #include "tiny_dnn/layers/lstm_cell.h" 11 | #include "tiny_dnn/layers/rnn_cell.h" 12 | 13 | namespace tiny_dnn { 14 | // Wrappers for the cell constructors should be placed here. 15 | 16 | // rnn cell: 17 | inline std::shared_ptr rnn( 18 | size_t in_dim, 19 | size_t out_dim, 20 | const rnn_cell_parameters params = rnn_cell_parameters()) { 21 | return std::make_shared(rnn_cell(in_dim, out_dim, params)); 22 | } 23 | 24 | // gru cell: 25 | inline std::shared_ptr gru( 26 | size_t in_dim, 27 | size_t out_dim, 28 | const gru_cell_parameters params = gru_cell_parameters()) { 29 | return std::make_shared(gru_cell(in_dim, out_dim, params)); 30 | } 31 | 32 | // lstm cell: 33 | inline std::shared_ptr lstm( 34 | size_t in_dim, 35 | size_t out_dim, 36 | const lstm_cell_parameters params = lstm_cell_parameters()) { 37 | return std::make_shared(lstm_cell(in_dim, out_dim, params)); 38 | } 39 | } // namespace tiny_dnn 40 | -------------------------------------------------------------------------------- /tiny_dnn/layers/input_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | #include "tiny_dnn/layers/layer.h" 14 | 15 | namespace tiny_dnn { 16 | 17 | class input_layer : public layer { 18 | public: 19 | explicit input_layer(const shape3d &shape) 20 | : layer({vector_type::data}, {vector_type::data}), shape_(shape) {} 21 | 22 | explicit input_layer(size_t in_dim) 23 | : layer({vector_type::data}, {vector_type::data}), 24 | shape_(shape3d(in_dim, 1, 1)) {} 25 | 26 | std::vector in_shape() const override { return {shape_}; } 27 | std::vector out_shape() const override { return {shape_}; } 28 | std::string layer_type() const override { return "input"; } 29 | 30 | void forward_propagation(const std::vector &in_data, 31 | std::vector &out_data) override { 32 | *out_data[0] = *in_data[0]; 33 | } 34 | 35 | void back_propagation(const std::vector &in_data, 36 | const std::vector &out_data, 37 | std::vector &out_grad, 38 | std::vector &in_grad) override { 39 | // do nothing 40 | CNN_UNREFERENCED_PARAMETER(in_data); 41 | CNN_UNREFERENCED_PARAMETER(out_data); 42 | CNN_UNREFERENCED_PARAMETER(out_grad); 43 | CNN_UNREFERENCED_PARAMETER(in_grad); 44 | } 45 | 46 | friend struct serialization_buddy; 47 | 48 | private: 49 | shape3d shape_; 50 | }; 51 | 52 | } // namespace tiny_dnn 53 | -------------------------------------------------------------------------------- /tiny_dnn/layers/layers.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | #include "tiny_dnn/layers/arithmetic_layer.h" 10 | #include "tiny_dnn/layers/average_pooling_layer.h" 11 | #include "tiny_dnn/layers/average_unpooling_layer.h" 12 | #include "tiny_dnn/layers/batch_normalization_layer.h" 13 | #include "tiny_dnn/layers/concat_layer.h" 14 | #include "tiny_dnn/layers/convolutional_layer.h" 15 | #include "tiny_dnn/layers/deconvolutional_layer.h" 16 | #include "tiny_dnn/layers/dropout_layer.h" 17 | #include "tiny_dnn/layers/fully_connected_layer.h" 18 | #include "tiny_dnn/layers/global_average_pooling_layer.h" 19 | #include "tiny_dnn/layers/l2_normalization_layer.h" 20 | #include "tiny_dnn/layers/layer.h" 21 | #include "tiny_dnn/layers/linear_layer.h" 22 | #include "tiny_dnn/layers/lrn_layer.h" 23 | #include "tiny_dnn/layers/max_pooling_layer.h" 24 | #include "tiny_dnn/layers/max_unpooling_layer.h" 25 | #include "tiny_dnn/layers/zero_pad_layer.h" 26 | #include "tiny_dnn/layers/partial_connected_layer.h" 27 | #include "tiny_dnn/layers/power_layer.h" 28 | #include "tiny_dnn/layers/quantized_convolutional_layer.h" 29 | #include "tiny_dnn/layers/quantized_deconvolutional_layer.h" 30 | #include "tiny_dnn/layers/quantized_fully_connected_layer.h" 31 | #include "tiny_dnn/layers/recurrent_layer.h" 32 | #include "tiny_dnn/layers/slice_layer.h" 33 | -------------------------------------------------------------------------------- /tiny_dnn/models/alexnet.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace models { 13 | 14 | // Based on: 15 | // https://github.com/DeepMark/deepmark/blob/master/torch/image%2Bvideo/alexnet.lua 16 | class alexnet : public tiny_dnn::network { 17 | public: 18 | explicit alexnet(const std::string &name = "") 19 | : tiny_dnn::network(name) { 20 | // todo: (karandesai) shift this to tiny_dnn::activation 21 | using relu = tiny_dnn::activation::relu; 22 | using conv = tiny_dnn::layers::conv; 23 | using max_pool = tiny_dnn::layers::max_pool; 24 | *this << conv(224, 224, 11, 11, 3, 64, padding::valid, true, 4, 4); 25 | *this << relu(54, 54, 64); 26 | *this << max_pool(54, 54, 64, 2); 27 | *this << conv(27, 27, 5, 5, 64, 192, padding::valid, true, 1, 1); 28 | *this << relu(23, 23, 192); 29 | *this << max_pool(23, 23, 192, 1); 30 | *this << conv(23, 23, 3, 3, 192, 384, padding::valid, true, 1, 1); 31 | *this << relu(21, 21, 384); 32 | *this << conv(21, 21, 3, 3, 384, 256, padding::valid, true, 1, 1); 33 | *this << relu(19, 19, 256); 34 | *this << conv(19, 19, 3, 3, 256, 256, padding::valid, true, 1, 1); 35 | *this << relu(17, 17, 256); 36 | *this << max_pool(17, 17, 256, 1); 37 | } 38 | }; 39 | 40 | } // namespace models 41 | -------------------------------------------------------------------------------- /tiny_dnn/util/deform.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include "tiny_dnn/util/util.h" 11 | 12 | namespace tiny_dnn { 13 | 14 | inline vec_t corrupt(vec_t &&in, float_t corruption_level, float_t min_value) { 15 | for (size_t i = 0; i < in.size(); i++) 16 | if (bernoulli(corruption_level)) in[i] = min_value; 17 | return in; 18 | } 19 | 20 | } // namespace tiny_dnn 21 | -------------------------------------------------------------------------------- /tiny_dnn/util/macro.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #define CNN_UNREFERENCED_PARAMETER(x) (void)(x) 11 | 12 | #if defined _WIN32 && !defined(__MINGW32__) 13 | #define CNN_WINDOWS 14 | #endif 15 | 16 | #if defined(_MSC_VER) 17 | #define CNN_MUST_INLINE __forceinline 18 | #elif defined(__GNUC__) || defined(__clang__) || defined(__ICC) 19 | #define CNN_MUST_INLINE __attribute__((always_inline)) inline 20 | #else 21 | #define CNN_MUST_INLINE inline 22 | #endif 23 | -------------------------------------------------------------------------------- /tiny_dnn/util/nn_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Taiga Nomi and the respective contributors 3 | All rights reserved. 4 | 5 | Use of this source code is governed by a BSD-style license that can be found 6 | in the LICENSE file. 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include "tiny_dnn/util/colored_print.h" 13 | 14 | namespace tiny_dnn { 15 | 16 | /** 17 | * error exception class for tiny-dnn 18 | **/ 19 | class nn_error : public std::exception { 20 | public: 21 | explicit nn_error(const std::string &msg) : msg_(msg) {} 22 | const char *what() const throw() override { return msg_.c_str(); } 23 | 24 | private: 25 | std::string msg_; 26 | }; 27 | 28 | /** 29 | * warning class for tiny-dnn (for debug) 30 | **/ 31 | class nn_warn { 32 | public: 33 | explicit nn_warn(const std::string &msg) : msg_(msg) { 34 | #ifdef CNN_USE_STDOUT 35 | coloredPrint(Color::YELLOW, msg_h_ + msg_); 36 | #endif 37 | } 38 | 39 | private: 40 | std::string msg_; 41 | std::string msg_h_ = std::string("[WARNING] "); 42 | }; 43 | 44 | /** 45 | * info class for tiny-dnn (for debug) 46 | **/ 47 | class nn_info { 48 | public: 49 | explicit nn_info(const std::string &msg) : msg_(msg) { 50 | #ifdef CNN_USE_STDOUT 51 | std::cout << msg_h + msg_ << std::endl; 52 | #endif 53 | } 54 | 55 | private: 56 | std::string msg_; 57 | std::string msg_h = std::string("[INFO] "); 58 | }; 59 | 60 | class nn_not_implemented_error : public nn_error { 61 | public: 62 | explicit nn_not_implemented_error(const std::string &msg = "not implemented") 63 | : nn_error(msg) {} 64 | }; 65 | 66 | } // namespace tiny_dnn 67 | -------------------------------------------------------------------------------- /tiny_dnn/xtensor/xoffsetview.hpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (c) 2016, Johan Mabille, Sylvain Corlay and Wolf Vollprecht * 3 | * * 4 | * Distributed under the terms of the BSD 3-Clause License. * 5 | * * 6 | * The full license is in the file LICENSE, distributed with this software. * 7 | ****************************************************************************/ 8 | 9 | #ifndef XOFFSETVIEW_HPP 10 | #define XOFFSETVIEW_HPP 11 | 12 | #include "xtensor/xfunctorview.hpp" 13 | 14 | namespace xt { 15 | namespace detail { 16 | template 17 | struct offset_forwarder { 18 | using value_type = M; 19 | using reference = M&; 20 | using const_reference = const M&; 21 | using pointer = M*; 22 | using const_pointer = const M*; 23 | 24 | template 25 | decltype(auto) operator()(T&& t) const { 26 | return forward_offset(t); 27 | } 28 | }; 29 | } 30 | 31 | template 32 | using xoffsetview = xfunctorview, CT>; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /tiny_dnn/xtensor/xtensor_config.hpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (c) 2016, Johan Mabille, Sylvain Corlay and Wolf Vollprecht * 3 | * * 4 | * Distributed under the terms of the BSD 3-Clause License. * 5 | * * 6 | * The full license is in the file LICENSE, distributed with this software. * 7 | ****************************************************************************/ 8 | 9 | #ifndef XTENSOR_CONFIG_HPP 10 | #define XTENSOR_CONFIG_HPP 11 | 12 | #define XTENSOR_VERSION_MAJOR 0 13 | #define XTENSOR_VERSION_MINOR 11 14 | #define XTENSOR_VERSION_PATCH 3 15 | 16 | // DETECT 3.6 <= clang < 3.8 for compiler bug workaround. 17 | #ifdef __clang__ 18 | #if __clang_major__ == 3 && __clang_minor__ < 8 19 | #define X_OLD_CLANG 20 | #include 21 | #include 22 | #endif 23 | #endif 24 | 25 | #ifndef DEFAULT_DATA_CONTAINER 26 | #define DEFAULT_DATA_CONTAINER(T, A) uvector 27 | #endif 28 | 29 | #ifndef DEFAULT_SHAPE_CONTAINER 30 | #define DEFAULT_SHAPE_CONTAINER(T, EA, SA) \ 31 | std::vector 32 | #endif 33 | 34 | #ifndef DEFAULT_LAYOUT 35 | #define DEFAULT_LAYOUT layout_type::row_major 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /vc/vc14/2653-9246-1821-1976: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/vc/vc14/2653-9246-1821-1976 -------------------------------------------------------------------------------- /vc/vc14/2952-0039-1819-5325: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tom01h/tiny-dnn-fpga/c1e297d9f943046c5e94e010448af9da2624a2e5/vc/vc14/2952-0039-1819-5325 -------------------------------------------------------------------------------- /vc/vc14/tiny_cnn.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiny_cnn", "tiny_cnn.vcxproj", "{C7B38F22-F235-45A5-834A-DE2167849C4C}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiny_cnn_test", "tiny_cnn_test.vcxproj", "{680A21F8-5877-48EA-B313-CE23B12167ED}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Win32 = Debug|Win32 13 | Release|Win32 = Release|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C7B38F22-F235-45A5-834A-DE2167849C4C}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {C7B38F22-F235-45A5-834A-DE2167849C4C}.Debug|Win32.Build.0 = Debug|Win32 18 | {C7B38F22-F235-45A5-834A-DE2167849C4C}.Release|Win32.ActiveCfg = Release|Win32 19 | {C7B38F22-F235-45A5-834A-DE2167849C4C}.Release|Win32.Build.0 = Release|Win32 20 | {680A21F8-5877-48EA-B313-CE23B12167ED}.Debug|Win32.ActiveCfg = DebugTest|Win32 21 | {680A21F8-5877-48EA-B313-CE23B12167ED}.Debug|Win32.Build.0 = DebugTest|Win32 22 | {680A21F8-5877-48EA-B313-CE23B12167ED}.Release|Win32.ActiveCfg = ReleaseTest|Win32 23 | {680A21F8-5877-48EA-B313-CE23B12167ED}.Release|Win32.Build.0 = ReleaseTest|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | --------------------------------------------------------------------------------