Skip to content

Overview of All Changes in TFTransformer PRs #12

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

Open
wants to merge 103 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
42c6e6e
flat param API impl
phi-dbq Aug 8, 2017
ecbefb9
support input graph scenarios
phi-dbq Aug 25, 2017
ab89bd2
(WIP) new interface implementation
phi-dbq Sep 9, 2017
8c7d72e
docs and cleanup
phi-dbq Sep 9, 2017
eb543c6
using tensorflow API instead of our utilities
phi-dbq Sep 10, 2017
4743bb9
automatic type conversion
phi-dbq Sep 10, 2017
622c788
cleanup
phi-dbq Sep 10, 2017
07f1cec
PR comments
phi-dbq Sep 11, 2017
692b0eb
(WIP) address comments
phi-dbq Sep 12, 2017
66d44e9
(WIP) respond to PR comments
phi-dbq Sep 13, 2017
9b3fe86
test refactor
phi-dbq Sep 13, 2017
8c32501
Merge remote-tracking branch 'upstream/master' into tf-1d-transformer
phi-dbq Sep 16, 2017
dbd9aaa
(wip) consolidating params
phi-dbq Sep 16, 2017
4572205
rebase upstream
phi-dbq Sep 16, 2017
1cc7591
import params fix
phi-dbq Sep 16, 2017
2fc6787
(wip) TFInputGraph impl
phi-dbq Sep 16, 2017
889df0a
(wip) moving to new API
phi-dbq Sep 17, 2017
86cd6d9
(wip) enable saved_model tests
phi-dbq Sep 17, 2017
ac09182
(wip) enable checkpoint test
phi-dbq Sep 17, 2017
6b22eed
(wip) enable multiple tensor tests
phi-dbq Sep 17, 2017
a3517d6
enable all tests
phi-dbq Sep 17, 2017
457a4c2
params and converters
phi-dbq Sep 18, 2017
323939a
tests
phi-dbq Sep 18, 2017
6e46073
Merge branch 'tf-transformer-part1' into api-tf-transformer
phi-dbq Sep 18, 2017
b232b3c
optimize graph for inference
phi-dbq Sep 18, 2017
d921366
more tests
phi-dbq Sep 19, 2017
0c8c219
update utils
phi-dbq Sep 19, 2017
522279a
tests
phi-dbq Sep 19, 2017
f4d938c
intro: TFInputGraph
phi-dbq Sep 19, 2017
cd3aa8d
tests
phi-dbq Sep 19, 2017
97b25c6
Baseline
phi-dbq Sep 21, 2017
07c58e6
allows setting TFInputGraph
phi-dbq Sep 21, 2017
269ad15
utilize test_input_graph for transformer tests
phi-dbq Sep 21, 2017
84a8138
enable all tests
phi-dbq Sep 21, 2017
7287ab7
fix style
phi-dbq Sep 21, 2017
467480e
Merge branch 'tf-transformer-part1' into tf-transformer-part2
phi-dbq Sep 21, 2017
4f11374
fix style
phi-dbq Sep 21, 2017
27f0617
Merge branch 'tf-transformer-part1' into tf-transformer-part2
phi-dbq Sep 21, 2017
7b6ec3a
autogen test cases
phi-dbq Sep 21, 2017
561f8e7
test refactoring
phi-dbq Sep 22, 2017
7248517
further refactor
phi-dbq Sep 23, 2017
2e8f7a1
Merge branch 'tf-transformer-part1' into tf-transformer-part3
phi-dbq Sep 23, 2017
e09027f
Merge branch 'tf-transformer-part1' into tf-transformer-part3
phi-dbq Sep 23, 2017
40caace
and so there is no helper classes
phi-dbq Sep 23, 2017
93e659d
Merge branch 'tf-transformer-part1' into tf-transformer-part2
phi-dbq Sep 23, 2017
6e880ce
Merge branch 'tf-transformer-part3' into tf-transformer-part4
phi-dbq Sep 23, 2017
883321e
input graph
phi-dbq Sep 23, 2017
c72444b
docs
phi-dbq Sep 23, 2017
e963d11
and into more pieces
phi-dbq Sep 23, 2017
89e2a1d
Merge branch 'tf-transformer-part3' into tf-transformer-part4
phi-dbq Sep 23, 2017
f7a7d38
update converter and test cases
phi-dbq Sep 25, 2017
ce60629
class & docs
phi-dbq Sep 25, 2017
e0cf2ff
update docs
phi-dbq Sep 25, 2017
fcabcb6
using `parameterized` to simplify testing logic
phi-dbq Sep 25, 2017
77b3906
converter changes
phi-dbq Sep 26, 2017
76e9fb9
PR comments
phi-dbq Sep 28, 2017
66507f4
tf_image inputTensor default setter bug-fix
phi-dbq Sep 29, 2017
d239a5a
use type error, always
phi-dbq Sep 29, 2017
5947c9c
doc updates
phi-dbq Sep 29, 2017
f8d7930
Merge branch 'tf-transformer-part1' into tf-transformer-part2
phi-dbq Sep 29, 2017
202e7ea
refactoring tfx API
phi-dbq Sep 29, 2017
faf8cdd
Merge branch 'tf-transformer-part2' into tf-transformer-part3
phi-dbq Sep 29, 2017
6aa85b9
Merge branch 'tf-transformer-part3' into tf-transformer-part4
phi-dbq Sep 29, 2017
aef1661
refactoring tfx API
phi-dbq Sep 29, 2017
ead1ed6
test refactoring
phi-dbq Sep 29, 2017
cf72beb
Merge branch 'tf-transformer-part2' into tf-transformer-part3
phi-dbq Sep 29, 2017
20e2dbc
update tfx utils usage
phi-dbq Sep 29, 2017
20a5346
one way to build these tests
phi-dbq Sep 29, 2017
cf64708
tests refactored
phi-dbq Sep 30, 2017
c3b3a86
test cases in a single class
phi-dbq Sep 30, 2017
e47060f
shuffle things around
phi-dbq Sep 30, 2017
4e8f4e3
docs mostly
phi-dbq Sep 30, 2017
eaa5fa0
yapf'd
phi-dbq Sep 30, 2017
43d6583
consolidate tempdir creation
phi-dbq Oct 2, 2017
8b75d44
Address PR comments
phi-dbq Oct 2, 2017
055ce14
PR comments
phi-dbq Oct 2, 2017
2d48b32
(wip) utils test
phi-dbq Oct 2, 2017
742cdaf
a few more tests for utils
phi-dbq Oct 2, 2017
f0912fb
test update cont'd
phi-dbq Oct 2, 2017
ee3acf1
Merge branch 'tf-transformer-part2' into tf-transformer-part3
phi-dbq Oct 3, 2017
7f16396
Merge branch 'tf-transformer-part1' into tf-transformer-part3
phi-dbq Oct 3, 2017
f5107ad
(wip) PR comments
phi-dbq Oct 3, 2017
ac681b0
more tests
phi-dbq Oct 3, 2017
4d173c5
change test generator module name
phi-dbq Oct 3, 2017
85e0778
Merge branch 'tf-transformer-part3' into tf-transformer-part4
phi-dbq Oct 3, 2017
22754c9
tensor tests
phi-dbq Oct 3, 2017
0144b8c
tensor test update
phi-dbq Oct 3, 2017
a8531ec
buildCheckList name change and doc fixup
phi-dbq Oct 3, 2017
3c849f2
Merge branch 'tf-transformer-part1' into tf-transformer-part2
phi-dbq Oct 3, 2017
707697d
Merge branch 'tf-transformer-part2' into tf-transformer-part3
phi-dbq Oct 3, 2017
c6eb87c
Merge branch 'tf-transformer-part3' into tf-transformer-part4
phi-dbq Oct 3, 2017
d729528
PR comments
phi-dbq Oct 4, 2017
0c2eda1
PR comments
phi-dbq Oct 4, 2017
63967b4
PR comments
phi-dbq Oct 5, 2017
fe719b2
Merge branch 'tf-transformer-part2' into tf-transformer-part3
phi-dbq Oct 5, 2017
812f4d6
Merge branch 'tf-transformer-part3' into tf-transformer-part4
phi-dbq Oct 5, 2017
47d497c
TFTransformer Part-4 Test Refactor (#15)
phi-dbq Nov 18, 2017
a39b6d3
TFTransformer Part-3 Test Refactor (#14)
thunterdb Nov 18, 2017
07cc335
deleting original testing ideas
phi-dbq Nov 18, 2017
925fc0d
Merge branch 'tf-transformer-part3' into tf-transformer-part4
phi-dbq Nov 18, 2017
decdc8f
PR comments
phi-dbq Nov 22, 2017
91b9379
Merge branch 'tf-transformer-part3' into tf-transformer-part4
phi-dbq Nov 22, 2017
af95b74
PR comments
phi-dbq Nov 22, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions python/docs/sparkdl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ Subpackages

.. toctree::

sparkdl.estimators
sparkdl.graph
sparkdl.image
sparkdl.param
sparkdl.transformers
sparkdl.udf
sparkdl.utils
Expand Down
1 change: 1 addition & 0 deletions python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ h5py>=2.7.0
keras==2.0.4 # NOTE: this package has only been tested with keras 2.0.4 and may not work with other releases
nose>=1.3.7 # for testing
numpy>=1.11.2
parameterized>=0.6.1 # for testing
pillow>=4.1.1,<4.2
pygments>=2.2.0
tensorflow==1.3.0
Expand Down
8 changes: 5 additions & 3 deletions python/sparkdl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@
# limitations under the License.
#

from .graph.input import TFInputGraph
from .image.imageIO import imageSchema, imageType, readImages
from .transformers.keras_image import KerasImageFileTransformer
from .transformers.named_image import DeepImagePredictor, DeepImageFeaturizer
from .transformers.tf_image import TFImageTransformer
from .transformers.tf_tensor import TFTransformer
from .transformers.utils import imageInputPlaceholder


__all__ = [
'imageSchema', 'imageType', 'readImages',
'TFImageTransformer',
'DeepImagePredictor', 'DeepImageFeaturizer',
'KerasImageFileTransformer',
'TFImageTransformer', 'TFInputGraph', 'TFTransformer',
'DeepImagePredictor', 'DeepImageFeaturizer', 'KerasImageFileTransformer',
'imageInputPlaceholder']
18 changes: 9 additions & 9 deletions python/sparkdl/graph/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@ def __init__(self, graph=None, using_keras=False):
self.graph = graph or tf.Graph()
self.sess = tf.Session(graph=self.graph)
if using_keras:
self.using_keras = True
self.keras_prev_sess = K.get_session()
else:
self.using_keras = False
self.keras_prev_sess = None

def __enter__(self):
self.sess.as_default()
self.sess.__enter__()
if self.keras_prev_sess is not None:
if self.using_keras:
K.set_session(self.sess)
return self

def __exit__(self, *args):
if self.keras_prev_sess is not None:
if self.using_keras:
K.set_session(self.keras_prev_sess)
self.sess.__exit__(*args)

Expand Down Expand Up @@ -87,8 +88,8 @@ def asGraphFunction(self, inputs, outputs, strip_and_freeze=True):
else:
gdef = self.graph.as_graph_def(add_shapes=True)
return GraphFunction(graph_def=gdef,
input_names=[tfx.validated_input(self.graph, elem) for elem in inputs],
output_names=[tfx.validated_output(self.graph, elem) for elem in outputs])
input_names=[tfx.validated_input(elem, self.graph) for elem in inputs],
output_names=[tfx.validated_output(elem, self.graph) for elem in outputs])

def importGraphFunction(self, gfn, input_map=None, prefix="GFN-IMPORT", **gdef_kargs):
"""
Expand Down Expand Up @@ -130,8 +131,8 @@ def importGraphFunction(self, gfn, input_map=None, prefix="GFN-IMPORT", **gdef_k
return_elements=gfn.output_names,
name=scope_name,
**gdef_kargs)
feeds = [tfx.get_tensor(self.graph, name) for name in input_names]
fetches = [tfx.get_tensor(self.graph, name) for name in output_names]
feeds = [tfx.get_tensor(name, self.graph) for name in input_names]
fetches = [tfx.get_tensor(name, self.graph) for name in output_names]
return (feeds, fetches)


Expand Down Expand Up @@ -233,7 +234,7 @@ def fromList(cls, functions):
_, first_gfn = functions[0]
feeds, _ = issn.importGraphFunction(first_gfn, prefix='')
for tnsr in feeds:
name = tfx.op_name(issn.graph, tnsr)
name = tfx.op_name(tnsr, issn.graph)
first_input_info.append((tnsr.dtype, tnsr.shape, name))
# TODO: make sure that this graph is not reused to prevent name conflict
# Report error if the graph is not manipulated by anyone else
Expand Down Expand Up @@ -268,4 +269,3 @@ def fromList(cls, functions):
gfn = issn.asGraphFunction(first_inputs, last_outputs)

return gfn

Loading