From 630ac84cc4f99928a6faee25a73d1e9fee0bdc48 Mon Sep 17 00:00:00 2001 From: deansher Date: Wed, 14 Oct 2020 08:28:22 -0400 Subject: [PATCH 1/2] Remove keras package. In issue #109, we decided to work toward a single framework API for now. --- README.md | 35 ++++--- pom.xml | 13 --- tensorflow-keras/pom.xml | 99 ------------------- .../org/tensorflow/keras/package-info.java | 1 - .../org/tensorflow/keras/package-info.java | 1 - 5 files changed, 22 insertions(+), 127 deletions(-) delete mode 100644 tensorflow-keras/pom.xml delete mode 100644 tensorflow-keras/src/main/java/org/tensorflow/keras/package-info.java delete mode 100644 tensorflow-keras/src/test/java/org/tensorflow/keras/package-info.java diff --git a/README.md b/README.md index 1270382a98c..75a743cb0ec 100644 --- a/README.md +++ b/README.md @@ -24,24 +24,33 @@ The following describes the layout of the repository and its different artifacts TensorFlow and just want a thin layer to access the TensorFlow runtime from the JVM * `tensorflow-framework` - * Complete but fairly primitive API for building and training neural networks with TensorFlow - * Intended audience: expert neural network developers who prefer to make explicit, detailed decisions - about their models and training algorithms - -* `tensorflow-keras` (early WIP; only defined in `dev` profile) - * Partially covers the framework API to allow simpler definition of models and training algorithms - * Intended to be familiar if you know the Python Keras API, but prioritizes clean, idiomatic Java - over fidelity to Python - * Provides defaults based on common best practices - * Allows developers to selectively be more explicit by overriding defaults or dipping into the framework API - * Intended audience: neural network developers across the spectrum from beginner to expert who prefer to - rely mostly on best-practice defaults and then selectively fine-tune - + * Primary API for building and training neural networks with TensorFlow + * Intended audience: neural network developers + * `ndarray` * Generic utility library for n-dimensional data I/O operations * Used by TensorFlow but does not depend on TensorFlow * Intended audience: any developer who needs a Java n-dimensional array implementation, whether or not they use it with TensorFlow + +More specifically, here are the goals for the framework API: + +* If either you know how to implement a model in the Python Keras API, or you are reimplementing an + existing Python Keras model in Java, you should be able to cleanly and naturally follow the same + high-level structure in the framework API. + +* Also, given some familiarity with patterns followed throughout the framework API, you should be + able to easily translate every detail of a Python Keras implementation into the framework API. + +* However, the framework API is not intended to literally mimic the Python Keras API. Rather, it + should expose the same capabilities in an API that feels natural and idiomatic to a Java + programmer who does not know Keras. If we ever find ourselves unable to reconcile this goal with + easy translation from Python Keras, we may split out a Keras layer. + +* Also, the framework API should support fine control over all aspects of modeling, training, and + inference. Unlike with Python Keras, we want this to feel like staying in the same API rather + than diving into a separate layer. But here again, if we are ever unable to reconcile this goal + with easy translation from Python Keras, we may split the framework API into two layers. ## Building Sources diff --git a/pom.xml b/pom.xml index 25c814e0490..e40e81ff218 100644 --- a/pom.xml +++ b/pom.xml @@ -119,19 +119,6 @@ - - - dev - - - - - - - - 4.0.0 - - - org.tensorflow - tensorflow-java - 0.3.0-SNAPSHOT - - tensorflow-keras - jar - TensorFlow Keras Library - Java implementation of the TensorFlow Keras API - - - - - - - - org.tensorflow - tensorflow-core-platform - ${project.version} - - - org.tensorflow - tensorflow-framework - ${project.version} - - - org.json - json - 20190722 - - - - org.apache.commons - commons-csv - 1.8 - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - - - org.tensorflow - tensorflow-core-platform${javacpp.platform.extension} - ${project.version} - test - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - 1 - false - -Xmx2G -XX:MaxPermSize=256m - false - - **/*Test.java - - - - - - - - diff --git a/tensorflow-keras/src/main/java/org/tensorflow/keras/package-info.java b/tensorflow-keras/src/main/java/org/tensorflow/keras/package-info.java deleted file mode 100644 index 3a148acebf7..00000000000 --- a/tensorflow-keras/src/main/java/org/tensorflow/keras/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package org.tensorflow.keras; \ No newline at end of file diff --git a/tensorflow-keras/src/test/java/org/tensorflow/keras/package-info.java b/tensorflow-keras/src/test/java/org/tensorflow/keras/package-info.java deleted file mode 100644 index 3a148acebf7..00000000000 --- a/tensorflow-keras/src/test/java/org/tensorflow/keras/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package org.tensorflow.keras; \ No newline at end of file From 28fca080e9f74f014498a005a5a993a41c66ca9a Mon Sep 17 00:00:00 2001 From: deansher Date: Fri, 16 Oct 2020 09:32:15 -0400 Subject: [PATCH 2/2] Created tensorflow-framework/README.md and linked it from the main readme. --- README.md | 20 +------------------- tensorflow-framework/README.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 19 deletions(-) create mode 100644 tensorflow-framework/README.md diff --git a/README.md b/README.md index 75a743cb0ec..bca18d1fe49 100644 --- a/README.md +++ b/README.md @@ -26,31 +26,13 @@ The following describes the layout of the repository and its different artifacts * `tensorflow-framework` * Primary API for building and training neural networks with TensorFlow * Intended audience: neural network developers + * For more information: [tensorflow-framework/README.md](tensorflow-framework/README.md) * `ndarray` * Generic utility library for n-dimensional data I/O operations * Used by TensorFlow but does not depend on TensorFlow * Intended audience: any developer who needs a Java n-dimensional array implementation, whether or not they use it with TensorFlow - -More specifically, here are the goals for the framework API: - -* If either you know how to implement a model in the Python Keras API, or you are reimplementing an - existing Python Keras model in Java, you should be able to cleanly and naturally follow the same - high-level structure in the framework API. - -* Also, given some familiarity with patterns followed throughout the framework API, you should be - able to easily translate every detail of a Python Keras implementation into the framework API. - -* However, the framework API is not intended to literally mimic the Python Keras API. Rather, it - should expose the same capabilities in an API that feels natural and idiomatic to a Java - programmer who does not know Keras. If we ever find ourselves unable to reconcile this goal with - easy translation from Python Keras, we may split out a Keras layer. - -* Also, the framework API should support fine control over all aspects of modeling, training, and - inference. Unlike with Python Keras, we want this to feel like staying in the same API rather - than diving into a separate layer. But here again, if we are ever unable to reconcile this goal - with easy translation from Python Keras, we may split the framework API into two layers. ## Building Sources diff --git a/tensorflow-framework/README.md b/tensorflow-framework/README.md new file mode 100644 index 00000000000..b70ee51ec65 --- /dev/null +++ b/tensorflow-framework/README.md @@ -0,0 +1,28 @@ +# Framework API + +This is the primary Java API for building and training neural networks with TensorFlow. +This API deliberately mirrors the overall structure of Python Keras. However, it +is intended as a comfortable, idiomatic Java API for developers who may or may not +be familiar with Keras. + +This API is intended to provide convenient, sensible defaults, while still allowing you to +exercise fine control over the details of your model, training, and inference when necessary. + +More specifically, the following goals drive API evolution: + +* If either you know how to implement a model in the Python Keras API, or you are reimplementing an + existing Python Keras model in Java, you should be able to cleanly and naturally follow the same + high-level structure in the framework API. + +* Also, given some familiarity with patterns followed throughout the framework API, you should be + able to easily translate every detail of a Python Keras implementation into the framework API. + +* However, the framework API is not intended to literally mimic the Python Keras API. Rather, it + should expose the same capabilities in an API that feels natural and idiomatic to a Java + programmer who does not know Keras. If we ever find ourselves unable to reconcile this goal with + easy translation from Python Keras, we may split out a Keras layer. + +* Also, the framework API should support fine control over all aspects of modeling, training, and + inference. Unlike with Python Keras, we want this to feel like staying in the same API rather + than diving into a separate layer. But here again, if we are ever unable to reconcile this goal + with easy translation from Python Keras, we may split the framework API into two layers. \ No newline at end of file