Skip to content

Commit

Permalink
clean up some paragraph.
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Jun 21, 2024
1 parent d0bf550 commit e566a3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content/blog/learning-machine-learning-in-elixir.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ defmodule LinearRegression do
end
```

In elixir you can use for loops and `Enum.reduce` as well. However if you want to live in `defn` land an experience all the benefits of JIT compilation you'll have to use the `while` loop from elixir's Nx library. You can also get extra benefit by adding `unroll: true`. It will actually unroll your while loop as if you wrote out every iteration by hand. Be careful with unroll though, if you have a lot of iterations in your `range` like 10,000 using `unroll: true` can be a disaster 🧨😅. Believe be I've tried. Using something like `unroll: 2` would be more wise.
In elixir you can use for loops and `Enum.reduce` as well. However if you want to live in `defn` land an experience all the benefits of JIT compilation you'll have to use the `while` loop from elixir's Nx library. You can also get extra benefit by adding `unroll: true`. It will actually unroll your while loop as if you wrote out every iteration by hand. Be careful with unroll though, if you have a lot of iterations in your `range` like 10,000 using `unroll: true` can be a disaster 🧨😅. Using something like `unroll: 2` would be more wise.

## Axon

Expand Down

0 comments on commit e566a3d

Please sign in to comment.