Comments (3)
Thank you, I will look into this ASAP. Probably we will get the old performance if we use separate loss functions for triplets and quadruplets.
from cblearn.
Hi @Conzel,
thanks for your investigation.
Unfortunately, there were two changes in this commit:
- The default optimization repeats 10-times from random initialization. This should prevent poor results when ending in local minima (especially with 1d/2d embeddings).
- The loss/stress function was generalized for quadruplets.
Change 1 would, in theory, explain x10 slowdown and it would be interesting to see if change 2 explains the other x2 slowdown.
To separate the two changes, could you please rerun your analysis in the current version with soe = SOE(n_components=2, random_state=2, n_init=1)
?
The idea of change 1 was, that "new users" don't end up with poor results. Experienced users can use the n_init
params. What are your thoughts about this design choice?
from cblearn.
Hey @dekuenstle,
sorry, had a typo in the initial message. Should've been 0.02 seconds for the old commit.
I repeated the setup with n_init=1
and a few more triplets (n = 10 000).
Commit | n_init=1 | n_init=10 |
---|---|---|
Pre-SOE-changes | 0.08 | - |
Post-SOE-changes | 1.12 | 11.82 |
Seems that n_init causes the 10x slowdown; but the quadruplet change also causes a ~15x slowdown. Combined its quite a lot.
Increasing n_init
by default on its own seems reasonable, maybe one could add a small note in the docs of SOE 👍
For completions sake, the code snippet, a bit more systematic.
from cblearn.embedding import SOE
from cblearn.datasets import make_random_triplets
import numpy as np
import time
np.random.seed(42)
x = np.random.random((100, 2))
t, r = make_random_triplets(x, "list-boolean", 10000)
soe = SOE(n_components=2, random_state=2, n_init=1) # remove for old commit
times = []
for i in range(5):
start = time.time()
soe.fit_transform(t, r)
times.append(time.time() - start)
print(f"{sum(times)/5:.2f} seconds to fit 10000 triplets with SOE.")
from cblearn.
Related Issues (20)
- PyPI Deploy Action HOT 1
- Psychophysics how-tos
- Inspection of embeddings HOT 1
- ValueError in triplet_formats example HOT 1
- Clarify when response_map is required for query_from_columns.
- Separate tests with optional dependencies
- Simplify workflows
- Bug: Init generator fails, when printing result message
- More algorithm implementations
- triplet_formats.py example does not work HOT 2
- Contributor installation instructions broken HOT 2
- r_wrapper installation instructions missing HOT 1
- ordinal_embedding.ipynb doesn't work HOT 1
- estimate_dimensionality_cv not in latest pypi version. HOT 1
- Bug with estimate_dimensionality_cv HOT 1
- Catch invalid dimension and raise error message
- Docs are missing for some functions
- PyTorch usage not clear
- Validate uniqueness of comparison entries
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cblearn.