Pabeigt uzdevumus no ieprējā note
Ievērojami uzlabot atskaites, pievienot CSV failus un grafikus ar rezultātiem
CSV vailos noteikti jāglabā last_test_loss, best_test_loss, last_test_acc, best_test_acc un train mainīgie
Implementēt korekti multi-dataloder piemēru
xxxxxxxxxx
301import numpy as np
2
3
4class DataLoader():
5 def __init__(self):
6 self.data = [1, 2, 3, 4, 5]
7 self.index = 0
8
9 def __iter__(self):
10 self.index = 0
11 np.random.shuffle(self.data)
12 return self
13
14 def __next__(self):
15 if self.index < len(self.data):
16 result = self.data[self.index]
17 self.index += 1
18 return result
19 else:
20 raise StopIteration()
21
22loader_train = DataLoader()
23
24iter2 = iter(DataLoader())
25iter3 = iter(DataLoader())
26
27for each1 in loader_train:
28 each2 = next(iter2)
29 each3 = next(iter3)
30 print(each1, each2, each3)