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

Support simple loops #3

Open
dfdx opened this issue Jan 23, 2017 · 0 comments
Open

Support simple loops #3

dfdx opened this issue Jan 23, 2017 · 0 comments

Comments

@dfdx
Copy link
Owner

dfdx commented Jan 23, 2017

Although preferred way to express iteration is through aggregation functions, we may still encounter loops in 3rd party code and it would be nice to support at least simple ones. One particular example is:

y = 0.0
for x in xs
    y += f(x)
end

We have 2 options here:

  1. Preprocess loops transforming them into aggregation functions. E.g. loop above may be transformed into sum(f.(x)).
  2. Translate a derivative of a loop into a loop of derivatives. This is more general-purpose, but looks also much harder to implement.
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

No branches or pull requests

1 participant