-
Notifications
You must be signed in to change notification settings - Fork 1
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
module standardization #32
Conversation
I will convert it to not a draft after testing the requirements on linux/amd |
tested the build and the module on linux/amd |
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.
nice job with the edits, just a question about a name -- if it's a breaking change to change the name of the distance function, then we shouldn't do it.
src/distance.py
Outdated
|
||
def euclidean_distance(t1, t2): | ||
""" | ||
Computes the Euclidean distance between two tensors using the L1 norm. |
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.
Euclidean usually means the L2 norm, not L1 -- the L1 norm is colloquially called the "manhattan" or "taxicab" norm
src/models/utils.py
Outdated
""" | ||
if distance_metric == "euclidean": | ||
return 1.1 | ||
if distance_metric == "euclidean_l2": | ||
return 1.1 | ||
elif distance_metric == "cosine": | ||
if distance_metric == "cosine": |
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.
Not sure if it's a breaking change to change the name from euclidean to another name to make it more clear that it is the L1 norm, but if it isn't a breaking change, I would save change the name to "l1_norm" or something similar
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.
Almost done, I think you just need to eliminate some of the ignored pylint codes, and then it should be good
Makefile
Outdated
python3 -m pytest tests/* | ||
|
||
lint: | ||
python3 -m pylint src --disable=W0719,C0114,W0201,W1203,E1101,W1203,E0611,R0902,R0913,E0611,E0001,R0914,R0903 |
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.
C0114: Missing module docstring
W0201: Attribute defined outside init
W1203: Use % formatting in logging functions and pass the % parameters as arguments
E1101: Instance of 'x' has no 'y' member
E0611: No name 'x' in module 'y'
E0001: Syntax error
R0801: Similar lines in 'x' files
Remove these from the disable string, and if you do need to disable them, put the ignore right next to the code where you need it
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.
LGTM!
No description provided.