-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerceptron.h
More file actions
32 lines (25 loc) · 909 Bytes
/
Copy pathPerceptron.h
File metadata and controls
32 lines (25 loc) · 909 Bytes
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
#pragma once
/*********************Preprocessor Directives********************/
#include<vector>
/*********************Class********************/
class Perceptron
{
private :
float learningRate; //The learning rate for the perceptron
float threshold; //The threshold for the perceptrons output
std::vector<float> weights; //The weights to the perceptron
void BackPropogate(const std::vector<float>& inputs, bool guess, bool expectedOutput);/*
Adjusts the weights*/
public:
//Constructors And Destructors
Perceptron();
Perceptron(short numberOfInputs, float threshold);
~Perceptron();
//Access Methods
short NumberOfInputs() const; //Returns the number of inputs the perceptron has
//Methods
bool Train(const std::vector<float>& input, bool expectedOutput);
bool Output(const std::vector<float>& input);
//Operators
void operator =(const Perceptron& p);
};