python/methylnet/hyperparameter_scans.py
def generate_topology(topology_grid, probability_decay_factor=0.9):
	"""Generates list denoting neural network topology, list of hidden layer sizes.

	Parameters
	----------
	topology_grid : list
		List of different hidden layer sizes (number neurons) to choose from.
	probability_decay_factor : float
		Degree of neural network model complexity for hyperparameter search. Search for less wide networks with a lower complexity value, bounded between 0 and infinity.

	Returns
	-------
	list
		List of hidden layer sizes.

	"""

	probability_decay_factor=float(max(probability_decay_factor,0.))
	p = probability_decay_factor**np.arange(len(topology_grid))
	p /= sum(p)
	n_layer_attempts = int(round(3*probability_decay_factor))
	if n_layer_attempts:
		topology=list(filter(lambda x: x,np.random.choice(topology_grid,n_layer_attempts,p=p)))
	else:
		topology=[]
	if topology:
		return ','.join(map(str,topology))
	else:
		return ''
	return ''
Generates list denoting neural network topology, list of hidden layer sizes.

	Parameters
	----------
	topology_grid : list
		List of different hidden layer sizes (number neurons) to choose from.
	probability_decay_factor : float
		Degree of neural network model complexity for hyperparameter search. Search for less wide networks with a lower complexity value, bounded between 0 and infinity.

	Returns
	-------
	list
		List of hidden layer sizes.

	
Generates list denoting neural network topology, list of hidden layer sizes.
Parameters

topology_grid : list
List of different hidden layer sizes (number neurons) to choose from.
probability_decay_factor : float
Degree of neural network model complexity for hyperparameter search. Search for less wide networks with a lower complexity value, bounded between 0 and infinity.

Returns

list
List of hidden layer sizes.
Generates list denoting neural network topology list of hidden layer sizes . Parameters topology_grid : list List of different hidden layer sizes ( number neurons ) to choose from . probability_decay_factor : float Degree of neural network model complexity for hyperparameter search . Search for less wide networks with a lower complexity value bounded between 0 and infinity . Returns list List of hidden layer sizes .
def generate_topology(topology_grid, probability_decay_factor=0.9):
	probability_decay_factor=float(max(probability_decay_factor,0.))
	p = probability_decay_factor**np.arange(len(topology_grid))
	p /= sum(p)
	n_layer_attempts = int(round(3*probability_decay_factor))
	if n_layer_attempts:
		topology=list(filter(lambda x: x,np.random.choice(topology_grid,n_layer_attempts,p=p)))
	else:
		topology=[]
	if topology:
		return ','.join(map(str,topology))
	else:
		return ''
	return ''
def generate_topology ( topology_grid , probability_decay_factor = 0.9 ) : probability_decay_factor = float ( max ( probability_decay_factor , 0. ) ) p = probability_decay_factor ** np . arange ( len ( topology_grid ) ) p /= sum ( p ) n_layer_attempts = int ( round ( 3 * probability_decay_factor ) ) if n_layer_attempts : topology = list ( filter ( lambda x : x , np . random . choice ( topology_grid , n_layer_attempts , p = p ) ) ) else : topology = [ ] if topology : return ',' . join ( map ( str , topology ) ) else : return '' return ''
Generates list denoting neural network topology, list of hidden layer sizes.
Generates list denoting neural network topology list of hidden layer sizes .
"""Generates list denoting neural network topology, list of hidden layer sizes.

	Parameters
	----------
	topology_grid : list
		List of different hidden layer sizes (number neurons) to choose from.
	probability_decay_factor : float
		Degree of neural network model complexity for hyperparameter search. Search for less wide networks with a lower complexity value, bounded between 0 and infinity.

	Returns
	-------
	list
		List of hidden layer sizes.

	"""
topology_grid
probability_decay_factor