This release fixes defects that made 0.1.x predict poorly with its default settings, and removes the bundled dataset: the package now contains code only.
On prospectr::NIRsoil (soil carbon, SNV spectra), the
default settings now give a median test R² of 0.78 (0.69-0.82 over 10
seeds) on the calibration/test split shipped with the data, against 0.68
for PLS, and 0.75 (PLS 0.67) over 10 random 75/25 splits.
val_y_loss). It watched the total loss, dominated by
reconstruction and computed on a random latent sample. With validation
data, the learning rate is also halved when the prediction loss stalls
(reduce_lr = TRUE).beta_kl = 1e-3 (was
1), lr = 5e-4 (was 1e-3) and an L2 weight penalty
l2 = 1e-4 (new).vae_predict() and vae_encode() are
explicitly deterministic and use the latent mean. They previously relied
on reticulate’s 0-based indexing of a Python tuple to pick it.hidden_enc = 64L) raised
'int' object is not iterable; it now works.vae_fit() scales the predictors and stores the scaling
in the model, so the same spectra can be passed to
vae_fit() and vae_predict(). The default
scale_x = "global" centres each band and divides all bands
by one overall SD, which keeps the shape of the spectrum;
"band" scales each band by its own SD (this inflated noisy
bands and occasionally gave very poor fits on spectra),
"none" leaves X as given.patience epochs, so a lucky early epoch can no longer end
training before the model has learned (this happened in about one fit in
ten).validation_split holds out training rows for early
stopping when no X_val is given.vae_predict() and vae_encode()
refuse an unfitted model, match columns by name when both sides have
names, and accept a numeric vector for a single sample.vae_install() installs TensorFlow and Keras in the
"r-soilvae" virtualenv (or a conda environment), which
soilVAE then uses automatically in new sessions.
vae_available() checks the backend without ever installing
or downloading anything. Examples now run whenever the backend is
available instead of never (\dontrun).vae_save() / vae_load(): save and reload a
fitted model (architecture, weights, scaling and column names) in one
.keras file.vae_history(): per-epoch training and validation
losses.vae_build(seed = ) makes a fit reproducible;
tune_vae_train_val() seeds each configuration
(seed + i), frees memory between them and records
l2.X and y (also
X_val/y_val, given together), matching
lengths, ranges of the vae_build() and
vae_fit() arguments. select_best_from_grid()
skips configurations with missing metrics.tests/testthat, 24 tests) covering each
fix and feature.datsoilspc (redistributed from the
‘soilspec’ package) is removed. The vignette and README now use
NIRsoil, loaded from the prospectr package
at run time, so soilVAE distributes no data.datsoilspc (redistributed
unmodified from the ‘soilspec’ package by Alexandre M. J.-C. Wadoux, MIT
license) in DESCRIPTION (cph role), LICENSE,
inst/COPYRIGHTS, and in the dataset documentation
(\source, \references).