Skip to content

Commit dd44cce

Browse files
arjungtensorflow-copybara
authored andcommitted
Several documentation improvements to NSL.
- adds a link to the `examples` subdirectory from the main README.md file and from the TF website - adds clarity to our contribution guidelines - adds a README.md file under the `examples` subdirectory PiperOrigin-RevId: 393784004
1 parent feda93f commit dd44cce

File tree

4 files changed

+54
-16
lines changed

4 files changed

+54
-16
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,38 +71,39 @@ learning with structured signals.
7171
target="_blank"><img src="http://img.youtube.com/vi/Js2WJkhdU7k/0.jpg"
7272
alt="Adversarial Learning" width="180" border="2" /></a>
7373

74-
We've also created the following hands-on colab-based tutorials that will allow
75-
you to interactively explore NSL:
74+
We've also created hands-on colab-based tutorials that will allow you to
75+
interactively explore NSL. Here are a few:
7676

7777
* [training with natural graphs](https://github.com/tensorflow/neural-structured-learning/blob/master/g3doc/tutorials/graph_keras_mlp_cora.ipynb)
7878
* [training with synthesized graphs](https://github.com/tensorflow/neural-structured-learning/blob/master/g3doc/tutorials/graph_keras_lstm_imdb.ipynb)
7979
* [adversarial learning](https://github.com/tensorflow/neural-structured-learning/blob/master/g3doc/tutorials/adversarial_keras_cnn_mnist.ipynb)
8080

81+
You can find more examples and tutorials under the [examples](examples)
82+
directory.
83+
8184
## Contributing to NSL
8285

8386
Contributions are welcome and highly appreciated - there are several ways to
8487
contribute to TF Neural Structured Learning:
8588

86-
* Case studies. If you are interested in applying NSL, consider wrapping up
89+
* Case studies: If you are interested in applying NSL, consider wrapping up
8790
your usage as a tutorial, a new dataset, or an example model that others
88-
could use for experiments and/or development.
91+
could use for experiments and/or development. The [examples](examples)
92+
directory could be a good destination for such contributions.
8993

90-
* Product excellence. If you are interested in improving NSL's product
94+
* Product excellence: If you are interested in improving NSL's product
9195
excellence and developer experience, the best way is to clone this repo,
9296
make changes directly on the implementation in your local repo, and then
9397
send us pull request to integrate your changes.
9498

95-
* New algorithms. If you are interested in developing new algorithms for NSL,
99+
* New algorithms: If you are interested in developing new algorithms for NSL,
96100
the best way is to study the implementations of NSL libraries, and to think
97101
of extensions to the existing implementation (or alternative approaches). If
98102
you have a proposal for a new algorithm, we recommend starting by staging
99-
your project in the `research` directory and including a colab notebook to
100-
showcase the new features.
101-
102-
If you develop new algorithms in your own repository, we are happy to
103-
feature pointers to academic publications and/or repositories that use NSL,
104-
on
105-
[tensorflow.org/neural_structured_learning](http://www.tensorflow.org/neural_structured_learning).
103+
your project in the [research](research) directory and including a colab
104+
notebook to showcase the new features. If you develop new algorithms in your
105+
own repository, we would be happy to feature pointers to academic
106+
publications and/or repositories using NSL from this repository.
106107

107108
Please be sure to review the [contribution guidelines](CONTRIBUTING.md).
108109

g3doc/framework.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ NSL brings the following advantages:
7575

7676
## Step-by-step Tutorials
7777

78-
To obtain hands-on experience with Neural Structured Learning, we have three
79-
tutorials that cover various scenarios where structured signals may be
80-
explicitly given, induced or constructed:
78+
To obtain hands-on experience with Neural Structured Learning, we have tutorials
79+
that cover various scenarios where structured signals may be explicitly given,
80+
constructed, or induced. Here are a few:
8181

8282
* [Graph regularization for document classification using natural graphs](tutorials/graph_keras_mlp_cora.ipynb).
8383
In this tutorial, we explore the use of graph regularization to classify
@@ -91,3 +91,7 @@ explicitly given, induced or constructed:
9191
In this tutorial, we explore the use of adversarial learning (where
9292
structured signals are induced) to classify images containing numeric
9393
digits.
94+
95+
More examples and tutorials can be found in the
96+
[examples](https://github.com/tensorflow/neural-structured-learning/tree/master/neural_structured_learning/examples)
97+
directory of our GitHub repository.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
This directory contains examples and tutorials demonstrating how to use NSL.
2+
3+
## Example Trainers
4+
5+
The `.py` files in this directory are all example trainers runnable end-to-end
6+
as Python programs:
7+
8+
* `adv_keras_cnn_mnist.py`: Adversarial regularization on the MNIST dataset.
9+
* `graph_keras_mlp_cora.py`: Graph regularization on the Cora dataset.
10+
* `graph_nets_cora_gcn.py`: Graph Convolutional Network on the Cora dataset
11+
using [GraphNets](https://github.com/deepmind/graph_nets).
12+
* `graph_nets_cora_graph_regularization.py`: Graph regularization on the Cora
13+
dataset using [GraphNets](https://github.com/deepmind/graph_nets).
14+
15+
## Notebooks
16+
17+
The
18+
[notebooks](https://github.com/tensorflow/neural-structured-learning/tree/master/neural_structured_learning/examples/notebooks)
19+
subdirectory contains colab-based tutorials that allow you to explore NSL
20+
interactively. This subdirectory is generally where most new tutorials are
21+
added. Note that the tutorials shown on our
22+
[TensorFlow website](https://github.com/tensorflow/neural-structured-learning)
23+
are hosted under the
24+
[g3doc/tutorials](https://github.com/tensorflow/neural-structured-learning/g3doc/tutorials)
25+
directory.
26+
27+
## Data Preprocessing Scripts
28+
29+
The
30+
[preprocess](https://github.com/tensorflow/neural-structured-learning/tree/master/neural_structured_learning/examples/preprocess)
31+
subdirectory contains various data preprocessing scripts.

neural_structured_learning/examples/preprocess/cora/prep_data.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
# Script to download and preprocess the Cora dataset for use by NSL models.
17+
1618
# URL for downloading Cora dataset.
1719
URL=https://linqs-data.soe.ucsc.edu/public/lbc/cora.tgz
1820

0 commit comments

Comments
 (0)