derek-thomas
commited on
Commit
·
8c4b8df
1
Parent(s):
a79f7cd
Make sure loss is the right number
Browse files- utilities.py +4 -2
utilities.py
CHANGED
@@ -272,14 +272,16 @@ def my_loss(dataset, w):
|
|
272 |
tqdm.pandas(desc='Calculating Loss before Training')
|
273 |
dataset = dataset.progress_apply(partial(log_loss, my_collection), axis=1)
|
274 |
print(f"Loss before training: {dataset['log_loss'].mean():.4f}")
|
|
|
275 |
my_collection = Collection(w)
|
276 |
tqdm.pandas(desc='Calculating Loss After Training')
|
277 |
dataset = dataset.progress_apply(partial(log_loss, my_collection), axis=1)
|
278 |
print(f"Loss after training: {dataset['log_loss'].mean():.4f}")
|
|
|
279 |
return f"""
|
280 |
-
*Loss before training*: {
|
281 |
|
282 |
-
*Loss after training*: {
|
283 |
"""
|
284 |
|
285 |
|
|
|
272 |
tqdm.pandas(desc='Calculating Loss before Training')
|
273 |
dataset = dataset.progress_apply(partial(log_loss, my_collection), axis=1)
|
274 |
print(f"Loss before training: {dataset['log_loss'].mean():.4f}")
|
275 |
+
loss_before = f"{dataset['log_loss'].mean():.4f}"
|
276 |
my_collection = Collection(w)
|
277 |
tqdm.pandas(desc='Calculating Loss After Training')
|
278 |
dataset = dataset.progress_apply(partial(log_loss, my_collection), axis=1)
|
279 |
print(f"Loss after training: {dataset['log_loss'].mean():.4f}")
|
280 |
+
loss_after = f"{dataset['log_loss'].mean():.4f}"
|
281 |
return f"""
|
282 |
+
*Loss before training*: {loss_before}
|
283 |
|
284 |
+
*Loss after training*: {loss_after}
|
285 |
"""
|
286 |
|
287 |
|