Skip to content

Commit

Permalink
fixed input layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Dpbm committed Jan 28, 2024
1 parent 0ba5537 commit 2ec7e76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions machine/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
using Matrices::Matrix;

namespace Layers {
unsigned int width, height;
unsigned int size;
Matrix *values;

InputLayer::InputLayer(unsigned int width, unsigned int height){
this->width = width;
this->height = height;
InputLayer::InputLayer(unsigned int size){
this->size = size;
}

void InputLayer::set_node_values(Matrix *values){
if(values->get_width() != this->width || values->get_height() != this->height)
if(values->get_width() != 1 || values->get_height() != this->size)
throw std::invalid_argument("Invalid values dimensions!");

this->values = values;
Expand Down
4 changes: 2 additions & 2 deletions machine/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ namespace Layers{

class InputLayer: Layer{
public:
InputLayer(unsigned int width, unsigned int height);
InputLayer(unsigned int size);
void set_node_values(Matrix *values);
~InputLayer();
private:
unsigned int width, height;
unsigned int size;
Matrix *values;
};

Expand Down

0 comments on commit 2ec7e76

Please sign in to comment.