Sync public subset from Flux (private)
This commit is contained in:
28
include/modules/neural_networks/activation_functions/ReLU.h
Normal file
28
include/modules/neural_networks/activation_functions/ReLU.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "./core/omp_config.h"
|
||||
|
||||
#include "./utils/vector.h"
|
||||
#include "./utils/matrix.h"
|
||||
#include "./utils/random.h"
|
||||
|
||||
|
||||
namespace neural_networks{
|
||||
|
||||
template <typename T>
|
||||
struct activation_ReLU{
|
||||
|
||||
utils::Matrix<T> outputs;
|
||||
|
||||
void forward(utils::Matrix<T> inputs){
|
||||
outputs = numerics::max(inputs, T{0});
|
||||
//outputs.print();
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // end namespace neural_networks
|
||||
Reference in New Issue
Block a user