Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian-examples.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Grundkiewicz <rgrundkiewicz@gmail.com>2022-02-09 15:23:58 +0300
committerRoman Grundkiewicz <rgrundkiewicz@gmail.com>2022-02-09 15:23:58 +0300
commitac2f162fd731a38531bdbd36ae5b4d529ee16330 (patch)
treeeab14a372d13c4291b0fa744bb7e93f373e8e0cf
parent299123b00005d71867d4dde52e5e8f806b1caef4 (diff)
Do not use marian-example-library as a submodule
-rw-r--r--.gitmodules4
m---------example-library0
-rw-r--r--example-library/README.md57
3 files changed, 57 insertions, 4 deletions
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 3ddbd40..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,4 +0,0 @@
-[submodule "example-library"]
- path = example-library
- url = https://github.com/marian-nmt/marian-example-library
- branch = main
diff --git a/example-library b/example-library
deleted file mode 160000
-Subproject a33ef1055cbb3b7a8003138e9669d406a7bde42
diff --git a/example-library/README.md b/example-library/README.md
new file mode 100644
index 0000000..b2bf5be
--- /dev/null
+++ b/example-library/README.md
@@ -0,0 +1,57 @@
+# Example: Marian as a library
+
+This serves as a minimal example of a CMake project with a [marian][marian]
+dependency. The dependency to Marian in that repository is facilitated by a
+submodule to [marian-dev]. The complete code is available from the
+[marian-example-library] repository.
+
+
+## Usage
+
+### Compile
+```shell
+git clone https://github.com/marian-nmt/marian-example-library
+cd marian-example-library
+mkdir build
+cd build
+cmake ..
+cmake --build .
+```
+
+### Run
+```shell
+./example
+```
+
+## About this example
+The code in [src/main.cpp](src/main.cpp) builds a simple expression graph using
+Marian. It mirrors the example found in Marian's [developer
+documentation][dev_docs].
+
+The expression graph represents `z = x*y + sin(x)`, with an absolute-error
+applied to `z` as a loss function. It performs a forward and backward
+evaluation of the graph, and a single update of the graph parameters from a
+`Stochastic Gradient Descent` optimizer. Following the example, `x` takes the
+place of a learnable parameter.
+
+After the parameter update, the graph parameters are saved to
+`example-model.npz`. You can inspect its contents with
+[`script/read-npz.py`](/script/read-npz.py).
+
+Please refer to the [marian][marian] project for further documentation.
+
+## About this repository
+There are example CI builds available for
+ - Ubuntu
+ - MacOS
+ - Windows
+
+These compile and run the example executable.
+
+Additionally, the Marian submodule is updatable via dependabot.
+
+<!-- Links -->
+[marian]: https://marian-nmt.github.io/
+[marian-dev]: https://github.com/marian-nmt/marian-dev
+[marian-example-library]: https://github.com/marian-nmt/marian-example-library
+[dev_docs]: https://marian-nmt.github.io/docs/api/graph.html