embedding — Embedding Loop
SG-t-SNE-Pi gradient descent optimization loop.
Translated from ref/sgtsnepi/src/gradient_descend.cpp.
sgtsne_embedding(P, d=2, max_iter=1000, early_exag=250, alpha=12.0, eta=200.0, h=1.0, Y0=None, random_state=None)
Run SG-t-SNE-Pi gradient descent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
P
|
csc_matrix
|
Symmetrized, normalized probability matrix (n, n). |
required |
d
|
int
|
Embedding dimensions (1, 2, or 3). |
2
|
max_iter
|
int
|
Total iterations. |
1000
|
early_exag
|
int
|
Number of early exaggeration iterations. |
250
|
alpha
|
float
|
Exaggeration multiplier (drops to 1 after early_exag). |
12.0
|
eta
|
float
|
Learning rate. |
200.0
|
h
|
float
|
Grid side length for FFT. |
1.0
|
Y0
|
ndarray or None
|
Initial embedding of shape (n, d). If None, random init with scale 0.01 (matching Julia tutorial convention). |
None
|
random_state
|
int or None
|
Random seed for reproducibility. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Y |
ndarray of shape (n, d)
|
Final embedding coordinates. |