Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved: Consistent return with train and evolve methods #40

Open
dan-ryan opened this issue Apr 28, 2019 · 0 comments
Open

Moved: Consistent return with train and evolve methods #40

dan-ryan opened this issue Apr 28, 2019 · 0 comments
Labels
🙌 community By or for the library's community 💬 discussion Open for Socratic debate ✨ enhancement Something could be better

Comments

@dan-ryan
Copy link

dan-ryan commented Apr 28, 2019

This issue has been moved from Neataptic.
wagenaartje/neataptic#78

If i run network.evolve the function return a promise with the result, but if i run network.train i get a result.

Shouldnt they be consistent? shouldnt both of them return a promise?

Owner's reply:

That is because network.evolve is an async function and network.train is a sync function. There is not a lot I can do about it, except for creating two seperate functions for network.evolve, e.g.:

network.evolveSync();
network.evolve()

But network.evolveSync wouldn't be able to use multithreading capabilities then. However, it seems a good idea to add a network.trainAsync() function.

Personally, I think every long task should be async by default and there should be a "sync" method for each one.

@christianechevarria christianechevarria added ✨ enhancement Something could be better 💬 discussion Open for Socratic debate 🙌 community By or for the library's community labels May 1, 2019
@luiscarbonell luiscarbonell added this to Awesome in Feature Requests Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙌 community By or for the library's community 💬 discussion Open for Socratic debate ✨ enhancement Something could be better
Projects
Feature Requests
  
Awesome
Development

No branches or pull requests

2 participants