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

a couple of weird statements in new multihead fine-tuning interface code #408

Open
bernstei opened this issue May 5, 2024 · 2 comments
Open

Comments

@bernstei
Copy link
Collaborator

bernstei commented May 5, 2024

What is line line supposed to be doing?

heads = list(dict.fromkeys(["pbe_mp"] + heads))

Why are these keys taken from the user's settings, rather than a default (plain?) property name, or just ignored?

virials_key=args.virials_key,

@ilyes319
Copy link
Contributor

ilyes319 commented May 6, 2024

First statement is for removing duplicate heads, transforming ["pbe_mp", "pbe_mp", "r2scan"] to ["pbe_mp", "r2scan"].
Second line, we should remove.

@bernstei
Copy link
Collaborator Author

bernstei commented May 6, 2024

First statement is for removing duplicate heads, transforming ["pbe_mp", "pbe_mp", "r2scan"] to ["pbe_mp", "r2scan"].

if we know that heads starts out as a list, list(set(["pbe_mp"] + heads)) is cleaner in my opinion. But if we care about the order, I'm not sure what set() guarantees. But also, if we care about the order, I think something more explicit is better anyway (e.g. ["pbe_mp"] + list(set(heads) - set(["pbe_mp"])). What exactly are the requirements of the result of this statement?

[edit] Or, maybe cleaner to just do

if "pbe_mp" not in heads:
    heads = ["pbe_mp"] + heads

or heads.insert("pbe_mp", 0), if we want to modify the existing object

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