[mlpack-git] [mlpack/mlpack] NeuralEvolution - implemented gene, genome (#686)

Marcus Edel notifications at github.com
Mon Jul 11 09:39:56 EDT 2016


> +      double theta_dot = mlpack::math::Random(-1.5, 1.5);
> +
> +      for (ssize_t step=0; step<num_step; ++step) {
> +        // Convert input into range [0, 1]
> +        std::vector<double> inputs = {(x + 2.4) / 4.8,
> +                                      (x_dot + 0.75) / 1.5,  // ??
> +                                      (theta + theta_limit) / 0.41,
> +                                      (theta_dot + 1.0) / 2.0,
> +                                      1};  // TODO: use arma::mat for input.
> +        genome.Activate(inputs);
> +        std::vector<double> output;
> +        genome.Output(output);
> +
> +        double action = output[0];
> +        if (output[0] < 0.5) {
> +          action = -1;

Action should be the index of the neuron with highest probability. If we just use one neuron it's 0 or 1.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/686/files/1fe7d730fd88cbaf7019e8936face4c6ddcb0577..ff45785b8669f82beb38ef5392f48bcdf5c83f6a#r70258429
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160711/6305e477/attachment.html>


More information about the mlpack-git mailing list