Skip to content

Commit

Permalink
remove keras_iris from build and update keras version
Browse files Browse the repository at this point in the history
  • Loading branch information
ukclivecox committed Oct 19, 2017
1 parent f564c71 commit e607a33
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ALL_LIST=\
seldonio_examples_ml10m \
seldonio_examples_reuters_data \
seldonio_reuters_example \
seldonio_iris_keras \
seldonio_mysql \
seldonio_grafana \
seldonio_iago \
Expand Down
3 changes: 3 additions & 0 deletions docker/examples/iris/keras/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
FROM seldonio/pyseldon:%SELDON_PYTHON_PACKAGE_VERSION%

RUN pip install theano

ENV SELDON_HOME=/home/seldon
ENV KERAS_BACKEND=theano
COPY keras_pipeline.py $SELDON_HOME/keras_pipeline.py
COPY create-json.py $SELDON_HOME/create-json.py

Expand Down
2 changes: 1 addition & 1 deletion docker/pyseldon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN pip install kazoo filechunkio Flask gunicorn pylibmc gensim annoy smart_open

RUN cd /usr/local/src && mkdir keras && cd keras && \
git clone https://github.com/fchollet/keras.git && \
cd keras && git checkout tags/0.2.0 && python setup.py install
cd keras && git checkout tags/2.0.0 && python setup.py install

# bayes_opt

Expand Down
2 changes: 1 addition & 1 deletion python/seldon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from .util import RecommenderWrapper,Recommender,Extension,ExtensionWrapper,Recommender_wrapper,Extension_wrapper

__version__ = '2.2.5'
__version__ = '2.2.6'

class NullHandler(logging.Handler):
def emit(self, record):
Expand Down
7 changes: 2 additions & 5 deletions python/seldon/keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def default_classification_model(input_width,num_classes):


class KerasClassifier(BasePandasEstimator,BaseEstimator,ClassifierMixin):
def __init__(self,model_create=default_classification_model,tmp_model="/tmp/model",target=None, target_readable=None,included=None,excluded=None,id_map={},optimizer='adam', loss='categorical_crossentropy', train_batch_size=128, test_batch_size=128, nb_epoch=100, shuffle=True, show_accuracy=False, validation_split=0, validation_data=None, callbacks=None,verbose=0):
def __init__(self,model_create=default_classification_model,tmp_model="/tmp/model",target=None, target_readable=None,included=None,excluded=None,id_map={},optimizer='adam', loss='categorical_crossentropy', train_batch_size=128, test_batch_size=128, nb_epoch=100, shuffle=True, validation_split=0, validation_data=None, callbacks=None,verbose=0):
"""
Wrapper for keras with pandas support
Derived from https://github.com/fchollet/keras/blob/master/keras/wrappers/scikit_learn.py
Expand Down Expand Up @@ -64,8 +64,6 @@ def __init__(self,model_create=default_classification_model,tmp_model="/tmp/mode
Number of training epochs.
shuffle : boolean, optional
Wheter to shuffle the samples at each epoch.
show_accuracy : boolean, optional
Whether to display class accuracy in the logs at each epoch.
validation_split : float [0, 1], optional
Fraction of the data to use as held-out validation data.
validation_data : tuple (X, y), optional
Expand Down Expand Up @@ -94,7 +92,6 @@ def __init__(self,model_create=default_classification_model,tmp_model="/tmp/mode
self.test_batch_size=test_batch_size
self.nb_epoch=nb_epoch
self.shuffle=shuffle
self.show_accuracy=show_accuracy
self.validation_split=validation_split
self.validation_data=validation_data
self.callbacks = [] if callbacks is None else callbacks
Expand Down Expand Up @@ -165,7 +162,7 @@ class labels
self.compiled_model_.compile(optimizer=self.optimizer, loss=self.loss)
history = self.compiled_model_.fit(
X, y, batch_size=self.train_batch_size, nb_epoch=self.nb_epoch, verbose=self.verbose,
shuffle=self.shuffle, show_accuracy=self.show_accuracy,
shuffle=self.shuffle,
validation_split=self.validation_split, validation_data=self.validation_data,
callbacks=self.callbacks)

Expand Down

0 comments on commit e607a33

Please sign in to comment.