MCPcopy Create free account
hub / github.com/cpystan/SD-VLM / add

Method add

evaluation/evaluate_final.py:30–47  ·  view source on GitHub ↗
(self,type_name,rate)

Source from the content-addressed store, hash-verified

28 self.counter = {'total':{'count': 0, 'rate': [0,0,0],'ratio':[0,0,0]}}
29 self.error = {'total':{'count': 0, 'rate': 0,'ratio':0}}
30 def add(self,type_name,rate):
31 name = 'total'
32 self.counter[name]['count']+=1
33 for i in range(len(rate)):
34 s = rate[i]
35
36 self.counter[name]['rate'][i]+=s
37 self.counter[name]['ratio'][i]= self.counter[name]['rate'][i] /self.counter[name]['count']
38
39 if not type_name in self.counter.keys():
40 self.counter[type_name] ={'count': 0, 'rate': [0,0,0],'ratio':[0,0,0]}
41
42 self.counter[type_name]['count'] +=1
43 for i in range(len(rate)):
44 s = rate[i]
45
46 self.counter[type_name]['rate'][i]+=s
47 self.counter[type_name]['ratio'][i]= self.counter[type_name]['rate'][i] /self.counter[type_name]['count']
48
49
50 def error_add(self,type_name,rate):

Callers 1

mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected