init commit
This commit is contained in:
25
backprop/Utils.cpp
Normal file
25
backprop/Utils.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "Utils.h"
|
||||
#include <math.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
Utils::Utils()
|
||||
{
|
||||
}
|
||||
|
||||
double Utils::sigmoid(const double val)
|
||||
{
|
||||
return tanh(val);
|
||||
}
|
||||
|
||||
double Utils::dsigmoid(const double val)
|
||||
{
|
||||
return (1.0-(val*val));
|
||||
}
|
||||
|
||||
bool Utils::accept(const double val)
|
||||
{
|
||||
if(val>ACCEPT) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user