Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
navipy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olivier Bertrand
navipy
Commits
d8e95281
Commit
d8e95281
authored
7 years ago
by
Olivier Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Add example on navipy
parent
99775986
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/source/example/comparing/ridf.py
+33
-0
33 additions, 0 deletions
doc/source/example/comparing/ridf.py
navipy/comparing/__init__.py
+4
-3
4 additions, 3 deletions
navipy/comparing/__init__.py
todo
+1
-37
1 addition, 37 deletions
todo
with
38 additions
and
40 deletions
doc/source/example/comparing/ridf.py
0 → 100644
+
33
−
0
View file @
d8e95281
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
navipy.database
import
DataBaseLoad
from
navipy.comparing
import
rot_imagediff
import
pkg_resources
# 1) Connect to the database
mydb_filename
=
pkg_resources
.
resource_filename
(
'
navipy
'
,
'
resources/database.db
'
)
mydb
=
DataBaseLoad
(
mydb_filename
)
# 2) Define the position-orinetation at which
# we want the image and get the scene
rowid
=
12
my_scene_memory
=
mydb
.
scene
(
rowid
=
rowid
)
rowid
=
1
my_scene_current
=
mydb
.
scene
(
rowid
=
rowid
)
# Calculate image rot diff
rotdf
=
rot_imagediff
(
my_scene_current
,
my_scene_memory
)
rotdf
=
np
.
roll
(
rotdf
,
180
,
axis
=
0
)
f
,
axarr
=
plt
.
subplots
(
1
,
2
,
figsize
=
(
15
,
4
))
for
chan_i
,
chan_n
in
enumerate
(
mydb
.
channels
):
if
chan_n
==
'
D
'
:
color
=
'
k
'
ax
=
axarr
[
1
]
else
:
color
=
chan_n
ax
=
axarr
[
0
]
ax
.
plot
(
rotdf
[:,
chan_i
],
color
=
color
)
f
.
show
()
This diff is collapsed.
Click to expand it.
navipy/comparing/__init__.py
+
4
−
3
View file @
d8e95281
...
...
@@ -48,9 +48,6 @@ the current and memorised place code
:returns: the image difference
:rtype: float #array(1,4) for ibpc and float for obpc
..ref: Zeil, J., 2012. Visual homing: an insect perspective.
Current opinion in neurobiology
"""
simple_diff
=
simple_imagediff
(
current
,
memory
)
diff
=
np
.
power
(
simple_diff
,
2
)
...
...
@@ -76,6 +73,10 @@ the current and memorised place code.
..note: assume that the image is periodic along the x axis
(the left-right axis)
.. literalinclude:: example/comparing/ridf.py
:lines: 4,20
.. plot:: example/comparing/ridf.py
"""
if
not
is_ibpc
(
current
):
# and not is_obpc(current):
raise
TypeError
(
'
The current and memory place code
\
...
...
This diff is collapsed.
Click to expand it.
todo
+
1
−
37
View file @
d8e95281
...
...
@@ -32,40 +32,4 @@
3. Ring-attractor (Goldschmidt 2017)
4. Ring-attractor (Stone 2017)
------------------------------------------------------
Are those below still to do ?
------------------------------------------------------
0003: Improve database
In the init database I would like to use class properties instead of get/read
line: 263,273,and 394
def create(self)
should be replaced by:
@property
def create(self)
It implies that at every point that self.create() is called should be changed to self.create [Note the absence of parenthesis]
line: 298
def get_posorients(self)
should be replaced by
@property
def posorients(self)
Need to propagate the changes through all the code (see rendering / processing / moving )
Should be done, but maybe I missed something?
------------------------------------------------------
0005: Write test function for raise Error
- for every raise error create a test function, checking that the error is correctly thrown (see moving/test_agent for inspiration)
also should be done. But I did not add any more checks to the moving part, shall I check for additional possible checks?
--------------------------------------------------------------------
0009: can the last dimension (4) of the place-code be greater 1? (should be 1)
Yes it can, see apcv a [1x1x1x3] array
0010: what is the image in the database? must it be transformed to a a scene?
The image is an image, and distance the distance. I added scene as a join image+distance array
now we do not have a read_image function in database anymore, is it supposed to be like this?
0005: Change output of comparing to be consistent with place code
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment