neuronunit.optimization package¶
Submodules¶
neuronunit.optimization.algorithms module¶
Optimisation class Copyright (c) 2016, EPFL/Blue Brain Project
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3.0 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
neuronunit.optimization.bp_opt module¶
Optimisation class
-
class
neuronunit.optimization.bp_opt.SciUnitOptimization(error_criterion=None, evaluator=None, selection='selIBEA', benchmark=False, seed=1, offspring_size=15, elite_size=3, eta=10, mutpb=1.0, cxpb=1.0, map_function=None, backend=None, nparams=10, provided_dict={})[source]¶ Bases:
bluepyopt.optimisations.OptimisationDEAP Optimisation class
-
class
neuronunit.optimization.bp_opt.WSFloatIndividual(*args, **kwargs)[source]¶ Bases:
floatIndividual consisting of list with weighted sum field
neuronunit.optimization.covariance_adaption_approach module¶
neuronunit.optimization.data_transport_container module¶
-
class
neuronunit.optimization.data_transport_container.DataTC[source]¶ Bases:
objectData Transport Container
This Object class serves as a data type for storing rheobase search attributes and apriori model parameters, with the distinction that unlike the NEURON model this class can be cheaply transported across HOSTS/CPUs
neuronunit.optimization.exhaustive_search module¶
-
class
neuronunit.optimization.exhaustive_search.WSListIndividual(*args, **kwargs)[source]¶ Bases:
listIndividual consisting of list with weighted sum field
-
neuronunit.optimization.exhaustive_search.build_chunk_grid(npoints, free_params, hold_constant=None, mp_in=None)[source]¶
-
neuronunit.optimization.exhaustive_search.create_grid(mp_in=None, npoints=3, free_params=None, ga=None)[source]¶ check for overlap in parameter space.
-
neuronunit.optimization.exhaustive_search.run_grid(npoints, tests, provided_keys=None, hold_constant=None, ranges=None)[source]¶
-
neuronunit.optimization.exhaustive_search.run_simple_grid(npoints, tests, ranges, free_params, hold_constant=None)[source]¶
-
neuronunit.optimization.exhaustive_search.tfc2i(x, y, z, err)[source]¶ translate_float_cube_to_index
Takes x, y, z values as lists and returns a 2D numpy array
neuronunit.optimization.get_neab module¶
neuronunit.optimization.model_parameters module¶
-
neuronunit.optimization.model_parameters.transcribe_units(input_dic)[source]¶ Move between OSB unit conventions and NEURON unit conventions.
-
neuronunit.optimization.model_parameters.type2007= {'CH': (50, 1.5, -60, -40, 25, 0.03, 1, -40, 150, 3), 'FS': (20, 1.0, -55, -40, 25, 0.2, -2, -45, -55, 5), 'IB': (150, 1.2, -75, -45, 50, 0.01, 5, -56, 130, 2), 'LTS': (100, 1.0, -56, -42, 40, 0.03, 8, -53, 20, 4), 'RS': (100, 0.7, -60, -40, 35, 0.03, -2, -50, 100, 1), 'RTN': (40, 0.25, -65, -45, 0, 0.015, 10, -55, 50, 7), 'RTN_burst': (40, 0.25, -65, -45, 0, 0.015, 10, -55, 50, 7), 'TC': (200, 1.6, -60, -50, 35, 0.01, 15, -60, 10, 6), 'TC_burst': (200, 1.6, -60, -50, 35, 0.01, 15, -60, 10, 6)}¶ temp = {k:[] for k in [‘C’,’k’,’vr’,’vt’,’vpeak’,’a’,’b’,’c’,’d’] } for i,k in enumerate(temp.keys()):
- for v in type2007.values():
- temp[k].append(v[i])
explore_param = {k:(np.min(v),np.max(v)) for k,v in temp.items()} model_params = OrderedDict(explore_param)
neuronunit.optimization.opt_man module¶
neuronunit.optimization.optimization_management module¶
-
class
neuronunit.optimization.optimization_management.WSFloatIndividual(*args, **kwargs)[source]¶ Bases:
floatIndividual consisting of list with weighted sum field
-
class
neuronunit.optimization.optimization_management.WSListIndividual(*args, **kwargs)[source]¶ Bases:
listIndividual consisting of list with weighted sum field
-
neuronunit.optimization.optimization_management.create_subset(nparams=10, boundary_dict=None)[source]¶
-
neuronunit.optimization.optimization_management.new_genes(pop, dtcpop, td)[source]¶ some times genes explored will not return un-usable simulation parameters genes who have no rheobase score will be discarded.
BluePyOpt needs a stable gene number however
This method finds how many genes have been discarded, and tries to build new genes from the existing distribution of gene values, by mimicing a normal random distribution of genes that are not deleted. if a rheobase value cannot be found for a given set of dtc model more_attributes delete that model, or rather, filter it out above, and make new genes based on the statistics of remaining genes. it’s possible that they wont be good models either, so keep trying in that event. a new model from the mean of the pre-existing model attributes.
-
neuronunit.optimization.optimization_management.obtain_rheobase(pop, td, tests)[source]¶ Calculate rheobase for a given population pop Ordered parameter dictionary td and rheobase test rt
-
neuronunit.optimization.optimization_management.run_ga(explore_edges, max_ngen, test, free_params=None, hc=None, NSGA=None, MU=None, seed_pop=None, model_type='RAW')[source]¶
-
neuronunit.optimization.optimization_management.serial_route(pop, td, tests)[source]¶ parallel list mapping only works with an iterable collection. Serial route is intended for single items.
-
neuronunit.optimization.optimization_management.test_runner(pop, td, tests, single_spike=True)[source]¶
-
neuronunit.optimization.optimization_management.update_deap_pop(pop, tests, td, backend=None, hc=None)[source]¶ Inputs a population of genes (pop). Returned neuronunit scored DataTransportContainers (dtcpop). This method converts a population of genes to a population of Data Transport Containers, Which act as communicatable data types for storing model attributes. Rheobase values are found on the DTCs DTCs for which a rheobase value of x (pA)<=0 are filtered out DTCs are then scored by neuronunit, using neuronunit models that act in place.
-
neuronunit.optimization.optimization_management.update_dtc_pop(pop, td)[source]¶ inputs a population of genes/alleles, the population size MU, and an optional argument of a rheobase value guess outputs a population of genes/alleles, a population of individual object shells, ie a pickleable container for gene attributes. Rationale, not every gene value will result in a model for which rheobase is found, in which case that gene is discarded, however to compensate for losses in gene population size, more gene samples must be tested for a successful return from a rheobase search. If the tests return are successful these new sampled individuals are appended to the population, and then their attributes are mapped onto corresponding virtual model objects.
neuronunit.optimization.results_analysis module¶
Module contents¶
NeuronUnit Optimization classes