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

remove frame inspection on self.hparams #2253

Merged
merged 6 commits into from Jun 19, 2020
Merged

remove frame inspection on self.hparams #2253

merged 6 commits into from Jun 19, 2020

Conversation

williamFalcon
Copy link
Contributor

@williamFalcon williamFalcon commented Jun 19, 2020

Fixes #2250
Fixes #2188

@mergify mergify bot requested a review from a team June 19, 2020 01:44
@pep8speaks
Copy link

pep8speaks commented Jun 19, 2020

Hello @williamFalcon! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-06-19 02:36:49 UTC

@williamFalcon williamFalcon merged commit 6ae9a97 into master Jun 19, 2020
@Borda Borda added bug Something isn't working priority: 0 High priority task labels Jun 19, 2020
@Borda Borda added this to the 0.8.x milestone Jun 19, 2020
@Borda Borda deleted the frame branch June 19, 2020 05:46
lines = class_code.split('\n')
for line in lines:
line = re.sub(r"\s+", "", line, flags=re.UNICODE)
if 'self.hparams=' in line:
Copy link
Member

@Borda Borda Jun 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a naive hack assuming user uses standard naming, it will fail on

class AAA(...):
    def __init__(me, param1, ...):
         me.hparams = param1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope... 'hparams' is a fallback... try it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the point is with rename self to me or what ever

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also what about spacing

self.hparams                <50x spaces> = param1

or rename the vasiable

class AAA():
  def __init__(me, param1):
    copy_param = copy.deepcopy(param1)
    me.hparams = copy_param

@mergify mergify bot requested a review from a team June 19, 2020 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: 0 High priority task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dataframes passed outside hparams causing issues [hparams] save_hyperparameters doesn't save kwargs
3 participants