Skip to main content

Module plot

Module plot 

Source
Expand description

Training visualisation: loss curves and 2D PCA word projection plots.

Uses [plotters] to render PNG files.

§Example

use word2vec::plot::{plot_loss_curve, plot_word_vectors_pca};
use word2vec::trainer::EpochStats;

// After training:
// plot_loss_curve(&trainer.history, "loss.png").unwrap();
// plot_word_vectors_pca(&embeddings, 50, "pca.png").unwrap();

Functions§

plot_loss_curve
Render a loss-vs-epoch line chart to a PNG file.
plot_word_vectors_pca
Project the top-n_words most frequent words into 2D using PCA (covariance-free: uses power iteration on two principal components) and render a scatter plot with word labels.