<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r66130281">src/mlpack/methods/ne/genome.hpp</a>:</p>
<pre style='color:#555'>> +
> + // Loop neurons to calculate neurons' activation.
> + for (unsigned in j=aNumInput; j<aNeuronGenes.size(); ++j) {
> + double x = aNeuronGenes[j].aInput; // TODO: consider bias. Difference?
> + aNeuronGenes[j].aInput = 0;
> +
> + double y = 0;
> + switch (aNeuronGenes[j].Type()) { // TODO: revise the implementation.
> + case SIGMOID: // TODO: more cases.
> + y = sigmoid(x);
> + break;
> + case RELU:
> + y = relu(x);
> + break;
> + default:
> + y = sigmoid(x);
</pre>
<p>maybe using same strategies used in sigmoid function in <a href="https://github.com/mlpack/mlpack/blob/637809fec8d341829e4cd122cf5a385e5e219c9b/src/mlpack/methods/sparse_autoencoder/sparse_autoencoder_function.hpp#L74">sparse_autoencoder</a> is faster?</p>
<p>Unrelated to this, I think activation functions like relu, sigmoid , etc are implemented many times. I think we can put it in core?<br>
It is also implemented in <a href="https://github.com/mlpack/mlpack/blob/d2e353468b8fce9fc1ee46799860f3860c4c8db9/src/mlpack/methods/ann/layer/base_layer.hpp">artificial neural net</a></p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/686/files/3c8aa62b951f029b3883e9baef1ea556ef5af2d3#r66130281">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFIVzVzUwuQ71Whw0weDHY3N8Ax1fks5qJb0ogaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFIsdnquamnHBhKxjW-YXgHdZDh2Cks5qJb0ogaJpZM4IwJa6.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/686/files/3c8aa62b951f029b3883e9baef1ea556ef5af2d3#r66130281"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>