-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add spiral target shape #192
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #192 +/- ##
=======================================
Coverage 98.42% 98.42%
=======================================
Files 43 43
Lines 1775 1782 +7
Branches 358 357 -1
=======================================
+ Hits 1747 1754 +7
Misses 25 25
Partials 3 3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks incredible on the soccer dataset – thanks @nickc6424! A few small things to address here.
Notes | ||
----- | ||
The formula for a spiral can be found here: | ||
https://en.wikipedia.org/wiki/Archimedean_spiral |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you!
# Number of rotations | ||
num_rotations = 3 | ||
|
||
t = np.linspace(0, 1, num=200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment for this one too?
x = (t * radius) * np.cos(2 * num_rotations * math.pi * t) + cx | ||
y = (t * radius) * np.sin(2 * num_rotations * math.pi * t) + cy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x = (t * radius) * np.cos(2 * num_rotations * math.pi * t) + cx | ||
y = (t * radius) * np.sin(2 * num_rotations * math.pi * t) + cy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x = (t * radius) * np.cos(2 * num_rotations * math.pi * t) + cx | |
y = (t * radius) * np.sin(2 * num_rotations * math.pi * t) + cy | |
x = (t * radius) * np.cos(2 * num_rotations * np.pi * t) + cx | |
y = (t * radius) * np.sin(2 * num_rotations * np.pi * t) + cy |
@@ -1,6 +1,7 @@ | |||
"""Shapes that are composed of points.""" | |||
|
|||
import itertools | |||
import math |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's stick with numpy for this.
import math |
Class for the spiral shape. | ||
|
||
.. plot:: | ||
:scale: 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep all the plots the same size:
:scale: 100 | |
:scale: 75 |
# Number of rotations | ||
num_rotations = 3 | ||
|
||
t = np.linspace(0, 1, num=200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two other thoughts here:
- Can we use fewer points? This would speed up the distance calculations.
- The points are farther apart as the spiral grows. Can we reduce the density at the center and fill in the outer parts better?
Fixes #177
Describe your changes
Added Spiral target shape
Checklist