architecture
get_hidden_sizes(_L_in, l1, n=10)
¶
Generates a list of hidden sizes for a neural network with a given input size. Starting with size l1, the list is generated by dividing the input size by 2 until the minimum size is reached.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
_L_in |
int
|
input size. |
required |
l1 |
int
|
number of neurons in the first hidden layer. |
required |
n |
int
|
number of hidden sizes to generate. |
10
|
Returns:
Type | Description |
---|---|
list
|
list of hidden sizes. |
Examples:
>>> from spotpython.hyperparameters.architecture import get_hidden_sizes
_L_in = 10
l1 = 20
n = 4
get_hidden_sizes(_L_in, l1, n)
[20, 10, 10, 5]
Source code in spotpython/hyperparameters/architecture.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|