Tests consomation memoire/temps + methode KL divergence (UDA)

This commit is contained in:
Harle, Antoine (Contracteur) 2019-12-06 14:13:28 -05:00
parent b60610d9a7
commit d68034eec1
5 changed files with 214 additions and 37 deletions

View file

@ -9,6 +9,16 @@ from torchviz import make_dot
import torch
import torch.nn.functional as F
import time
class timer():
def __init__(self):
self._start_time=time.time()
def exec_time(self):
end = time.time()
res = end-self._start_time
self._start_time=end
return res
def print_graph(PyTorch_obj, fig_name='graph'):
graph=make_dot(PyTorch_obj) #Loss give the whole graph