Print out experiment information when running it

Sun, 11 Dec 2022 23:19:17 +0200

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sun, 11 Dec 2022 23:19:17 +0200
changeset 23
9869fa1e0ccd
parent 22
9fb8ecb3da74
child 24
d29d1fcf5423

Print out experiment information when running it

src/rand_distr.rs file | annotate | diff | comparison | revisions
src/run.rs file | annotate | diff | comparison | revisions
--- a/src/rand_distr.rs	Sat Dec 10 16:22:38 2022 +0200
+++ b/src/rand_distr.rs	Sun Dec 11 23:19:17 2022 +0200
@@ -8,6 +8,7 @@
 use alg_tools::types::*;
 
 /// Wrapper for [`Normal`] that can be serialized by serde.
+#[derive(Debug)]
 pub struct SerializableNormal<T : Float>(Normal<T>)
 where StandardNormal : Distribution<T>;
 
--- a/src/run.rs	Sat Dec 10 16:22:38 2022 +0200
+++ b/src/run.rs	Sun Dec 11 23:19:17 2022 +0200
@@ -326,17 +326,18 @@
 Named<Experiment<F, NoiseDistr, S, K, P, N>>
 where F : ClapFloat + nalgebra::RealField + ToNalgebraRealField<MixedType=F>,
       [usize; N] : Serialize,
-      S : Sensor<F, N> + Copy + Serialize,
-      P : Spread<F, N> + Copy + Serialize,
+      S : Sensor<F, N> + Copy + Serialize + std::fmt::Debug,
+      P : Spread<F, N> + Copy + Serialize + std::fmt::Debug,
       Convolution<S, P>: Spread<F, N> + Bounded<F> + LocalAnalysis<F, Bounds<F>, N> + Copy,
       AutoConvolution<P> : BoundedBy<F, K>,
-      K : SimpleConvolutionKernel<F, N> + LocalAnalysis<F, Bounds<F>, N> + Copy + Serialize,
+      K : SimpleConvolutionKernel<F, N> + LocalAnalysis<F, Bounds<F>, N> 
+          + Copy + Serialize + std::fmt::Debug,
       Cube<F, N>: P2Minimise<Loc<F, N>, F> + SetOrd,
       PlotLookup : Plotting<N>,
       DefaultBT<F, N> : SensorGridBT<F, S, P, N, Depth=DynamicDepth> + BTSearch<F, N>,
       BTNodeLookup: BTNode<F, usize, Bounds<F>, N>,
       DiscreteMeasure<Loc<F, N>, F> : SpikeMerging<F>,
-      NoiseDistr : Distribution<F> + Serialize {
+      NoiseDistr : Distribution<F> + Serialize + std::fmt::Debug {
 
     fn algorithm_defaults(&self, alg : DefaultAlgorithm, cli : &AlgorithmOverrides<F>)
     -> Named<AlgorithmConfig<F>> {
@@ -362,6 +363,10 @@
             }
         } = self;
 
+        println!("{}\n{}",
+                 format!("Performing experiment {}…", experiment_name).cyan(),
+                 format!("{:?}", &self.data).bright_black());
+
         // Set up output directory
         let prefix = format!("{}/{}/", cli.outdir, self.name);
 

mercurial