<jupyter_start><jupyter_text><jupyter_code>! wget -q http://dev.sschultze.de:9999/residual_gazebo.h5
! pip install -q git+https://github.com/svenschultze/Lidar-Localization-DL
import matplotlib.pyplot as plt
import numpy as np

import lldl<jupyter_output><empty_output><jupyter_text>Load dataset, model, and sort data by performance<jupyter_code>x, y = lldl.dataset.load("gazebo")
model = lldl.model.load("residual")
model.load_weights("residual_gazebo.h5")
predictions = model.predict(x)
errors = list(map(lambda gt_pred: np.linalg.norm(gt_pred[0]-gt_pred[1]), zip(y, predictions)))
sorted_samples = sorted(list(zip(x, y, predictions, errors)), key=lambda s: s[3], reverse=True)<jupyter_output><empty_output><jupyter_text>Visualize worst predictions from datasetWe visualize the worst performing coordinates from our dataset on this model. It shows that the model performs worse in specific areas of the apartment, especially close to walls. We argue that this is a result of the generation method of our dataset. By teleporting the robot to random coordinates within the apartment, it might have occasionally glitched into walls or objects, which would insert corrupt LiDAR scans into the dataset. Another interesting phenomenon are errors in the top-left outside of the apartment, at roughtly the same distance to the wall as the width of the smaller rooms. This shows that the network estimates the position based on the distance to detected walls, and maybe even more notably on the distance and position of corners. This decision process seems to slightly alter the prediction at this spot, confusing it with rooms with similar distances to walls and corners.<jupyter_code>plt.figure(figsize=(16, 12))
plt.xlim((8, -8))
plt.ylim((6, -6))
for _, (ox, oy), (dx, dy), _ in sorted_samples[:len(sorted_samples) // 10]:
    plt.plot([ox, dx],  [oy, dy])
    plt.scatter([ox], [oy], s=7)

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09647302904564316, 'fraction_numerical': 0.01037344398340249, 'mean_word_length': 5.81625441696113, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '394979', 'license': 'MIT', 'n_tokens_mistral': 600, 'n_tokens_neox': 581, 'n_words': 219, 'path': 'notebooks/worst_coordinates.ipynb', 'repo_name': 'svenschultze/Lidar-Localization-DL', 'size': '1928'}