def test_relevant_control_network(bowtie_database, bowtie_network): net = bowtie_network # net = bowtie_database.population[50] t = bowtie_database.targets[0] tset = t.calc_distinct_outputs() py_info = get_relevant_control(net, tset) rz = RelevantControlAnalyzer(net.factory.world, tset) cy_info = rz.numpy_info_from_network(net) numpy.testing.assert_allclose(py_info, cy_info)
def test_relevant_control_pop(bowtie_database, bowtie_network): net = bowtie_network pop = bowtie_database.population t = bowtie_database.targets[0] tset = t.calc_distinct_outputs() rz = RelevantControlAnalyzer(net.factory.world, tset) cy_info = rz.numpy_info_from_collection(pop) for i, net in enumerate(pop): py_info = get_relevant_control(net, tset) numpy.testing.assert_allclose(py_info, cy_info[i]) if i > 200: break