-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhidden_layer.h
More file actions
34 lines (25 loc) · 855 Bytes
/
hidden_layer.h
File metadata and controls
34 lines (25 loc) · 855 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
33
34
//
// Created by Izzat on 11/24/2023.
//
#ifndef FRUIT_CLASSIFIER_WASM_HIDDEN_LAYER_H
#define FRUIT_CLASSIFIER_WASM_HIDDEN_LAYER_H
#include "nn.h"
#include "layer.h"
#include <vector>
class nn::HiddenLayer : public nn::Layer {
private:
act::Function function;
friend class Layer;
public:
/**
* Constructor for the HiddenLayer class that initializes the layer with a given core layer
* and an activation function.
*
* @param neurons The neurons of the layer.
* @param function An activation function to be used for the neurons.
*/
explicit HiddenLayer(vn_t neurons, act::Function function);
[[nodiscard]] vd_t activate(const vd_t &inputs) const override;
[[nodiscard]] vd_t calculateGradients(const vd_t &intermediateGradients) const override;
};
#endif //FRUIT_CLASSIFIER_WASM_HIDDEN_LAYER_H