Skip to content

Added initial support for Layers #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions bnn/nn/activations.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#ifndef BNN_BNN_NN_ACTIVATIONS_HPP
#define BNN_BNN_NN_ACTIVATIONS_HPP

#include <bnn/utils/utils.hpp>
#include <bnn/operations/operators.hpp>

namespace bnn
{
namespace nn
{

using namespace bnn::utils;
using namespace bnn::operators;

template <class data_type>
class Activation: public BNNBase
{

protected:

std::string name;

Operator<data_type>* input;

Operator<data_type>* output;

public:

Activation
(std::string _name);

virtual
void
implementation
();

virtual
TensorCPU<data_type>*
get_input_value
();

virtual
TensorCPU<data_type>*
get_output_value
();

virtual
~Activation
();

};

}
}

#endif
69 changes: 69 additions & 0 deletions bnn/nn/layers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#ifndef BNN_BNN_NN_LAYERS_HPP
#define BNN_BNN_NN_LAYERS_HPP

#include <bnn/utils/utils.hpp>
#include <bnn/core/tensor.hpp>
#include <bnn/operations/operators.hpp>
#include <string>

namespace bnn
{
namespace nn
{

using namespace bnn::utils;
using namespace bnn::core;
using namespace bnn::operators;

template <class data_type>
class Layer: public BNNBase
{

protected:

std::string name;

Operator<data_type>* input;

Operator<data_type>* output;

public:

Layer
(std::string _name);

virtual
void
initialize_parameters
(void (*initializer)(Operator<data_type>* parameters));

virtual
void
implementation
();

virtual
Operator<data_type>*
get_parameters
();

virtual
TensorCPU<data_type>*
get_input_value
();

virtual
TensorCPU<data_type>*
get_output_value
();

virtual
~Layer
();

};

}
}

#endif
Empty file added bnn/nn/layers_impl.hpp
Empty file.
1 change: 0 additions & 1 deletion bnn/operations/operators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define BNN_BNN_OPERATIONS_OPERATORS_HPP

#include <string>
#include <unordered_map>
#include <bnn/core/tensor.hpp>
#include <bnn/utils/utils.hpp>

Expand Down
Empty file.
Empty file added bnn/templates/nn/layers.hpp
Empty file.