| None -> failwith "no data"

- try Array.map ~f:~~f~~loat~~_~~of_string (split line)

+ try Array.map ~f:Float.of_string (split line)

with exc -> Exn.reraisef exc "failure '%s' converting sample" line ()

let sample = conv_line line in

Marshal.to_channel oc model [];

let read_model model_file : Model.t =

let ic = open_in model_file in

let model = Marshal.from_channel ic in

update_count_vec log_hetero_skedasticity;

update_count_mat log_multiscales_m05;

let n_hypers = !n_hypers_ref in

- let hypers = Array.create n_hypers `Log_sf2 in

+ let hypers = Array.create ~len:n_hypers `Log_sf2 in

let indd = (ind - 1) * d in

let m = Mat.dim2 inducing in

let n_inducing_hypers = d * m in

let n_all_hypers = 2 + n_inducing_hypers in

- let hypers = Array.create n_all_hypers `Log_ell in

+ let hypers = Array.create ~len:n_all_hypers `Log_ell in

let indd = (ind - 1) * d in

let means = Trained.calc_means trained in

if i = 0 then madsum /. f_samples

- else loop (madsum +. ~~abs_float~~ (y.{i} -. means.{i})) (i - 1)

+ else loop (madsum +. Float.abs (y.{i} -. means.{i})) (i - 1)

let means = Trained.calc_means trained in

- else loop (max maxad (~~abs_float~~ (y.{i} -. means.{i}))) (i - 1)

+ else loop (max maxad (Float.abs (y.{i} -. means.{i}))) (i - 1)

let rec loop ~madsum ~maxad i =

if i = 0 then madsum /. f_samples, maxad

- let ad = ~~abs_float~~ (y.{i} -. means.{i}) in

+ let ad = Float.abs (y.{i} -. means.{i}) in

loop ~madsum:(madsum +. ad) ~maxad:(max maxad ad) (i - 1)

loop ~madsum:0. ~maxad:0. n_samples

let is_bad_deriv ~finite_el ~deriv ~tol =

- || ~~abs_float~~ (finite_el -. deriv) > tol

+ || Float.abs (finite_el -. deriv) > tol

let check_deriv_hyper ?(eps = 1e-8) ?(tol = 1e-2)

kernel1 inducing_points1 points1 hyper =

exception Optim_exception of exn

let check_exception seen_exception_ref res =

- if classify~~_float~~ res = F~~P_n~~an then

+ if Float.classify res = Float.Class.Nan then

match !seen_exception_ref with

failwith "Gpr.Optim.Gsl: optimization function returned nan"