forked from icaresakr/opticore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
objectives.py
32 lines (26 loc) · 833 Bytes
/
objectives.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
###
# Define objective functions here
#
# © 2022, NeuroRestore
###
class Objectives:
def __init__(self):
self.directions = ['minimize','maximize']
self.names = ['MSE', 'Accuracy']
self.n_targets = len(self.names)
def __len__(self):
return self.n_targets
def evaluate(self, cfg = None, params = None):
"""
Evaluate objectives based on suggested parameters
params: dict parameters names and values {'param_name': param_value, ...}
"""
try:
#FIXME: define objectives here
#Do something
#e.g.
obj1 = params['INT_VAR']**2 + params['FLOAT_VAR']
obj2 = params['INT_VAR'] * params['FLOAT_VAR']**2
return (obj1, obj2)
except:
return (0., 0.)