-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayer.h
57 lines (47 loc) · 1.34 KB
/
layer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* layer.h
*
* Version information
* Author: Conall Hanley
* Date:22/01/2020
* Description: This file is the header file for the layer class and declares the class interface.
*
* Copyright notice -
*/
#pragma once
#include <vector>
#include <iostream>
#include "neuron.h"
class layer
{
private:
std::vector<neuron>* neurons_ = nullptr;
double sensetivity;
double rate;
double cost_;
const double* euler_;
public:
layer();//default constructor ;No initialazation for euler constant pointer
layer(const double* euler);
layer(std::vector<double> inputs, const double* euler); //constructor for base layer
~layer(); //destructor
std::vector<neuron>* getneurons() const;
void addneuron(neuron n);
void removeneuron(int number);
void setnuerons(std::vector<neuron> inputs);
//neuron getneuron(int number);
long getsize();
std::vector<double> getactivations();
std::vector<double> getweights();
void conntectneurons(layer l);
double getcost() const;
void feedforward(layer prev);
void caluclatecost(layer correct);
double getsensitivity() const;
void setsensitivity(double sense);
void calculatesensitivity(layer& lastgen);
void init_vector();
void delete_vector();
void nudge();
void copyweights(layer copyfrom, int nextlayersize);
};