diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 45e2177466d..fbbe1c24fac 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,6 @@ name: Docs on: pull_request: paths: - - "**.ipynb" - "docs/mkdocs.yml" # Publish docs weekly schedule: @@ -38,10 +37,6 @@ jobs: - name: add mybinder link run: | python3 tools/scripts/add_online_runner.py - - name: run Notebooks - run: | - cd jupyter - bash test_notebook.sh - name: clone demos run: | cd docs @@ -50,6 +45,10 @@ jobs: run: | cd docs git clone https://github.com/deepjavalibrary/djl-serving.git serving + - name: run Notebooks + run: | + cd docs/demos/jupyter + bash test_notebook.sh - name: build docs run: | cd docs diff --git a/api/src/main/java/ai/djl/inference/Predictor.java b/api/src/main/java/ai/djl/inference/Predictor.java index 853b30d7a5e..d9b20e3ef9e 100644 --- a/api/src/main/java/ai/djl/inference/Predictor.java +++ b/api/src/main/java/ai/djl/inference/Predictor.java @@ -60,14 +60,13 @@ * * * * @param the input type diff --git a/api/src/main/java/ai/djl/nn/Block.java b/api/src/main/java/ai/djl/nn/Block.java index 82beca520d1..7ace6880c56 100644 --- a/api/src/main/java/ai/djl/nn/Block.java +++ b/api/src/main/java/ai/djl/nn/Block.java @@ -105,7 +105,7 @@ * further refine these elements, use {@link Block#freezeParameters(boolean)} to unfreeze them. * * @see this + * href="http://docs.djl.ai/docs/demos/jupyter/tutorial/01_create_your_first_network.html">this * tutorial on creating your first network * @see The * D2L chapter on blocks and *
  • Training + * href="http://docs.djl.ai/docs/demos/jupyter/tutorial/02_train_your_first_model.html">Training * your first model - *
  • Training + *
  • Training * using transfer learning - *
  • Inference - * with an MXNet model + *
  • Inference with an + * MXNet model * * * @see The guide on memory diff --git a/docs/README.md b/docs/README.md index cdd02661c78..81d547e92f2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,14 +20,14 @@ Note: when searching in JavaDoc, if your access is denied, please try removing t - [Troubleshooting](development/troubleshooting.md) - [Inference Optimization](development/inference_performance_optimization.md) -## [Jupyter notebook tutorials](../jupyter/README.md) - -- **[Beginner Jupyter Tutorial](../jupyter/tutorial/README.md)** -- [Run object detection with model zoo](../jupyter/object_detection_with_model_zoo.ipynb) -- [Load pre-trained PyTorch model](../jupyter/load_pytorch_model.ipynb) -- [Load pre-trained Apache MXNet model](../jupyter/load_mxnet_model.ipynb) -- [Transfer learning example](../jupyter/transfer_learning_on_cifar10.ipynb) -- [Question answering example](../jupyter/BERTQA.ipynb) +## [Jupyter notebook tutorials](http://docs.djl.ai/docs/demos/jupyter/index.html) + +- **[Beginner Jupyter Tutorial](http://docs.djl.ai/docs/demos/jupyter/tutorial/index.html)** +- [Run object detection with model zoo](http://docs.djl.ai/docs/demos/jupyter/object_detection_with_model_zoo.html) +- [Load pre-trained PyTorch model](http://docs.djl.ai/docs/demos/jupyter/load_pytorch_model.html) +- [Load pre-trained Apache MXNet model](http://docs.djl.ai/docs/demos/jupyter/load_mxnet_model.html) +- [Transfer learning example](http://docs.djl.ai/docs/demos/jupyter/transfer_learning_on_cifar10.html) +- [Question answering example](http://docs.djl.ai/docs/demos/jupyter/BERTQA.html) ## [API Examples](../examples/README.md) diff --git a/docs/interactive_tool.md b/docs/interactive_tool.md index ed102fedc8d..d7d267db710 100644 --- a/docs/interactive_tool.md +++ b/docs/interactive_tool.md @@ -63,7 +63,7 @@ After that, click `run` and you should see the following result: Finally, you can get the running project setup by clicking `Get Template`. This will bring you a gradle project that can be used in your local machine. -## [Java Jupyter Notebook](../jupyter/README.md) +## [Java Jupyter Notebook](http://docs.djl.ai/docs/demos/jupyter/index.html) Wait a second, are we talking about hosting Jupyter Notebook in python? No, it’s Java 11, only. @@ -71,9 +71,9 @@ No, it’s Java 11, only. ![jupyter](https://djl-ai.s3.amazonaws.com/web-data/images/jupyter.gif) Inspired by Spencer Park’s [IJava project](https://github.com/SpencerPark/IJava), we integrated DJL with Jupyter Notebooks. -For more information on the simple setup, follow the instructions in [DJL Jupyter notebooks](../jupyter/README.md#setup). +For more information on the simple setup, follow the instructions in [DJL Jupyter notebooks](http://docs.djl.ai/docs/demos/jupyter/index.html#setup). After that, use the Jupyter Notebook freely in your hosted server. You can do all kinds of work, like block building and plotting a graph. -There are [tutorials and instructions](../jupyter/README.md#djl---jupyter-notebooks) to guide you how you can run training and/or inference with Java. +There are [tutorials and instructions](http://docs.djl.ai/docs/demos/jupyter/index.html#djl---jupyter-notebooks) to guide you how you can run training and/or inference with Java. ## About Future Lab diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 11641c93f27..058fb6165a2 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -61,15 +61,15 @@ nav: - 'docs/faq.md' - Tutorials: - Beginner Tutorial: - - 'jupyter/tutorial/01_create_your_first_network.ipynb' - - 'jupyter/tutorial/02_train_your_first_model.ipynb' - - 'jupyter/tutorial/03_image_classification_with_your_model.ipynb' + - 'docs/demos/jupyter/tutorial/01_create_your_first_network.ipynb' + - 'docs/demos/jupyter/tutorial/02_train_your_first_model.ipynb' + - 'docs/demos/jupyter/tutorial/03_image_classification_with_your_model.ipynb' - 'docs/d2l.md' - - 'jupyter/rank_classification_using_BERT_on_Amazon_Review.ipynb' - - 'jupyter/transfer_learning_on_cifar10.ipynb' + - 'docs/demos/jupyter/rank_classification_using_BERT_on_Amazon_Review.ipynb' + - 'docs/demos/jupyter/transfer_learning_on_cifar10.ipynb' - Load your own BERT: - - BERT with MXNet: 'jupyter/mxnet/load_your_own_mxnet_bert.ipynb' - - BERT with PyTorch: 'jupyter/pytorch/load_your_own_pytorch_bert.ipynb' + - BERT with MXNet: 'docs/demos/jupyter/mxnet/load_your_own_mxnet_bert.ipynb' + - BERT with PyTorch: 'docs/demos/jupyter/pytorch/load_your_own_pytorch_bert.ipynb' - Guides: - Models: - 'docs/load_model.md' @@ -97,25 +97,25 @@ nav: - PyTorch NDArray Operators: 'docs/pytorch/pytorch-djl-ndarray-cheatsheet.md' - PyTorch Model Zoo: 'engines/pytorch/pytorch-model-zoo/README.md' - Import PyTorch Model: 'docs/pytorch/how_to_convert_your_model_to_torchscript.md' - - Load a PyTorch Model: 'jupyter/load_pytorch_model.ipynb' + - Load a PyTorch Model: 'docs/demos/jupyter/load_pytorch_model.ipynb' - TensorFlow: - Overview: 'engines/tensorflow/README.md' - TensorFlow Engine: 'engines/tensorflow/tensorflow-engine/README.md' - TensorFlow Model Zoo: 'engines/tensorflow/tensorflow-model-zoo/README.md' - Import TensorFlow Model: 'docs/tensorflow/how_to_import_tensorflow_models_in_DJL.md' - - Load a TensorFlow Model: 'jupyter/tensorflow/pneumonia_detection.ipynb' + - Load a TensorFlow Model: 'docs/demos/jupyter/tensorflow/pneumonia_detection.ipynb' - Apache MXNet: - Overview: 'engines/mxnet/README.md' - MXNet Engine: 'engines/mxnet/mxnet-engine/README.md' - MXNet Model Zoo: 'engines/mxnet/mxnet-model-zoo/README.md' - Import Gluon Model: 'docs/mxnet/how_to_convert_your_model_to_symbol.md' - - Load a MXNet Model: 'jupyter/load_mxnet_model.ipynb' + - Load a MXNet Model: 'docs/demos/jupyter/load_mxnet_model.ipynb' - Backend Optimizer for MXNet: 'docs/mxnet/mxnet_backend_optimizer.md' - Hybrid engines: - Hybrid engine overview: 'docs/hybrid_engine.md' - ONNX Runtime: - Overview: 'engines/onnxruntime/onnxruntime-engine/README.md' - - Load a ONNX Model: 'jupyter/onnxruntime/machine_learning_with_ONNXRuntime.ipynb' + - Load a ONNX Model: 'docs/demos/jupyter/onnxruntime/machine_learning_with_ONNXRuntime.ipynb' - PaddlePaddle: - Overview: 'engines/paddlepaddle/README.md' - PaddlePaddle Engine: 'engines/paddlepaddle/paddlepaddle-engine/README.md' @@ -124,11 +124,11 @@ nav: - English: 'docs/paddlepaddle/how_to_create_paddlepaddle_model.md' - 中文: 'docs/paddlepaddle/how_to_create_paddlepaddle_model_zh.md' - Facemask detection using PaddlePaddle: - - English: 'jupyter/paddlepaddle/face_mask_detection_paddlepaddle.ipynb' - - 中文: 'jupyter/paddlepaddle/face_mask_detection_paddlepaddle_zh.ipynb' + - English: 'docs/demos/jupyter/paddlepaddle/face_mask_detection_paddlepaddle.ipynb' + - 中文: 'docs/demos/jupyter/paddlepaddle/face_mask_detection_paddlepaddle_zh.ipynb' - PaddleOCR example: - - English: 'jupyter/paddlepaddle/paddle_ocr_java.ipynb' - - 中文: 'jupyter/paddlepaddle/paddle_ocr_java_zh.ipynb' + - English: 'docs/demos/jupyter/paddlepaddle/paddle_ocr_java.ipynb' + - 中文: 'docs/demos/jupyter/paddlepaddle/paddle_ocr_java_zh.ipynb' - XGBoost: 'engines/ml/xgboost/README.md' - LightGBM: 'engines/ml/lightgbm/README.md' - TensorRT: 'engines/tensorrt/README.md' diff --git a/docs/paddlepaddle/how_to_create_paddlepaddle_model.md b/docs/paddlepaddle/how_to_create_paddlepaddle_model.md index 042acbd2d61..b78d4406946 100644 --- a/docs/paddlepaddle/how_to_create_paddlepaddle_model.md +++ b/docs/paddlepaddle/how_to_create_paddlepaddle_model.md @@ -157,5 +157,5 @@ predictor.predict(list); As mentioned, you need to find out what is the input for the model, like images usually interpret as NCHW (batch_size, channel, height, width). -However, usage like this is really basic, you can write a `Translator` in DJL for it. You can find some code examples [here](../../jupyter/paddlepaddle/face_mask_detection_paddlepaddle.ipynb). +However, usage like this is really basic, you can write a `Translator` in DJL for it. You can find some code examples [here](http://docs.djl.ai/docs/demos/jupyter/paddlepaddle/face_mask_detection_paddlepaddle.html). diff --git a/docs/paddlepaddle/how_to_create_paddlepaddle_model_zh.md b/docs/paddlepaddle/how_to_create_paddlepaddle_model_zh.md index 74e5dec634f..5f79d713783 100644 --- a/docs/paddlepaddle/how_to_create_paddlepaddle_model_zh.md +++ b/docs/paddlepaddle/how_to_create_paddlepaddle_model_zh.md @@ -156,4 +156,4 @@ predictor.predict(list); 在这里,你需要知道模型的输入输出格式, 比如图片经常表达成 NCHW (批大小, RGB通道, 高度, 宽度)的多维矩阵。 -虽然这样可以让模型跑起来, 但是最好还是结合 DJL 的 `Translator` class 使用。你可以在 [这里](../../jupyter/paddlepaddle/face_mask_detection_paddlepaddle.ipynb) 找到一些示例代码。 +虽然这样可以让模型跑起来, 但是最好还是结合 DJL 的 `Translator` class 使用。你可以在 [这里](http://docs.djl.ai/docs/demos/jupyter/paddlepaddle/face_mask_detection_paddlepaddle.html) 找到一些示例代码。 diff --git a/docs/quick_start.md b/docs/quick_start.md index f352a39156a..85a94494b2d 100644 --- a/docs/quick_start.md +++ b/docs/quick_start.md @@ -1,7 +1,7 @@ # Quick start Deep Java Library (DJL) is designed to be easy to get started with and simple to use. -The easiest way to learn DJL is to read the [beginner tutorial](../jupyter/tutorial/README.md) or +The easiest way to learn DJL is to read the [beginner tutorial](http://docs.djl.ai/docs/demos/jupyter/tutorial/README.md) or our [examples](../examples/README.md). You can also view our 1.5 hour long (in 8 x ~10 minute segments) DJL 101 tutorial video series: @@ -22,7 +22,7 @@ See [DJL Future Labs](interactive_tool.md) ## Beginner tutorial -To get started, we recommend that you follow our short [beginner tutorial](../jupyter/tutorial/README.md). It takes you through some of the basics of deep learning to create a model, train your model, and run inference using your trained model. +To get started, we recommend that you follow our short [beginner tutorial](http://docs.djl.ai/docs/demos/jupyter/tutorial/index.html). It takes you through some of the basics of deep learning to create a model, train your model, and run inference using your trained model. ## Run examples @@ -33,7 +33,7 @@ All of our examples are executed by a simple command. For detailed command line - [Train your first model](../examples/docs/train_mnist_mlp.md) - [Single-shot Object Detection inference example](../examples/docs/object_detection.md) - [More examples](https://github.com/deepjavalibrary/djl/tree/master/examples) -- [Jupyter examples](../jupyter/README.md) +- [Jupyter examples](http://docs.djl.ai/docs/demos/jupyter/index.html) ## Other resources diff --git a/examples/docs/image_classification.md b/examples/docs/image_classification.md index 1f515f9680f..c8f331320a8 100644 --- a/examples/docs/image_classification.md +++ b/examples/docs/image_classification.md @@ -6,7 +6,7 @@ In this example, you learn how to implement inference code with Deep Java Librar The image classification example code can be found at [ImageClassification.java](https://github.com/deepjavalibrary/djl/blob/master/examples/src/main/java/ai/djl/examples/inference/ImageClassification.java). -You can also use the [Jupyter notebook tutorial](../../jupyter/tutorial/03_image_classification_with_your_model.ipynb). +You can also use the [Jupyter notebook tutorial](http://docs.djl.ai/docs/demos/jupyter/tutorial/03_image_classification_with_your_model.html). The Jupyter notebook explains the key concepts in detail. ## Setup Guide diff --git a/examples/docs/object_detection.md b/examples/docs/object_detection.md index 7d0898128b9..84286fb6e00 100644 --- a/examples/docs/object_detection.md +++ b/examples/docs/object_detection.md @@ -7,7 +7,7 @@ In this example, you learn how to implement inference code with a [ModelZoo mode The source code can be found at [ObjectDetection.java](https://github.com/deepjavalibrary/djl/blob/master/examples/src/main/java/ai/djl/examples/inference/ObjectDetection.java). -You can also use the [Jupyter notebook tutorial](../../jupyter/object_detection_with_model_zoo.ipynb). +You can also use the [Jupyter notebook tutorial](http://docs.djl.ai/docs/demos/jupyter/object_detection_with_model_zoo.html). The Jupyter notebook explains the key concepts in detail. ## Setup guide diff --git a/examples/docs/train_cifar10_resnet.md b/examples/docs/train_cifar10_resnet.md index cfaf03f8a61..1cdfcb495c2 100644 --- a/examples/docs/train_cifar10_resnet.md +++ b/examples/docs/train_cifar10_resnet.md @@ -5,7 +5,7 @@ In this example, you learn how to train the [CIFAR-10](https://www.cs.toronto.ed You can find the example source code in: [TrainResnetWithCifar10.java](https://github.com/deepjavalibrary/djl/blob/master/examples/src/main/java/ai/djl/examples/training/transferlearning/TrainResnetWithCifar10.java). -You can also find the Jupyter notebook tutorial [here](../../jupyter/transfer_learning_on_cifar10.ipynb). +You can also find the Jupyter notebook tutorial [here](http://docs.djl.ai/docs/demos/jupyter/transfer_learning_on_cifar10.html). The Jupyter notebook explains the key concepts in detail. ## Setup guide diff --git a/examples/docs/train_mnist_mlp.md b/examples/docs/train_mnist_mlp.md index 72b591d062a..40a32ca365f 100644 --- a/examples/docs/train_mnist_mlp.md +++ b/examples/docs/train_mnist_mlp.md @@ -6,7 +6,7 @@ In this example, you learn how to train the MNIST dataset with Deep Java Library The source code for this example can be found at [TrainMnist.java](https://github.com/deepjavalibrary/djl/blob/master/examples/src/main/java/ai/djl/examples/training/TrainMnist.java). -You can also use the [Jupyter notebook tutorial](../../jupyter/tutorial/02_train_your_first_model.ipynb). +You can also use the [Jupyter notebook tutorial](http://docs.djl.ai/docs/demos/jupyter/tutorial/02_train_your_first_model.html). The Jupyter notebook explains the key concepts in detail. ## Setup guide diff --git a/examples/src/main/java/ai/djl/examples/inference/BertQaInference.java b/examples/src/main/java/ai/djl/examples/inference/BertQaInference.java index b667cd29f90..093e159bebb 100644 --- a/examples/src/main/java/ai/djl/examples/inference/BertQaInference.java +++ b/examples/src/main/java/ai/djl/examples/inference/BertQaInference.java @@ -34,9 +34,8 @@ *

    See: * *