Skip to content

Implementation Guides

beru edited this page Apr 4, 2017 · 3 revisions

(unfinished)

Design Principle

  • Keep header only
  • Minimize dependencies to other libraries
  • Keep portable

If some enhancement (gpu supporting, importing other dl library's model, reading/writing db...) requires other libraries or .cpp files, it should be provided as opt-in model. In other words, default configuration of tiny-cnn must not depend on other libraries.

Coding Rules

  • Conform to C++11 standard

    • tiny-cnn should be compiled with -Wall -Wextra -Wpedantic -Werror
  • First-class Windows support

    • To support Visual Studio compiler, tiny-cnn can't use some of C99 and C++11 features which Visual Studio 2013 doesn't support.(for example, noexcept, constexpr, Inheriting constructors) For more detail, read this article:Support For C++11/14/17 Features (Modern C++)
  • use SCREAMING_SNAKE_CASE with prefix CNN_ for macro name

  • use snake_case for other names

  • throw nn_error or subclass of nn_error in error

  • don't catch any exceptions in tiny-cnn for the sake of exception disabled environment

    • see discussion in #92 for detail
  • use 2 spaces instead of tabs