-
Notifications
You must be signed in to change notification settings - Fork 1
/
randomparameters.py
52 lines (42 loc) · 1.12 KB
/
randomparameters.py
1
2
3
4
5
6
7
8
9
10
11
12
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
47
48
49
50
51
52
import random
from typing import Tuple
class RandomParameters:
def __init__(self, seed) -> None:
random.seed(seed)
@staticmethod
def activation():
activation_layers = [
"relu",
"sigmoid",
"softmax",
"softplus",
"softsign",
"tanh",
"selu",
"elu",
"exponential",
]
number = random.randint(1, len(activation_layers))
return activation_layers[number]
@staticmethod
def filter_size():
number = random.randint(1, 5)
return (number, number)
@staticmethod
def first_filter() -> int:
return random.randint(1, 64)
@staticmethod
def second_filter() -> int:
number = random.randint(5, 10)
return (number, number)
@staticmethod
def third_filter() -> int:
number = random.randint(10, 15)
return (number, number)
@staticmethod
def dropout():
return random.uniform(0.1, 0.8)
if __name__ == "__main__":
studentnr = 104648
R = RandomParameters(studentnr)
print(R.activation())