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

Using Polaris.Optimizers as docs suggest causes error #12

Open
shaqq opened this issue Apr 3, 2024 · 1 comment
Open

Using Polaris.Optimizers as docs suggest causes error #12

shaqq opened this issue Apr 3, 2024 · 1 comment

Comments

@shaqq
Copy link

shaqq commented Apr 3, 2024

Most docs suggest using this library like so:

Polaris.Optimizers.adam(0.005)

However, this causes an error, because the args expect a keyword list

** (FunctionClauseError) no function clause matching in Keyword.pop/3    
    
    The following arguments were given to Keyword.pop/3:
    
        # 1
        0.005
    
        # 2
        :learning_rate
    
        # 3
        0.001
    
    Attempted function clauses (showing 1 out of 1):
    
        def pop(keywords, key, default) when is_list(keywords) and is_atom(key)
    
    (elixir 1.15.7) lib/keyword.ex:1289: Keyword.pop/3
    (polaris 0.1.0) lib/polaris/optimizers.ex:109: Polaris.Optimizers.adam/1

Looks like this was intentional: 228f829

So this is an issue to update the docs 😄

@josevalim
Copy link
Contributor

Please send a PR :)

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

2 participants