diff --git a/.gitignore b/.gitignore index 1a6a75a2..82b31df8 100644 --- a/.gitignore +++ b/.gitignore @@ -334,3 +334,4 @@ ASALocalRun/ /tensorflowlib/linux/native/libtensorflow_framework.so /tensorflowlib/linux/native/libtensorflow.so /src/TensorFlowNET.Core/tensorflow.dll +/docs/build diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..69fe55ec --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,19 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/assets/Cover.psd b/docs/assets/Cover.psd new file mode 100644 index 00000000..66548760 Binary files /dev/null and b/docs/assets/Cover.psd differ diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..4d9eb83d --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/docs/The-Definitive-Guide/CH_2 Constant.md b/docs/source/Constant.md similarity index 100% rename from docs/The-Definitive-Guide/CH_2 Constant.md rename to docs/source/Constant.md diff --git a/docs/The-Definitive-Guide/Foreword.md b/docs/source/Foreword.md similarity index 100% rename from docs/The-Definitive-Guide/Foreword.md rename to docs/source/Foreword.md diff --git a/docs/The-Definitive-Guide/README.md b/docs/source/FrontCover.md similarity index 50% rename from docs/The-Definitive-Guide/README.md rename to docs/source/FrontCover.md index 926aded7..dd3dcb58 100644 --- a/docs/The-Definitive-Guide/README.md +++ b/docs/source/FrontCover.md @@ -4,8 +4,24 @@ -### The CSharp binding for Google's TensorFlow - An Open Source Machine Learning Framework for Everyone -### 谷歌TensorFlow的C#封装库,开源机器学习框架。 + + + + + +![column-major order](_static/cover.jpg) + + + + + +### The CSharp binding for Google's TensorFlow + +#### An Open Source Machine Learning Framework for Everyone + +### 谷歌TensorFlow的C#封装库 + +#### 开源机器学习框架。 diff --git a/docs/The-Definitive-Guide/CH_3 Operation.md b/docs/source/Graph.md similarity index 100% rename from docs/The-Definitive-Guide/CH_3 Operation.md rename to docs/source/Graph.md diff --git a/docs/source/HelloWorld.md b/docs/source/HelloWorld.md new file mode 100644 index 00000000..2704b8b7 --- /dev/null +++ b/docs/source/HelloWorld.md @@ -0,0 +1,14 @@ +# Get started with TensorFlow.NET + +让我们先运行一个经典的HelloWorld程序,看看TensorFlow是在.NET上面运行的效果,我想不出有比做个HelloWorld再简单的方式了。 + +Let's run a classic HelloWorld program first and see if TensorFlow is running on .NET. I can't think of a simpler way to be a HelloWorld. + +### Install the TensorFlow.NET SDK + +To start building TensorFlow program you just need to download and install the .NET SDK (Software Development Kit). + +```cmd +PM> Install-Package TensorFlow.NET +``` + diff --git a/docs/The-Definitive-Guide/CH_4 Variable.md b/docs/source/Operation.md similarity index 100% rename from docs/The-Definitive-Guide/CH_4 Variable.md rename to docs/source/Operation.md diff --git a/docs/The-Definitive-Guide/Preface.md b/docs/source/Preface.md similarity index 100% rename from docs/The-Definitive-Guide/Preface.md rename to docs/source/Preface.md diff --git a/docs/The-Definitive-Guide/CH_5 Session.md b/docs/source/Session.md similarity index 100% rename from docs/The-Definitive-Guide/CH_5 Session.md rename to docs/source/Session.md diff --git a/docs/The-Definitive-Guide/Table of Contents.md b/docs/source/Table of Contents.md similarity index 81% rename from docs/The-Definitive-Guide/Table of Contents.md rename to docs/source/Table of Contents.md index 6551e926..0783195d 100644 --- a/docs/The-Definitive-Guide/Table of Contents.md +++ b/docs/source/Table of Contents.md @@ -10,7 +10,9 @@ ​ Installing Tensorflow.NET ​ Running Tensorflow.NET -​ Talking to Tensorflow.NET +​ Talking to Tensorflow.NET + +##### 2. Hello World ## Part II. Tensorflow.NET in Depth diff --git a/docs/The-Definitive-Guide/CH_1 Tensor.md b/docs/source/Tensor.md similarity index 90% rename from docs/The-Definitive-Guide/CH_1 Tensor.md rename to docs/source/Tensor.md index 1d09ba42..dbea55df 100644 --- a/docs/The-Definitive-Guide/CH_1 Tensor.md +++ b/docs/source/Tensor.md @@ -36,6 +36,6 @@ var nd = np.array(1f, 2f, 3f, 4f, 5f, 6f).reshape(2, 3); -![column-major order](assets/column-major-order.png) +![column-major order](_static/column-major-order.png) -![row-major order](assets/row-major-order.png) +![row-major order](_static/row-major-order.png) diff --git a/docs/The-Definitive-Guide/CH_6 Graph.md b/docs/source/Variable.md similarity index 100% rename from docs/The-Definitive-Guide/CH_6 Graph.md rename to docs/source/Variable.md diff --git a/docs/source/_static/Cover.jpg b/docs/source/_static/Cover.jpg new file mode 100644 index 00000000..3452f800 Binary files /dev/null and b/docs/source/_static/Cover.jpg differ diff --git a/docs/The-Definitive-Guide/assets/column-major-order.png b/docs/source/_static/column-major-order.png similarity index 100% rename from docs/The-Definitive-Guide/assets/column-major-order.png rename to docs/source/_static/column-major-order.png diff --git a/docs/The-Definitive-Guide/assets/row-major-order.png b/docs/source/_static/row-major-order.png similarity index 100% rename from docs/The-Definitive-Guide/assets/row-major-order.png rename to docs/source/_static/row-major-order.png diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..4e7bfb1b --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,179 @@ +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'TensorFlow.NET' +copyright = '2019, Haiping Chen' +author = 'Haiping Chen' + +# The short X.Y version +version = '0.0.1' +# The full version, including alpha/beta/rc tags +release = '0.0.1' + + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.mathjax', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +from recommonmark.parser import CommonMarkParser +source_parsers = {'.md': CommonMarkParser} +source_suffix = ['.rst', '.md'] + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = 'TensorFlowNETdoc' + + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'TensorFlowNET.tex', 'TensorFlow.NET Documentation', + 'Haiping Chen', 'manual'), +] + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'tensorflownet', 'TensorFlow.NET Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'TensorFlowNET', 'TensorFlow.NET Documentation', + author, 'TensorFlowNET', 'One line description of project.', + 'Miscellaneous'), +] + + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + + +# -- Extension configuration ------------------------------------------------- diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..fe256a88 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,28 @@ +.. TensorFlow.NET documentation master file, created by + sphinx-quickstart on Sat Jan 5 09:26:55 2019. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to TensorFlow.NET's documentation! +========================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`Front Cover ` +* :ref:`modindex` +* :ref:`search` + +.. _front-cover: + +.. toctree:: + :maxdepth: 3 + :caption: Get Started with TensorFlow.NET: + + FrontCover \ No newline at end of file