Skip to content

Conversation

@williamberman
Copy link
Contributor

@williamberman williamberman commented Apr 4, 2023

reported in slack by @kashif. When using same number of inference steps as training steps, We're using np.linspace with number of samples greater than the stop - start. This leads to duplicates

>>> np.linspace(0, 99, 101)
array([ 0.  ,  0.99,  1.98,  2.97,  3.96,  4.95,  5.94,  6.93,  7.92,
        8.91,  9.9 , 10.89, 11.88, 12.87, 13.86, 14.85, 15.84, 16.83,
       17.82, 18.81, 19.8 , 20.79, 21.78, 22.77, 23.76, 24.75, 25.74,
       26.73, 27.72, 28.71, 29.7 , 30.69, 31.68, 32.67, 33.66, 34.65,
       35.64, 36.63, 37.62, 38.61, 39.6 , 40.59, 41.58, 42.57, 43.56,
       44.55, 45.54, 46.53, 47.52, 48.51, 49.5 , 50.49, 51.48, 52.47,
       53.46, 54.45, 55.44, 56.43, 57.42, 58.41, 59.4 , 60.39, 61.38,
       62.37, 63.36, 64.35, 65.34, 66.33, 67.32, 68.31, 69.3 , 70.29,
       71.28, 72.27, 73.26, 74.25, 75.24, 76.23, 77.22, 78.21, 79.2 ,
       80.19, 81.18, 82.17, 83.16, 84.15, 85.14, 86.13, 87.12, 88.11,
       89.1 , 90.09, 91.08, 92.07, 93.06, 94.05, 95.04, 96.03, 97.02,
       98.01, 99.  ])

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 4, 2023

The documentation is not available anymore as the PR was closed or merged.

@williamberman williamberman force-pushed the dpm_multistep_solver_dup_timesteps branch from fd68368 to 0ee3350 Compare April 4, 2023 16:37
@kashif
Copy link
Contributor

kashif commented Apr 4, 2023

awesome! having a look!

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Clean <3

Let's maybe also add a small test?

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Cool fix

@patrickvonplaten
Copy link
Contributor

Agree that adding a short test would be nice

@kashif
Copy link
Contributor

kashif commented Apr 7, 2023

added tests and fixes to a few other schedulers here: williamberman#1

@williamberman
Copy link
Contributor Author

Thanks! @kashif I made a tweak to the commit by

  1. Added a copied from statement for one of the scheduler changes so we didn't have to write an extra tests
  2. Changed the num_inference_steps to the number on the scheduler (it was always 1000 any way but better safe)
  3. removed the check on if the scheduler had the set_timesteps method

@williamberman williamberman force-pushed the dpm_multistep_solver_dup_timesteps branch from a106257 to e50594e Compare April 10, 2023 05:45
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

Successfully merging this pull request may close these issues.

6 participants