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

Return loss values as float values not PyTorch objects #332

Closed
srinify opened this issue Feb 23, 2024 · 0 comments · Fixed by #337
Closed

Return loss values as float values not PyTorch objects #332

srinify opened this issue Feb 23, 2024 · 0 comments · Fixed by #337
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@srinify
Copy link

srinify commented Feb 23, 2024

Duplicate of sdv-dev/SDV#1811, close both at same time.

Problem Description

After fitting a model, calling loss_values returns a DataFrame object where the loss values are PyTorch tensor objects instead of just simple float values.

Screenshot 2024-02-22 at 4 20 36 PM

This means that plotting these values requires an extra step of extracting the values using apply(), which adds unnecessary friction I feel.

Screenshot 2024-02-22 at 4 58 56 PM

Expected behavior

Ideally the returned DataFrame just had float values for Generator & Discriminator loss values. This lowers the friction for plotting the loss values:

loss_df = ctgan.loss_values
loss_df.plot(x='Epoch', y=['Generator Loss', 'Discriminator Loss'])

Additional context

Relevant code is here:

https://github.com/sdv-dev/CTGAN/blob/main/ctgan/synthesizers/ctgan.py#L426

@srinify srinify added new Label applied to new issues feature request Request for a new feature labels Feb 23, 2024
@srinify srinify changed the title Return loss values as float values not torch objects Return loss values as float values not PyTorch objects Feb 23, 2024
@npatki npatki removed the new Label applied to new issues label Feb 26, 2024
@amontanez24 amontanez24 added this to the 0.10.0 milestone Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants