Skip to content

Conversation

jetfuel
Copy link
Collaborator

@jetfuel jetfuel commented Apr 25, 2018

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

@jetfuel jetfuel self-assigned this Apr 25, 2018
nickyfantasy
nickyfantasy previously approved these changes Apr 25, 2018

def embedding(self):
"""
Create an embedding writer that used to write
Copy link
Collaborator

Choose a reason for hiding this comment

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

is used to

Create an embedding writer that used to write
embedding data.
:return: A embedding writer to record embedding data
Copy link
Collaborator

Choose a reason for hiding this comment

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

An embedding

return _handler


# A simple PCA implementaiton to do the dimension reduction.
Copy link
Collaborator

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)
Copy link
Collaborator

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

Copy link
Collaborator Author

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 @@
#
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

daming-lu
daming-lu previously approved these changes Apr 25, 2018
@jetfuel jetfuel dismissed stale reviews from daming-lu and nickyfantasy via ad121f3 April 26, 2018 00:04
@jetfuel jetfuel merged commit 2642aab into PaddlePaddle:develop Apr 26, 2018
@jetfuel jetfuel deleted the embeddingDoc branch April 26, 2018 00:25
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.

3 participants