jacobian

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit d614ecec9e0211f28ebcf1d2f157ab5a05da6a45
parent 8d604d6875950bb70bc9b7b5f8b05951a279a342
Author: David Freifeld <freifeld.david@gmail.com>
Date:   Sun,  8 Nov 2020 21:52:44 -0800

Fixed CNN errors until it compiled

Diffstat:
Msrc/bpnn.hpp | 4+++-
Msrc/cnn.cpp | 2+-
Msrc/cnn.hpp | 4+++-
3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/bpnn.hpp b/src/bpnn.hpp @@ -44,9 +44,10 @@ public: }; class Network { - int instances; char buf[BUFFER_SIZE]; char* p; +protected: + int instances; float epoch_acc; float epoch_cost; float val_acc; @@ -118,6 +119,7 @@ struct ValueError : public std::exception }; void prep(char* rname, char* wname); void compress(char* rname, char* wname); +Eigen::MatrixXf l1_deriv(Eigen::MatrixXf m); #define MAXLINE 1024 diff --git a/src/cnn.cpp b/src/cnn.cpp @@ -163,7 +163,7 @@ void PoolingLayer::pool() } } -ConvNet::ConvNet(char* path, float learn_rate, float bias_rate, int reg, Regularization l, float ratio) +ConvNet::ConvNet(char* path, float learn_rate, float bias_rate, Regularization reg, float l, float ratio) : Network(path, 1, learn_rate, bias_rate, reg, l, ratio), preprocess_length{0} { ReadMNIST(10000,784,data); diff --git a/src/cnn.hpp b/src/cnn.hpp @@ -1,6 +1,8 @@ #ifndef CNN_H #define CNN_H +#include <fstream> + class ConvLayer { public: @@ -39,7 +41,7 @@ public: std::vector<ConvLayer> conv_layers; std::vector<PoolingLayer> pool_layers; - ConvNet(char* path, float learn_rate, float bias_rate, int reg, float l, float ratio); + ConvNet(char* path, float learn_rate, float bias_rate, Regularization reg, float l, float ratio); void list_net(); void process(); // Runs the convolutional and pooling layers. void next_batch();