Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
T
torcs_dl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
autonomousdriving
torcs_dl
Commits
65bfd1fd
Commit
65bfd1fd
authored
Jul 12, 2018
by
Svetlana Pavlitskaya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes in Dpnet and affordance indicators
parent
f0cebd01
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
220 additions
and
197 deletions
+220
-197
CNNModelTraining/src/main/models/Dpnet.cnnt
CNNModelTraining/src/main/models/Dpnet.cnnt
+2
-0
CNNModelTraining/src/main/models/Dpnet.emadl
CNNModelTraining/src/main/models/Dpnet.emadl
+2
-3
GeneratedCNNCode/CNNCreator_dpnet.py
GeneratedCNNCode/CNNCreator_dpnet.py
+118
-106
GeneratedCNNCode/CNNCreator_dpnet.pyc
GeneratedCNNCode/CNNCreator_dpnet.pyc
+0
-0
GeneratedCNNCode/CNNTrainer_Dpnet.py
GeneratedCNNCode/CNNTrainer_Dpnet.py
+9
-3
GeneratedCNNCode/leveldb_to_hdf5.py
GeneratedCNNCode/leveldb_to_hdf5.py
+13
-11
GeneratedCNNCode/requirements.txt
GeneratedCNNCode/requirements.txt
+2
-1
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Affordance.struct
...erator/src/main/models/dp/subcomponents/Affordance.struct
+13
-13
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Dpnet.cnnt
...EMAMGenerator/src/main/models/dp/subcomponents/Dpnet.cnnt
+1
-0
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Dpnet.emadl
...MAMGenerator/src/main/models/dp/subcomponents/Dpnet.emadl
+3
-3
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Unnormalizer.emadl
...rator/src/main/models/dp/subcomponents/Unnormalizer.emadl
+57
-57
No files found.
CNNModelTraining/src/main/models/Dpnet.cnnt
View file @
65bfd1fd
...
...
@@ -2,8 +2,10 @@ configuration Dpnet{
num_epoch : 100
batch_size : 64
context:cpu
normalize: true
optimizer : sgd{
learning_rate : 0.01
weight_decay : 0.0005
}
}
CNNModelTraining/src/main/models/Dpnet.emadl
View file @
65bfd1fd
component Dpnet{
ports in Z(0:255)^{3, 210, 280} image,
out Q(
0:1)^{13
,1,1} predictions;
out Q(
-oo:oo)^{14
,1,1} predictions;
implementation CNN {
...
...
@@ -23,8 +23,7 @@ component Dpnet{
conv(kernel=(3,3), channels=256) ->
fc() ->
fc() ->
FullyConnected(units=13) ->
Sigmoid() ->
FullyConnected(units=14, no_bias=true) ->
predictions
}
...
...
GeneratedCNNCode/CNNCreator_dpnet.py
View file @
65bfd1fd
...
...
@@ -52,10 +52,10 @@ class CNNCreator_dpnet:
else
:
logging
.
info
(
"Loading checkpoint: "
+
param_file
)
self
.
module
.
load
(
prefix
=
self
.
_model_dir_
+
self
.
_model_prefix_
,
epoch
=
lastEpoch
,
data_names
=
self
.
_input_names_
,
label_names
=
self
.
_output_names_
,
context
=
context
)
epoch
=
lastEpoch
,
data_names
=
self
.
_input_names_
,
label_names
=
self
.
_output_names_
,
context
=
context
)
return
lastEpoch
...
...
@@ -107,12 +107,18 @@ class CNNCreator_dpnet:
def
train
(
self
,
batch_size
,
num_epoch
=
10
,
optimizer
=
'
sgd
'
,
optimizer_params
=
((
'learning_rate'
,
0.01
),),
optimizer
=
'
adam
'
,
optimizer_params
=
((
'learning_rate'
,
0.0
0
1
),),
load_checkpoint
=
True
,
context
=
mx
.
cpu
()
,
context
=
'gpu'
,
checkpoint_period
=
5
,
normalize
=
True
):
if
context
==
'gpu'
:
mx_context
=
mx
.
gpu
()
elif
context
==
'cpu'
:
mx_context
=
mx
.
cpu
()
else
:
logging
.
error
(
"Context argument is '"
+
context
+
"'. Only 'cpu' and 'gpu are valid arguments'."
)
if
'weight_decay'
in
optimizer_params
:
optimizer_params
[
'wd'
]
=
optimizer_params
[
'weight_decay'
]
...
...
@@ -123,9 +129,9 @@ class CNNCreator_dpnet:
min_learning_rate
=
optimizer_params
[
'learning_rate_minimum'
]
del
optimizer_params
[
'learning_rate_minimum'
]
optimizer_params
[
'lr_scheduler'
]
=
mx
.
lr_scheduler
.
FactorScheduler
(
optimizer_params
[
'step_size'
],
factor
=
optimizer_params
[
'learning_rate_decay'
],
stop_factor_lr
=
min_learning_rate
)
optimizer_params
[
'step_size'
],
factor
=
optimizer_params
[
'learning_rate_decay'
],
stop_factor_lr
=
min_learning_rate
)
del
optimizer_params
[
'step_size'
]
del
optimizer_params
[
'learning_rate_decay'
]
...
...
@@ -133,13 +139,13 @@ class CNNCreator_dpnet:
train_iter
,
test_iter
,
data_mean
,
data_std
=
self
.
load_data
(
batch_size
)
if
self
.
module
==
None
:
if
normalize
:
self
.
construct
(
context
,
data_mean
,
data_std
)
self
.
construct
(
mx_
context
,
data_mean
,
data_std
)
else
:
self
.
construct
(
context
)
self
.
construct
(
mx_
context
)
begin_epoch
=
0
if
load_checkpoint
:
begin_epoch
=
self
.
load
(
context
)
begin_epoch
=
self
.
load
(
mx_
context
)
else
:
if
os
.
path
.
isdir
(
self
.
_model_dir_
):
shutil
.
rmtree
(
self
.
_model_dir_
)
...
...
@@ -152,6 +158,7 @@ class CNNCreator_dpnet:
self
.
module
.
fit
(
train_data
=
train_iter
,
eval_metric
=
'mse'
,
eval_data
=
test_iter
,
optimizer
=
optimizer
,
optimizer_params
=
optimizer_params
,
...
...
@@ -165,7 +172,7 @@ class CNNCreator_dpnet:
def
construct
(
self
,
context
,
data_mean
=
None
,
data_std
=
None
):
image
=
mx
.
sym
.
var
(
"image"
,
shape
=
(
0
,
3
,
210
,
280
))
shape
=
(
0
,
3
,
210
,
280
))
# image, output shape: {[3,210,280]}
if
not
data_mean
is
None
:
...
...
@@ -177,150 +184,155 @@ class CNNCreator_dpnet:
image
=
mx
.
symbol
.
broadcast_sub
(
image
,
_data_mean_
)
image
=
mx
.
symbol
.
broadcast_div
(
image
,
_data_std_
)
conv1_
=
mx
.
symbol
.
pad
(
data
=
image
,
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
5
,
4
,
4
,
3
),
constant_value
=
0
)
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
5
,
4
,
4
,
3
),
constant_value
=
0
)
conv1_
=
mx
.
symbol
.
Convolution
(
data
=
conv1_
,
kernel
=
(
11
,
11
),
stride
=
(
4
,
4
),
num_filter
=
96
,
no_bias
=
False
,
name
=
"conv1_"
)
kernel
=
(
11
,
11
),
stride
=
(
4
,
4
),
num_filter
=
96
,
no_bias
=
False
,
name
=
"conv1_"
)
# conv1_, output shape: {[96,53,70]}
relu1_
=
mx
.
symbol
.
Activation
(
data
=
conv1_
,
act_type
=
'relu'
,
name
=
"relu1_"
)
act_type
=
'relu'
,
name
=
"relu1_"
)
pool1_
=
mx
.
symbol
.
pad
(
data
=
relu1_
,
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
),
constant_value
=
0
)
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
),
constant_value
=
0
)
pool1_
=
mx
.
symbol
.
Pooling
(
data
=
pool1_
,
kernel
=
(
3
,
3
),
pool_type
=
"max"
,
stride
=
(
2
,
2
),
name
=
"pool1_"
)
kernel
=
(
3
,
3
),
pool_type
=
"max"
,
stride
=
(
2
,
2
),
name
=
"pool1_"
)
# pool1_, output shape: {[96,27,35]}
conv2_
=
mx
.
symbol
.
pad
(
data
=
pool1_
,
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
conv2_
=
mx
.
symbol
.
Convolution
(
data
=
conv2_
,
kernel
=
(
5
,
5
),
stride
=
(
4
,
4
),
num_filter
=
256
,
no_bias
=
False
,
name
=
"conv2_"
)
kernel
=
(
5
,
5
),
stride
=
(
4
,
4
),
num_filter
=
256
,
no_bias
=
False
,
name
=
"conv2_"
)
# conv2_, output shape: {[256,7,9]}
relu2_
=
mx
.
symbol
.
Activation
(
data
=
conv2_
,
act_type
=
'relu'
,
name
=
"relu2_"
)
act_type
=
'relu'
,
name
=
"relu2_"
)
pool2_
=
mx
.
symbol
.
pad
(
data
=
relu2_
,
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
pool2_
=
mx
.
symbol
.
Pooling
(
data
=
pool2_
,
kernel
=
(
3
,
3
),
pool_type
=
"max"
,
stride
=
(
2
,
2
),
name
=
"pool2_"
)
kernel
=
(
3
,
3
),
pool_type
=
"max"
,
stride
=
(
2
,
2
),
name
=
"pool2_"
)
# pool2_, output shape: {[256,4,5]}
conv3_
=
mx
.
symbol
.
pad
(
data
=
pool2_
,
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
conv3_
=
mx
.
symbol
.
Convolution
(
data
=
conv3_
,
kernel
=
(
3
,
3
),
stride
=
(
1
,
1
),
num_filter
=
384
,
no_bias
=
False
,
name
=
"conv3_"
)
kernel
=
(
3
,
3
),
stride
=
(
1
,
1
),
num_filter
=
384
,
no_bias
=
False
,
name
=
"conv3_"
)
# conv3_, output shape: {[384,4,5]}
relu3_
=
mx
.
symbol
.
Activation
(
data
=
conv3_
,
act_type
=
'relu'
,
name
=
"relu3_"
)
act_type
=
'relu'
,
name
=
"relu3_"
)
conv4_
=
mx
.
symbol
.
pad
(
data
=
relu3_
,
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
conv4_
=
mx
.
symbol
.
Convolution
(
data
=
conv4_
,
kernel
=
(
3
,
3
),
stride
=
(
1
,
1
),
num_filter
=
384
,
no_bias
=
False
,
name
=
"conv4_"
)
kernel
=
(
3
,
3
),
stride
=
(
1
,
1
),
num_filter
=
384
,
no_bias
=
False
,
name
=
"conv4_"
)
# conv4_, output shape: {[384,4,5]}
relu4_
=
mx
.
symbol
.
Activation
(
data
=
conv4_
,
act_type
=
'relu'
,
name
=
"relu4_"
)
act_type
=
'relu'
,
name
=
"relu4_"
)
conv5_
=
mx
.
symbol
.
pad
(
data
=
relu4_
,
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
),
constant_value
=
0
)
conv5_
=
mx
.
symbol
.
Convolution
(
data
=
conv5_
,
kernel
=
(
3
,
3
),
stride
=
(
1
,
1
),
num_filter
=
256
,
no_bias
=
False
,
name
=
"conv5_"
)
kernel
=
(
3
,
3
),
stride
=
(
1
,
1
),
num_filter
=
256
,
no_bias
=
False
,
name
=
"conv5_"
)
# conv5_, output shape: {[256,4,5]}
relu5_
=
mx
.
symbol
.
Activation
(
data
=
conv5_
,
act_type
=
'relu'
,
name
=
"relu5_"
)
act_type
=
'relu'
,
name
=
"relu5_"
)
pool5_
=
mx
.
symbol
.
pad
(
data
=
relu5_
,
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
0
,
1
,
1
),
constant_value
=
0
)
mode
=
'constant'
,
pad_width
=
(
0
,
0
,
0
,
0
,
1
,
0
,
1
,
1
),
constant_value
=
0
)
pool5_
=
mx
.
symbol
.
Pooling
(
data
=
pool5_
,
kernel
=
(
3
,
3
),
pool_type
=
"max"
,
stride
=
(
2
,
2
),
name
=
"pool5_"
)
kernel
=
(
3
,
3
),
pool_type
=
"max"
,
stride
=
(
2
,
2
),
name
=
"pool5_"
)
# pool5_, output shape: {[256,2,3]}
fc5_
=
mx
.
symbol
.
flatten
(
data
=
pool5_
)
fc5_
=
mx
.
symbol
.
FullyConnected
(
data
=
fc5_
,
num_hidden
=
4096
,
no_bias
=
False
,
name
=
"fc5_"
)
num_hidden
=
4096
,
no_bias
=
False
,
name
=
"fc5_"
)
relu6_
=
mx
.
symbol
.
Activation
(
data
=
fc5_
,
act_type
=
'relu'
,
name
=
"relu6_"
)
act_type
=
'relu'
,
name
=
"relu6_"
)
dropout6_
=
mx
.
symbol
.
Dropout
(
data
=
relu6_
,
p
=
0.5
,
name
=
"dropout6_"
)
p
=
0.5
,
name
=
"dropout6_"
)
fc6_
=
mx
.
symbol
.
FullyConnected
(
data
=
dropout6_
,
num_hidden
=
4096
,
no_bias
=
False
,
name
=
"fc6_"
)
num_hidden
=
4096
,
no_bias
=
False
,
name
=
"fc6_"
)
relu7_
=
mx
.
symbol
.
Activation
(
data
=
fc6_
,
act_type
=
'relu'
,
name
=
"relu7_"
)
act_type
=
'relu'
,
name
=
"relu7_"
)
dropout7_
=
mx
.
symbol
.
Dropout
(
data
=
relu7_
,
p
=
0.5
,
name
=
"dropout7_"
)
p
=
0.5
,
name
=
"dropout7_"
)
fc7_
=
mx
.
symbol
.
FullyConnected
(
data
=
dropout7_
,
num_hidden
=
13
,
no_bias
=
Fals
e
,
name
=
"fc7_"
)
num_hidden
=
14
,
no_bias
=
Tru
e
,
name
=
"fc7_"
)
predictions
=
mx
.
symbol
.
LinearRegressionOutput
(
data
=
fc7_
,
name
=
"predictions"
)
name
=
"predictions"
)
self
.
module
=
mx
.
mod
.
Module
(
symbol
=
mx
.
symbol
.
Group
([
predictions
]),
data_names
=
self
.
_input_names_
,
label_names
=
self
.
_output_names_
,
context
=
context
)
data_names
=
self
.
_input_names_
,
label_names
=
self
.
_output_names_
,
context
=
context
)
print
(
"start viz"
)
graph
=
mx
.
viz
.
plot_network
(
predictions
,
shape
=
{
'image'
:(
0
,
3
,
210
,
280
),
'predictions_label'
:(
0
,
14
)},
node_attrs
=
{
"shape"
:
'rect'
,
"fixedsize"
:
'false'
})
# graph.format = 'png'
graph
.
render
(
'graph'
)
GeneratedCNNCode/CNNCreator_dpnet.pyc
0 → 100644
View file @
65bfd1fd
File added
GeneratedCNNCode/CNNTrainer_Dpnet.py
View file @
65bfd1fd
...
...
@@ -10,10 +10,16 @@ if __name__ == "__main__":
dpnet
=
CNNCreator_dpnet
.
CNNCreator_dpnet
()
dpnet
.
train
(
batch_size
=
64
,
num_epoch
=
5
,
batch_size
=
64
,
num_epoch
=
100
,
context
=
'cpu'
,
normalize
=
True
,
optimizer
=
'sgd'
,
optimizer_params
=
{
'learning_rate'
:
0.01
}
'weight_decay'
:
5.0E-4
,
'learning_rate'
:
0.01
}
)
GeneratedCNNCode/leveldb_to_hdf5.py
View file @
65bfd1fd
...
...
@@ -7,9 +7,10 @@ import plyvel
import
tarfile
import
os
ARCHIVE
=
True
CHUNK_SIZE
=
10000
LEVELDB_PATH
=
"/media/sveta/4991e634-dd81-4cb9-bf46-2fa9c7159263/TORCS_Training_1F"
HDF5_PATH
=
"/media/sveta/4991e634-dd81-4cb9-bf46-2fa9c7159263/TORCS_HDF5"
HDF5_PATH
=
"/media/sveta/4991e634-dd81-4cb9-bf46-2fa9c7159263/TORCS_HDF5
_2
"
def
main
():
...
...
@@ -47,17 +48,18 @@ def write_to_hdf5(images, indicators, file_idx, start_date):
f
.
close
()
print
(
"Finished dumping to file "
+
filename
)
init_end_date
=
datetime
.
datetime
.
now
()
elapsed_time
=
init_end_date
-
start_date
print
(
"Dumping took "
+
str
(
elapsed_time
))
# archive and remove original file
tar
=
tarfile
.
open
(
filename
+
".tar.bz2"
,
'w:bz2'
)
os
.
chdir
(
HDF5_PATH
)
tar
.
add
(
"train_"
+
str
(
file_idx
)
+
".h5"
)
tar
.
close
()
os
.
remove
(
filename
)
if
ARCHIVE
:
# archive and remove original file
tar
=
tarfile
.
open
(
filename
+
".tar.bz2"
,
'w:bz2'
)
os
.
chdir
(
HDF5_PATH
)
tar
.
add
(
"train_"
+
str
(
file_idx
)
+
".h5"
)
tar
.
close
()
os
.
remove
(
filename
)
current_time
=
datetime
.
datetime
.
now
()
elapsed_time
=
current_time
-
start_date
print
(
"Finished archiving. Total time spent: "
+
str
(
elapsed_time
))
def
normalize
(
indicators
):
...
...
GeneratedCNNCode/requirements.txt
View file @
65bfd1fd
...
...
@@ -4,4 +4,5 @@ scikit-image
protobuf
leveldb
tables
glog
\ No newline at end of file
glog
mxnet
\ No newline at end of file
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Affordance.struct
View file @
65bfd1fd
...
...
@@ -3,21 +3,21 @@ package dp.subcomponents;
struct
Affordance
{
Q
(-
0.5
rad
:
0.001
rad
:
0.5
rad
)
angle
;
Q
(-
7
m
:
0.01
m
:-
2.5
m
)
toMarkingL
;
Q
(-
2
m
:
0.01
m
:
3.5
m
)
toMarkingM
;
Q
(
2.5
m
:
0.01
m
:
7
m
)
toMarkingR
;
Q
(
0
m
:
0.1
m
:
75
m
)
distL
;
Q
(
0
m
:
0.1
m
:
75
m
)
distR
;
Q
(-
7
m
:
0.01
m
:
-
2.5
m
)
toMarkingL
;
Q
(-
2
m
:
0.01
m
:
3.5
m
)
toMarkingM
;
Q
(
2.5
m
:
0.01
m
:
7
m
)
toMarkingR
;
Q
(
0
m
:
0.1
m
:
75
m
)
distL
;
Q
(
0
m
:
0.1
m
:
75
m
)
distR
;
Q
(-
9.5
m
:
0.01
m
:-
4
m
)
toMarkingLL
;
Q
(-
5.5
m
:
0.01
m
:-
0.5
m
)
toMarkingML
;
Q
(
0.5
m
:
0.01
m
:
5.5
m
)
toMarkingMR
;
Q
(
4
m
:
0.01
m
:
9.5
m
)
toMarkingRR
;
Q
(
0
m
:
0.1
m
:
75
m
)
distLL
;
Q
(
0
m
:
0.1
m
:
75
m
)
distMM
;
Q
(
0
m
:
0.1
m
:
75
m
)
distRR
;
Q
(-
9.5
m
:
0.01
m
:
-
4
m
)
toMarkingLL
;
Q
(-
5.5
m
:
0.01
m
:
-
0.5
m
)
toMarkingML
;
Q
(
0.5
m
:
0.01
m
:
5.5
m
)
toMarkingMR
;
Q
(
4
m
:
0.01
m
:
9.5
m
)
toMarkingRR
;
Q
(
0
m
:
0.1
m
:
75
m
)
distLL
;
Q
(
0
m
:
0.1
m
:
75
m
)
distMM
;
Q
(
0
m
:
0.1
m
:
75
m
)
distRR
;
Q
(
0
:
0.1
:
1
)
fast
;
Q
(
0
:
0.1
:
1
)
fast
;
}
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Dpnet.cnnt
View file @
65bfd1fd
...
...
@@ -2,6 +2,7 @@ configuration Dpnet{
num_epoch : 100
batch_size : 64
context:cpu
normalize:true
optimizer : sgd{
learning_rate : 0.01
}
...
...
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Dpnet.emadl
View file @
65bfd1fd
...
...
@@ -2,7 +2,7 @@ package dp.subcomponents;
component
Dpnet
{
ports
in
Z
(
0
:
255
)^{
3
,
210
,
280
}
image
,
out
Q
(
0
:
1
)^{
14
,
1
,
1
}
predictions
;
out
Q
(
-
oo
:
oo
)^{
14
,
1
,
1
}
predictions
;
implementation
CNN
{
...
...
@@ -25,8 +25,8 @@ component Dpnet{
conv
(
kernel
=(
3
,
3
),
channels
=
256
)
->
fc
()
->
fc
()
->
FullyConnected
(
units
=
13
)
->
Sigmoid
()
->
FullyConnected
(
units
=
14
,
no_bias
=
true
)
->
predictions
}
}
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Unnormalizer.emadl
View file @
65bfd1fd
...
...
@@ -5,66 +5,66 @@ component Unnormalizer {
out
Affordance
affordance
;
implementation
Math
{
oldMin
=
0.1
oldMax
=
0.9
oldRange
=
oldMax
-
oldMin
Q
oldMin
=
0.1
;
Q
oldMax
=
0.9
;
Q
oldRange
=
oldMax
-
oldMin
;
newMin
=
-
0.5
newMax
=
0.5
newRange
=
newMax
-
newMin
affordance
.
angle
=
(((
normalizedPredictions
(
0
,
0
,
0
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
-
7
newMax
=
-
2.5
newRange
=
newMax
-
newMin
affordance
.
toMarkingL
=
(((
normalizedPredictions
(
0
,
0
,
1
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
-
2
newMax
=
3.5
newRange
=
newMax
-
newMin
affordance
.
toMarkingM
=
(((
normalizedPredictions
(
0
,
0
,
2
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
2.5
newMax
=
7
newRange
=
newMax
-
newMin
affordance
.
toMarkingR
=
(((
normalizedPredictions
(
0
,
0
,
3
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
0
newMax
=
75
newRange
=
newMax
-
newMin
affordance
.
distL
=
(((
normalizedPredictions
(
0
,
0
,
4
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
affordance
.
distR
=
(((
normalizedPredictions
(
0
,
0
,
5
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
-
9.5
newMax
=
-
4
newRange
=
newMax
-
newMin
affordance
.
toMarkingLL
=
(((
normalizedPredictions
(
0
,
0
,
6
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
Q
newMin
=
-
0.5
;
Q
newMax
=
0.5
;
Q
newRange
=
newMax
-
newMin
;
affordance
.
angle
=
(((
normalizedPredictions
(
0
,
0
,
0
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
;
newMin
=
-
5.5
newMax
=
-
0.5
newRange
=
newMax
-
newMin
affordance
.
toMarkingML
=
(((
normalizedPredictions
(
0
,
0
,
7
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
0.5
newMax
=
5.5
newRange
=
newMax
-
newMin
affordance
.
toMarkingMR
=
(((
normalizedPredictions
(
0
,
0
,
8
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
-
7
;
newMax
=
-
2.5
;
newRange
=
newMax
-
newMin
;
affordance
.
toMarkingL
=
(((
normalizedPredictions
(
0
,
0
,
1
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
;
newMin
=
4
newMax
=
9.5
newRange
=
newMax
-
newMin
affordance
.
toMarkingRR
=
(((
normalizedPredictions
(
0
,
0
,
9
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
0
newMax
=
75
newRange
=
newMax
-
newMin
affordance
.
distLL
=
(((
normalizedPredictions
(
0
,
0
,
10
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
affordance
.
distMM
=
(((
normalizedPredictions
(
0
,
0
,
11
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
affordance
.
distRR
=
(((
normalizedPredictions
(
0
,
0
,
12
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
-
2
;
newMax
=
3.5
;
newRange
=
newMax
-
newMin
;
affordance
.
toMarkingM
=
(((
normalizedPredictions
(
0
,
0
,
2
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
;
newMin
=
0
newMax
=
1
newRange
=
newMax
-
newMin
affordance
.
fast
=
(((
normalizedPredictions
(
0
,
0
,
13
)
-
oldMin
)
*
newRange
)
/
oldRange
)
+
newMin
newMin
=
2.5
;
newMax
=
7
;
newRange
=
newMax
-
newMin
;
affordance
.
toMarkingR
=
(((
normalized