* 'master' of github.com:charlesreid1/lfw_fuel:
Fix import statement and argument name to match latest Keras API.
Update example LFW CNN to use latest Keras API. → → Pretty sure these are not equivalent, but I had some trouble → understanding the prior conv. neural network, so I did my best → to come up with a one-to-one translation. Since it is just a → lightweight example, no biggie smalls.
Update map() call to work with Python 2 or Python 3.
If CSV file is opened/read using bytes flag, it causes this error:
_csv.Error: iterator should return strings, not bytes (did you open the
file in text mode?)
Python 3 will not do any decoding when reading the file as bytes ('rb').
Relevant documentation:
https://docs.python.org/3.6/library/functions.html#open
This change has been tested against both Python 2 and Python 3
and works with both.
→
→ Pretty sure these are not equivalent, but I had some trouble
→ understanding the prior conv. neural network, so I did my best
→ to come up with a one-to-one translation. Since it is just a
→ lightweight example, no biggie smalls.
The map() call that applies the crop function to the training data
is automatically applied on the fly in Python 2,
but returns a generator in Python 3.
This creates problems when converting the resulting function map
to a numpy array - the numpy array is empty in Python 3.
This fixes the problem by explicitly converting the generator
to a list. This is about as fast as pre-allocating an empty numpy array
and populating it in a for loop. See https://gist.github.com/charlesreid1/436c51eae1e6a0d011d86f3796dec853
Cosmetic changes to fuel hooks that should allow
lfw_fuel dataset to be downloaded and converted
by fuel-download and fuel-convert directly in
an upcoming fuel release.
Reworked the main lfw.py file to build test/train
datasets based on trainPairs and testPairs. Also
updated scripts so that any one of (original) lfw,
lfw funneled, or lfw deepfunneled can be built.
Added an example of using lfw in keras with
kerosene dataset hook.
For various reasons, it's a good idea to have an empty first commit in
a git repo.
Here's some background reading...
http://stackoverflow.com/questions/645450/git-how-to-insert-a-commit-as-the-
Basically this can make rewriting the history much easier later.
I also generally will turn back the time on this commit to
make sure it is always the oldest.
I'm following the procedure here:
http://kevin.deldycke.com/2010/05/initialize-git-repositories/
But note that git will refuse to parse dates that far back into the
past! See this:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625480
So the usable git epoch is 1970 + 100000000 seconds, which is
Sat, 03 Mar 1973 09:46:40 GMT
That's too nutty. So I'll just use Jan 1st, 1974 instead.
So the final process is:
git init
git commit --allow-empty # <empty root commit - you are here!>
git tag "epoch"
export GIT_TMP_INIT_HASH=`git show-ref epoch | cut -d ' ' -f 1`
git filter-branch --env-filter '
if [ $GIT_COMMIT = $GIT_TMP_INIT_HASH ]
then
export GIT_AUTHOR_DATE="Tue, 01 Jan 1974 00:00:00 +0000"
export GIT_COMMITTER_DATE="Tue, 01 Jan 1974 00:00:00 +0000"
fi' -- --all
unset GIT_TMP_INIT_HASH
git tag -d "epoch"
git tag -a "epoch"
Admittedly a little sloppy. Oh well.