Skip to content

Conversation

mustajarvi
Copy link

Made three different optimizations:

  1. Micro optimizations of array reference access. Such optimizations should be used sparingly of course, but this loop seemed to be one of those places.
  2. I noticed that the number of worker threads were set using the number of processors + 1 rule. In this case I think it's more fitting to set the number of threads to being equal to the number of CPU:s since we can avoid some context switches that way and keep the data in the CPU caches longer.
  3. Replaced Math.tanh() with FastMath.tanh() from Apache Commons. This added a new dependency, but since it's quite possible it's useful in other places this shouldn't be so bad.

@jeffheaton
Copy link
Owner

Thankyou very much. I will take a look.

jeffheaton added a commit that referenced this pull request Dec 31, 2013
@jeffheaton
Copy link
Owner

Thank you for the changes. Finally merged this into Encog.

@jeffheaton jeffheaton closed this Dec 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants