def run_perceptron(N, alpha, p_pos): model = glm_generative(N=N, alpha=alpha, ensemble_type="gaussian", prior_type="binary", output_type="sgn", prior_p_pos=p_pos) scenario = BayesOptimalScenario(model, x_ids=["x"]) early = EarlyStopping() records = scenario.run_all(max_iter=200, callback=early) return records
def run_cs(N, alpha, ensemble_type, prior_rho): model = glm_generative( N=N, alpha=alpha, ensemble_type=ensemble_type, prior_type="gauss_bernoulli", output_type="gaussian", prior_rho=prior_rho, output_var=1e-11 ) scenario = BayesOptimalScenario(model, x_ids=["x"]) early = EarlyStopping() records = scenario.run_all( metrics=["mse"], max_iter=200, callback=early ) return records
def run_phase_retrieval(N, alpha, prior_mean): model = glm_generative(N=N, alpha=alpha, ensemble_type="complex_gaussian", prior_type="gauss_bernouilli", output_type="modulus", prior_mean=prior_mean, prior_rho=0.5) scenario = BayesOptimalScenario(model, x_ids=["x"]) early = EarlyStopping(wait_increase=10) records = scenario.run_all(metrics=["mse", "phase_mse"], max_iter=200, damping=0.3, callback=early) return records