package neural_nets_lib
A from-scratch Deep Learning framework with an optimizing compiler, shape inference, concise syntax
Install
dune-project
Dependency
Authors
Maintainers
Sources
0.6.0.4.tar.gz
md5=5beaaa0b377bec3badffffbf9f4dec4a
sha512=a37a67452746143f0f5ba2e81f98d6fed31fb4397e0a85f4a35aedc805b4e0405ea89d465c6f80941c465fb61d5d6119806cb73b5c5ead925797eb80d19c5ade
doc/src/neural_nets_lib.datasets/rand.ml.html
Source file rand.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
(** Random number generator library with low quality but very reliable reproducibility. *) module type Random = sig val init : int -> unit val float_range : float -> float -> float val char : unit -> char val int : int -> int end module Random_for_tests : Random = struct let rand = ref (1l : Int32.t) let rand_int32 () = let open Int32 in rand := logxor !rand (shift_left !rand 13); rand := logxor !rand (shift_right_logical !rand 17); rand := logxor !rand (shift_left !rand 5); !rand let init seed = rand := Int32.(add (of_int seed) 1l) let float_range low high = let raw = Int32.(to_float @@ rem (rand_int32 ()) 10000l) in (raw /. 10000. *. (high -. low)) +. low let char () = Char.chr @@ Int32.(to_int @@ rem (rand_int32 ()) 256l) let int high = Int32.(to_int @@ rem (rand_int32 ()) @@ of_int high) end module Random_for_dummy_tests : Random = struct let rand = ref (1l : Int32.t) let rand_int32 () = let open Int32 in rand := add !rand 1l; if equal !rand 10000l then rand := 1l; !rand let init seed = rand := Int32.(add (of_int seed) 1l) let float_range low high = let raw = Int32.(to_float @@ rand_int32 ()) in (raw /. 10000. *. (high -. low)) +. low let char () = Char.chr @@ Int32.(to_int @@ rem (rand_int32 ()) 256l) let int high = Int32.(to_int @@ rem (rand_int32 ()) @@ of_int high) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>