Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
visible-light-communication
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gihan Jayatilaka
visible-light-communication
Commits
42acfff4
Commit
42acfff4
authored
Apr 16, 2019
by
Gihan Jayatilaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
visualizer-2
parent
218c3d22
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
0 deletions
+100
-0
2019-03-05 Week plan.pdf
documentation/2019-03-05 Week plan.pdf
+0
-0
2019-03-26 Deeper CNNs.pdf
documentation/2019-03-26 Deeper CNNs.pdf
+0
-0
2019-04-02 Inception V3.pdf
documentation/2019-04-02 Inception V3.pdf
+0
-0
2019-04-08 Inception V3.pdf
documentation/2019-04-08 Inception V3.pdf
+0
-0
visualize-2.py
utilities/visualize-2.py
+100
-0
No files found.
documentation/2019-03-05 Week plan.pdf
0 → 100644
View file @
42acfff4
File added
documentation/2019-03-26 Deeper CNNs.pdf
0 → 100644
View file @
42acfff4
File added
documentation/2019-04-02 Inception V3.pdf
0 → 100644
View file @
42acfff4
File added
documentation/2019-04-08 Inception V3.pdf
0 → 100644
View file @
42acfff4
File added
utilities/visualize-2.py
0 → 100644
View file @
42acfff4
#python visualize-2.py results-video.npz
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
sys
import
math
import
scipy.signal
CELLS_PER_FRAME
=
0
SQRT_CELLS
=
0
if
__name__
==
'__main__'
:
RESULT_FILE_NAME
=
sys
.
argv
[
1
]
CELLS_PER_FRAME
=
(
int
(
sys
.
argv
[
2
]))
SQRT_CELLS
=
math
.
sqrt
(
CELLS_PER_FRAME
)
data
=
np
.
load
(
RESULT_FILE_NAME
)
def
countMisses
(
yTrue
,
yPred
,
windowH
,
windowW
):
global
SQRT_CELLS
truePred
=
np
.
zeros
(
shape
=
(
windowH
*
windowW
,
windowH
*
windowW
),
dtype
=
np
.
int32
)
yTrue
=
np
.
reshape
(
yTrue
,(
yTrue
.
shape
[
0
],
SQRT_CELLS
,
SQRT_CELLS
))
yPred
=
np
.
reshape
(
yPred
,(
yPred
.
shape
[
0
],
SQRT_CELLS
,
SQRT_CELLS
))
convKer
=
np
.
zeros
((
windowH
,
windowW
),
dtype
=
np
.
int32
)
convTrue
=
np
.
zeros
((
yTrue
.
shape
[
0
],
SQRT_CELLS
-
windowH
+
1
,
SQRT_CELLS
-
windowW
+
1
))
convPred
=
np
.
zeros
((
yPred
.
shape
[
0
],
SQRT_CELLS
-
windowH
+
1
,
SQRT_CELLS
-
windowW
+
1
))
for
f
in
range
(
yTrue
.
shape
[
0
]):
convTrue
[
f
]
=
scipy
.
signal
.
convolve2d
(
yTrue
[
f
],
convKer
,
mode
=
'valid'
)
for
f
in
range
(
yPred
.
shape
[
0
]):
convPred
[
f
]
=
scipy
.
signal
.
convolve2d
(
yPred
[
f
],
convKer
,
mode
=
'valid'
)
def
drawTrainingHistograms
(
data
):
global
SQRT_CELLS
VID
=
'cropped-tvstatic-video'
FIG_NAME
=
'{}-{}x{}-inception'
.
format
(
VID
,
SQRT_CELLS
,
SQRT_CELLS
)
TITLE
=
'{}-{}x{}->inception'
.
format
(
VID
,
SQRT_CELLS
,
SQRT_CELLS
)
CAPTION
=
" inception v3 network"
FIG_NAME
=
'./fig/'
+
FIG_NAME
+
'.png'
trc
=
data
[
'trainCost'
]
tra
=
data
[
'trainAcc'
]
tec
=
data
[
'testCost'
]
tea
=
data
[
'testAcc'
]
#print(np.array(tra)-np.array(tea))
EPOCHS
=
len
(
trc
)
e
=
range
(
EPOCHS
)
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
10
,
10
))
fig
.
subplots_adjust
(
bottom
=
0.5
,
left
=
0.2
)
ax
.
plot
(
e
,
trc
,
'r'
,
e
,
tra
,
'k'
,
e
,
tec
,
'b'
,
e
,
tea
,
'y'
)
ax
.
set_xlabel
(
'Batch iter
\n\n\n
----------------------
\n
'
+
CAPTION
,
horizontalalignment
=
'left'
,
x
=
0
)
ax
.
set_ylabel
(
"Performance"
)
plt
.
legend
([
'Train cost'
,
'Train acc'
,
'Test cost'
,
'Test acc'
])
major_ticksY
=
np
.
arange
(
0
,
1.05
,
0.2
)
minor_ticksY
=
np
.
arange
(
0
,
1.05
,
0.05
)
#ax.set_xticks(major_ticksY)
#ax.set_xticks(minor_ticksY, minor=True)
ax
.
set_yticks
(
major_ticksY
)
ax
.
set_yticks
(
minor_ticksY
,
minor
=
True
)
# And a corresponding grid
ax
.
grid
(
which
=
'both'
)
# Or if you want different settings for the grids:
ax
.
grid
(
which
=
'minor'
,
alpha
=
0.2
)
ax
.
grid
(
which
=
'major'
,
alpha
=
0.5
)
plt
.
title
(
TITLE
)
plt
.
savefig
(
FIG_NAME
,
dpi
=
1000
)
plt
.
show
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment