Repository navigation
CHANGES:
- Build: do not inherit OpenMP flags from the pkg-config files of OpenBLAS,
CBLAS or LAPACKE unlessOWL_ENABLE_OPENMP=1. An OpenBLAS built with
OpenMP (Homebrew, FreeBSD) made Owl compile its#pragma ompcode without
linking an OpenMP runtime (undefined__kmpc_*symbols, #695) or fail with
compilers that reject-fopenmp(#684). - Build: work around Apple Clang 21 (Xcode 26) crashing on arm64 while
vectorising themodfloops ofowl_ndarray_maths_stub.c: with Clang,
modfis called through a function that is not inlined. - Build: keep the optional optimisation flags of the default configuration
only if the C compiler accepts them without a warning, so that GCC-only
flags are dropped with Clang and-march=nativewith compilers that
reject it. Flags with GCC are unchanged. - Fix resuming a compiled network (
Owl_neural_compiler.train ~state): the
weights were always initialised again and the optimiser state (gradient
history, momentum, Adam's moments) started from zero.trainand
compile_deeptake?init_model(defaulttrue, as inGraph.train);
pass~init_model:falsewith~stateto resume. The optimiser state is
now saved in the returned state and restored from it. Training an already
compiled network a second time no longer fails inGraph.init. - Fix the learning rate of compiled networks (
Owl_neural_compiler.train):
the static graph used the rate of step 999 for every step, so Adam's bias
correction was wrong andDecay,Exp_decayandSchedulewere constant;
Adam also still divided by the gradient. The step-dependent factor is now a
scalar graph input set before every step (assign_learning_rate), using the
newLearning_Rate.scaleandLearning_Rate.unscaled_update. Compiled
training now matches eager training step for step. - Fix NaN in cross-entropy when a prediction underflows to 0, e.g. from a
saturated softmax:Algodiff.Maths.cross_entropy(and so
Loss.Cross_entropy) andNdarray.cross_entropy'raise predictions below
the smallest positive normal float to that value. Results for all other
predictions are unchanged bit for bit; NaN predictions still propagate. - Change
Regularisation.L2norm atoa * ||w||^2(it wasa * ||w||), and
the L2 term ofRegularisation.Elastic_netlikewise. The plain norm has a
NaN gradient atw = 0, so training a network with L2 regularisation
turned every parameter into NaN, starting from the zero-initialised
biases.Regression.svmuses the squared penalty as a result. - Fix
~keep_dims:truewithout~axisinsum,prod,min,max,
minmax,mean,median,var,std,sem,l1norm,l2norm,
l2norm_sqrandvecnorm(andsum,min,maxin owl-base and
Algodiff.Maths.sum): it now keeps every dimension with size 1 instead of
returning shape [|1|] (#621). Calls that do not passkeep_dimsstill
return [|1|], so default results are unchanged. - Fix
Linalg.detandLinalg.logdeton singular matrices: they return 0
andneg_infinityinstead of raisingFailure "LAPACKE: i"(#249). The
pure-OCamlOwl_base_linalg_generic.detreturned wrong values (e.g. -4 for
[[1, 2], [2, 4]]) because the LU pivot search reused a stale row when a
column was zero; it now returns 0, also for matrices with a zero row. - Fix
Stopping.Const:Checkpoint.runoverwrote the stop flag set by the
stopping criterion, so training never ended early. It now stops at the
first batch whose loss is below the threshold, inminimise_weight,
minimise_fun,minimise_networkandminimise_compiled_network. - Fix Adam: the update no longer divides by the gradient, so elements with a
zero gradient keep moving with their first moment and tiny gradients no
longer give infinite steps. Applies tominimise_weight,minimise_fun,
minimise_networkandStepper; other learning-rate strategies are
unchanged bit for bit. Adam results with non-zero gradients may differ in
the last ulp. NewLearning_Rate.updatereturns the weight update. - Fix
Regression:olsandridgeare solved directly via the SVD,
lassoandelastic_netby coordinate descent, so results are exact
rather than the outcome of 1000 Adagrad steps (#340). Penalties no longer
apply to the intercept, and the L2 penalty ofridgeandelastic_netis
now the squared norm.logisticnow modelssigmoid (x w + b)with targets
in [0, 1] and is solved by Newton's method; it used to take the log of the
raw linear output.exponentialuses variable projection and fits growing
exponentials (#650).svmno longer prints its training log. Documentation
now states the actual defaults (i = false,alpha = 0.001). - Add standalone single-step optimiser
Optimise.Stepper - Add unit tests for
OptimiseandRegression - Fix
exponpow_rvs: it called the standard Gaussian sampler with the scale
as its only argument; it now samples a Gaussian with that scale (#694,
@maxkuttner) - Fix the documentation of the
gumbel2distributions: the second parameter
is a shape, not a location (#696, @tristan-f-r) - Publish the documentation from the
gh-pagesbranch; the generated HTML is
no longer committed indocs/ - Run the tests in CI on Ubuntu and on macOS (arm64 and Intel)