package neural_nets_lib
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A from-scratch Deep Learning framework with an optimizing compiler, shape inference, concise syntax
Install
dune-project
Dependency
Authors
Maintainers
Sources
0.6.1.2.tar.gz
md5=529f0921963a6eee0194159a9c0fea41
sha512=fc16e8b6cd72cb2ae18277b3727d065fa6c1d137e3187f9586fb0bfe7edeb45597cb58f389e79c20d7e3ae80661e6f9f20e0b95dcbbf27ee5688bcc571d395dd
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)"
>