Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added data/algorithms/vin_pretrained_16x16.pth
Binary file not shown.
Binary file added data/algorithms/vin_pretrained_28x28.pth
Binary file not shown.
Binary file added data/algorithms/vin_pretrained_8x8.pth
Binary file not shown.
10 changes: 6 additions & 4 deletions src/algorithms/algorithm_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
from algorithms.classic.sample_based.rrt_star import RRT_Star
from algorithms.classic.sample_based.rrt_connect import RRT_Connect
from algorithms.classic.graph_based.wavefront import Wavefront
from algorithms.lstm.LSTM_tile_by_tile import OnlineLSTM
from algorithms.lstm.a_star_waypoint import WayPointNavigation
from algorithms.lstm.combined_online_LSTM import CombinedOnlineLSTM
from algorithms.learning.LSTM_tile_by_tile import OnlineLSTM
from algorithms.learning.a_star_waypoint import WayPointNavigation
from algorithms.learning.combined_online_LSTM import CombinedOnlineLSTM
from algorithms.learning.VIN.VIN import VINAlgorithm

if HAS_OMPL:
from algorithms.classic.sample_based.ompl_rrt import OMPL_RRT
Expand Down Expand Up @@ -103,7 +104,8 @@ def _static_init_(cls):
"Dijkstra": (Dijkstra, DijkstraTesting, ([], {})),
"Bug1": (Bug1, BasicTesting, ([], {})),
"Bug2": (Bug2, BasicTesting, ([], {})),
"Potential Field": (PotentialField, BasicTesting, ([], {}))
"Potential Field": (PotentialField, BasicTesting, ([], {})),
"VIN": (VINAlgorithm, BasicTesting, ([], {"load_name": "vin_pretrained"}))
}

if HAS_OMPL:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np

from algorithms.basic_testing import BasicTesting
from algorithms.lstm.combined_online_LSTM import CombinedOnlineLSTM
from algorithms.learning.combined_online_LSTM import CombinedOnlineLSTM
from simulator.services.debug import DebugLevel


Expand Down
4 changes: 2 additions & 2 deletions src/algorithms/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from algorithms.algorithm import Algorithm
from algorithms.basic_testing import BasicTesting
from algorithms.configuration.maps.map import Map
from algorithms.lstm.LSTM_tile_by_tile import BasicLSTMModule
from algorithms.lstm.ML_model import MLModel
from algorithms.learning.LSTM_tile_by_tile import BasicLSTMModule
from algorithms.learning.ML_model import MLModel
from simulator.services.debug import DebugLevel

from structures import Point
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

from algorithms.basic_testing import BasicTesting
from algorithms.configuration.maps.map import Map
from algorithms.lstm.LSTM_tile_by_tile import BasicLSTMModule, OnlineLSTM
from algorithms.lstm.ML_model import MLModel, EvaluationResults
from algorithms.lstm.map_processing import MapProcessing
from algorithms.learning.LSTM_tile_by_tile import BasicLSTMModule, OnlineLSTM
from algorithms.learning.ML_model import MLModel, EvaluationResults
from algorithms.learning.map_processing import MapProcessing
from simulator.services.services import Services
from utility.constants import DATA_PATH

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from torch import nn

from algorithms.basic_testing import BasicTesting
from algorithms.lstm.online_lstm import BasicLSTMModule, OnlineLSTM
from algorithms.learning.online_lstm import BasicLSTMModule, OnlineLSTM
from simulator.services.services import Services


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from algorithms.basic_testing import BasicTesting
from algorithms.configuration.entities.goal import Goal
from algorithms.configuration.maps.map import Map
from algorithms.lstm.ML_model import MLModel, SingleTensorDataset, PackedDataset
from algorithms.lstm.map_processing import MapProcessing
from algorithms.learning.ML_model import MLModel, SingleTensorDataset, PackedDataset
from algorithms.learning.map_processing import MapProcessing
from simulator.services.services import Services
from simulator.views.map.display.entities_map_display import EntitiesMapDisplay
from simulator.views.map.display.online_lstm_map_display import OnlineLSTMMapDisplay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence, pack_sequence, PackedSequence
from torch.utils import data
from torch.utils.data import DataLoader, TensorDataset, Dataset, Subset
from algorithms.lstm.map_processing import MapProcessing
from algorithms.learning.map_processing import MapProcessing
from simulator.services.debug import DebugLevel
from simulator.services.services import Services

Expand Down Expand Up @@ -154,7 +154,7 @@ class PackedDataset(Dataset):
lengths: torch.Tensor

def __init__(self, seq: List[torch.Tensor]) -> None:
from algorithms.lstm.LSTM_tile_by_tile import BasicLSTMModule
from algorithms.learning.LSTM_tile_by_tile import BasicLSTMModule

ls = list(map(lambda el: el.shape[0], seq))
self.perm = BasicLSTMModule.get_sort_by_lengths_indices(ls)
Expand Down
135 changes: 135 additions & 0 deletions src/algorithms/learning/VIN/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# npz
*.npz

# pth
*.pth
*.pth.1

vin_my_implementation.code-workspace


.vscode/launch.json
/resources/training_maps/
/resources/testing_maps/

/resources/logs/
/resources/test_maps/
/resources/16_100k/
/resources/16_60k/
/resources/16_60k_pt2/

/resources/house_expo/
/resources/house_expo_old/
/resources/house_expo_100x100/






resources/100k_no_block.tar.gz
29 changes: 29 additions & 0 deletions src/algorithms/learning/VIN/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2020, Hussein Ali Jaafar
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading