-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: Week 2 - Captura y balanceo del dataset | ||
categories: | ||
- weekly Log | ||
tags: | ||
- CARLA 0.9.14 | ||
- balanceo | ||
- ROS 2 | ||
- ROS_BRIDGE | ||
- Dataset | ||
--- | ||
|
||
### Exploracion de los datos | ||
|
||
El dataset generado consta de un conjunto de 7,080 imágenes con sus respectivas etiquetas. Al representar los valores correspondientes al ángulo de giro (steer) en un histograma con 50 intervalos, se observa una distribución altamente desequilibrada. | ||
|
||
```python | ||
histogram = plt.hist(df['steer_values'], bins=50) | ||
plt.xlabel("Ángulo de giro") | ||
plt.ylabel("# de Conteos") | ||
plt.show(histogram) | ||
``` | ||
|
||
<figure class="half"> | ||
<img src="{{ site.url }}{{ site.baseurl }}/assets/images/week3/histograma_steer.png" alt="" style="width:100%"> | ||
<figcaption>histograma-sin-balanceo</figcaption> | ||
</figure> | ||
|
||
Como se aprecia en la imagen, la cantidad de valores cercanos al cero en el ángulo de giro supera los 5000, mientras que en los demás intervalos no se alcanza a superar los 100 valores. Esto indica que en la simulación predominó la conducción en línea recta. Si el modelo se entrena con estos datos, es probable que generalice este comportamiento y solo pueda predecir una dirección cero para todas las salidas, por lo tanto, no aprendería el mapeo correcto de la dirección de las imágenes. | ||
|
||
<figure class="half"> | ||
<img src="{{ site.url }}{{ site.baseurl }}/assets/images/week3/docs/assets/images/week3/tabla_conteo_steer_values.png" alt="" style="width:100%"> | ||
<figcaption>tabla_intervalos</figcaption> | ||
</figure> | ||
|
||
Para equilibrar el conjunto de datos, se empleó la técnica de submuestreo. Para ello, se dividió el conjunto de datos en 50 intervalos y se tomó el valor medio. | ||
|
||
```python | ||
samples = 400 | ||
bin_width = 0.04 | ||
|
||
resampled = pd.concat([ | ||
part_df.sample(min(samples, part_df.shape[0]), random_state=1) | ||
for small_r in np.arange(-1, 1.01, bin_width) | ||
for part_df in [df[(df['steer_values'] >= small_r) & (df['steer_values'] < small_r + bin_width)]] | ||
]) | ||
``` | ||
Este proceso genera un conjunto de datos más equilibrado. | ||
|
||
<figure class="half"> | ||
<img src="{{ site.url }}{{ site.baseurl }}/assets/images/week3/docs/assets/images/week3/docs/assets/images/week3/histograma_steer_balanceado.png" alt="" style="width:100%"> | ||
<figcaption>datos-balanceados</figcaption> | ||
</figure> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.