21 for (
int i = 0;
i <
arity[
'f'];
i++) {
33 ArrayXf x = state.
pop<
float>();
34 ArrayXf res = (
W[0] * x > 0).select(
W[0]*x, ArrayXf::Zero(x.size())+0.01);
35 state.
push<
float>(res);
54 ArrayXf& x = state.
get<
float>()[state.
size<
float>()-1];
58 return (x>0).select(x,ArrayXf::Zero(x.size())+0.01);
61 return (x>0).select(
W[0],ArrayXf::Zero(x.size())+0.01);
data holding X, y, and Z data
ArrayXf getDerivative(Trace &state, int loc)
void eval_eqn(State &state)
Evaluates the node symbolically.
NodeRelu * clone_impl() const override
void evaluate(const Data &data, State &state)
Evaluates the node and updates the state states.
NodeRelu(vector< float > W0=vector< float >())
NodeRelu * rnd_clone_impl() const override
std::map< char, unsigned int > arity
arity of the operator
int complexity
complexity of node
float rnd_dbl(float min=0.0, float max=1.0)
void GPU_Relu(float *x, size_t idx, size_t N, float W0)
std::string to_string(const T &value)
template function to convert objects to string for logging
contains various types of State actually used by feat
Eigen::Array< T, Eigen::Dynamic, 1 > pop()
void push(Eigen::Array< T, Eigen::Dynamic, 1 > value)
used for tracing stack outputs for backprop algorithm.
vector< Eigen::Array< T, Eigen::Dynamic, 1 > > & get()