-
Notifications
You must be signed in to change notification settings - Fork 629
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
Embedding doc #424
Embedding doc #424
Conversation
… documentations. Update loading animation
visualdl/python/storage.py
Outdated
@@ -292,9 +295,19 @@ def text(self, tag): | |||
return self.writer.new_text(tag) | |||
|
|||
def embedding(self): | |||
""" | |||
Create an embedding writer that used to write |
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.
is used to
visualdl/python/storage.py
Outdated
Create an embedding writer that used to write | ||
embedding data. | ||
|
||
:return: A embedding writer to record embedding data |
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.
An embedding
visualdl/server/lib.py
Outdated
@@ -393,3 +392,23 @@ def _handler(key, func, *args, **kwargs): | |||
return data | |||
|
|||
return _handler | |||
|
|||
|
|||
# A simple PCA implementaiton to do the dimension reduction. |
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.
Normally we comment methods like this:
def kos_root():
"""Return the pathname of the KOS root directory."""
global _kos_root
if _kos_root: return _kos_root
...
cov = np.cov(x, rowvar=False) | ||
|
||
# Get eigenvectors and eigenvalues from the covariance matrix | ||
eigvals, eigvecs = np.linalg.eig(cov) |
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.
What a math guy, Jeff! But do we need to do it ourselves? Moreover, SVD is more stable than eigenvector in terms of computing principle components.
Check here
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.
The reason behind it so we don't have to import another pip package to do the calculation.
And actually the TSNE file already has a clean PCA implementation. and I could just use that.
@@ -0,0 +1,184 @@ | |||
# |
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.
We should give the original author a citation 😀
https://github.com/bhauman/neurpy/blob/master/tsne.py
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.
I did give the author credit, I left my comments under the author's comments.
Reveal the high dimensional tab
Add function documentation
Improve loading animation algorithm
Use the in-house PCA function
Use the free T-SNE function
Resolve #407