Markus Mottl avatar Markus Mottl committed bf4644f

Fixed compatilibity issues with newest Jane Street Core distribution

Comments (0)

Files changed (4)

   | None -> failwith "no data"
   | Some line ->
       let conv_line line =
-        try Array.map ~f:float_of_string (split line)
+        try Array.map ~f:Float.of_string (split line)
         with exc -> Exn.reraisef exc "failure '%s' converting sample" line ()
       in
       let sample = conv_line line in
     }
   in
   Marshal.to_channel oc model [];
-  close_out oc
+  Out_channel.close oc
 
 exception Bailout
 
 let read_model model_file : Model.t =
   let ic = open_in model_file in
   let model = Marshal.from_channel ic in
-  close_in ic;
+  In_channel.close ic;
   model
 
 let test args =

lib/cov_se_fat.ml

       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
       for ind = 1 to m do
         let indd = (ind - 1) * d in
         for dim = 1 to d do

lib/cov_se_iso.ml

       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
       hypers.(1) <- `Log_sf2 ;
       for ind = 1 to m do
         let indd = (ind - 1) * d in
       let means = Trained.calc_means trained in
       let rec loop madsum i =
         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)
       in
       loop 0. n_samples
 
       let means = Trained.calc_means trained in
       let rec loop maxad i =
         if i = 0 then maxad
-        else loop (max maxad (abs_float (y.{i} -. means.{i}))) (i - 1)
+        else loop (max maxad (Float.abs (y.{i} -. means.{i}))) (i - 1)
       in
       loop 0. (Vec.dim y)
 
         let rec loop ~madsum ~maxad i =
           if i = 0 then madsum /. f_samples, maxad
           else
-            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)
         in
         loop ~madsum:0. ~maxad:0. n_samples
       let is_bad_deriv ~finite_el ~deriv ~tol =
         Float.is_nan finite_el
           || Float.is_nan deriv
-          || 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 = FP_nan then
+          if Float.classify res = Float.Class.Nan then
             match !seen_exception_ref with
             | None ->
                 failwith "Gpr.Optim.Gsl: optimization function returned nan"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.