InferencetrainingAI
commited on
Commit
•
359e021
1
Parent(s):
67d226a
Update ser.py
Browse filesoptimize and update params
ser.py
CHANGED
@@ -62,6 +62,19 @@ class SearchMood:
|
|
62 |
|
63 |
|
64 |
return(torch.tensor([samp_loss*-1]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
|
67 |
|
|
|
62 |
|
63 |
|
64 |
return(torch.tensor([samp_loss*-1]))
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
def search_compose(self):
|
69 |
+
for d in range(100):
|
70 |
+
optimizer = optim.Adagrad((self.prior_component[0], self.prior_component[1]))
|
71 |
+
optimizer.step(closure=self.loss_fn)
|
72 |
+
state_dict = optimizer.state_dict()
|
73 |
+
params = state_dict['param_groups'][0]['params']
|
74 |
+
|
75 |
+
self.prior_component[0] = params[0]
|
76 |
+
self.prior_component[1] = params[1]
|
77 |
+
|
78 |
|
79 |
|
80 |
|