예제 #1
0
 public LossesContainer(ILossFunc losses, string[] output_names = null)
     : base(output_names)
 {
     _user_losses = losses;
     _losses      = losses;
     _loss_metric = new Mean(name: "loss");
     _built       = false;
 }
예제 #2
0
        public void compile(ILossFunc loss, OptimizerV2 optimizer, string[] metrics)
        {
            this.optimizer   = optimizer;
            compiled_loss    = new LossesContainer(loss, output_names: output_names);
            compiled_metrics = new MetricsContainer(metrics, output_names: output_names);

            int experimental_steps_per_execution = 1;

            _configure_steps_per_execution(experimental_steps_per_execution);

            // Initialize cache attrs.
            _reset_compile_cache();
            _is_compiled = true;
            this.loss    = loss;
        }
예제 #3
0
        public void compile(string optimizer, string loss, string[] metrics)
        {
            var _optimizer = optimizer switch
            {
                "rmsprop" => new RMSprop(new RMSpropArgs
                {
                }),
                _ => throw new NotImplementedException("")
            };

            ILossFunc _loss = loss switch
            {
                "mse" => new MeanSquaredError(),
                "mae" => new MeanAbsoluteError(),
                _ => throw new NotImplementedException("")
            };

            compile(optimizer: _optimizer, loss: _loss, metrics: metrics);
        }
    }
}
예제 #4
0
        public void compile(OptimizerV2 optimizer = null,
                            ILossFunc loss        = null,
                            string[] metrics      = null)
        {
            this.optimizer = optimizer ?? new RMSprop(new RMSpropArgs
            {
            });

            this.loss = loss ?? new MeanSquaredError();

            compiled_loss    = new LossesContainer(loss, output_names: output_names);
            compiled_metrics = new MetricsContainer(metrics, output_names: output_names);

            int experimental_steps_per_execution = 1;

            _configure_steps_per_execution(experimental_steps_per_execution);

            // Initialize cache attrs.
            _reset_compile_cache();
            _is_compiled = true;
        }
예제 #5
0
 public void compile(string optimizerName, ILossFunc lossName)
 {
     throw new NotImplementedException("");
 }