Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keras interface and Python 3 compatability #3

Merged
merged 16 commits into from
Dec 5, 2017
Merged

Keras interface and Python 3 compatability #3

merged 16 commits into from
Dec 5, 2017

Conversation

henryre
Copy link
Member

@henryre henryre commented Dec 5, 2017

Also adds a pretrained CIFAR-10 model

@henryre henryre requested a review from ajratner December 5, 2017 22:05
Copy link
Contributor

@ajratner ajratner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just see a few comments

README.md Outdated
## NEW: an easy-to-use Keras interface

Just in time for NIPS 2017, we're releasing an easy-to-use
[Keras](https://keras.io/) interface for TANDA. Just train your TAN, load the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: "Just train your TAN...": I'd say let's lead with a one line (bolded and red?) about Keras interface + pre-trained TAN. Then mention can be used with any TAN you train / is implied

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest something like: "Just in time for NIPS 2017, we're releasing an easy-to-use, pre-trained substitute for Keras' ImageDataGenerator data augmentation class. Just swap in TANDAImageDataGenerator and you'll be using our trained data augmentation generators!"

@@ -1,6 +1,6 @@
#!/bin/bash
source set_env.sh
python experiments/cifar10/train.py \
python -m experiments.cifar10.train \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fancy


def load_cifar10_batch(fpath, one_hot=True, as_float=True):
with open(fpath, 'rb') as f:
data = cPickle.load(f)
data = cPickle.load(f, encoding='latin1')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many stacks overflowed here. Just let it be.

self.tan = tan
self.session = K.get_session()

def random_transform(self, x, seed=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Update doc string just to clarify that this is not in fact a random transform anymore, just maintaining same interface?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On it

"""

def __init__(self,
tan,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaner to just provide the checkpoint path I think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard disagree

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Offline: can either be checkpoint path or TAN object

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Offline: create #4

from experiments.train_scripts import GENERATORS
from experiments.utils import parse_config_str
from keras import backend as K
from tanda.generator import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit cleaner than redefining IMO

@ajratner
Copy link
Contributor

ajratner commented Dec 5, 2017 via email

@henryre henryre merged commit 460a7f6 into master Dec 5, 2017
@henryre henryre deleted the gen branch December 5, 2017 23:10
jdunnmon pushed a commit to jdunnmon/tanda that referenced this pull request Dec 25, 2017
Keras interface and Python 3 compatability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants