Andywxy commited on
Commit
3708b71
·
verified ·
1 Parent(s): 8232884

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -1
README.md CHANGED
@@ -58,4 +58,20 @@ with torch.no_grad():
58
  logits = outputs.logits # Extract predictions
59
 
60
  all_preds.extend(logits.cpu().numpy()) # Store predictions
61
- all_actuals.extend(gps_coords.cpu
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  logits = outputs.logits # Extract predictions
59
 
60
  all_preds.extend(logits.cpu().numpy()) # Store predictions
61
+ all_actuals.extend(gps_coords.cpu().numpy()) # Store actual values
62
+
63
+ # Denormalize predictions and actual values
64
+ all_preds = np.array(all_preds)
65
+ all_actuals = np.array(all_actuals)
66
+
67
+ all_preds_denorm = all_preds * np.array([lat_std, lon_std]) + np.array([lat_mean, lon_mean])
68
+ all_actuals_denorm = all_actuals * np.array([lat_std, lon_std]) + np.array([lat_mean, lon_mean])
69
+
70
+ # Calculate RMSE using geodesic distances
71
+ squared_errors = []
72
+ for pred, actual in zip(all_preds_denorm, all_actuals_denorm):
73
+ distance = geodesic((actual[0], actual[1]), (pred[0], pred[1])).meters
74
+ squared_errors.append(distance**2) # Square the distance for RMSE
75
+
76
+ rmse = np.sqrt(np.mean(squared_errors))
77
+ print(f"RMSE: {rmse:.2f} meters")