From 0baa1c1beb9c52e4541c715e04ceb17402e05e19 Mon Sep 17 00:00:00 2001 From: jvech Date: Mon, 23 Oct 2023 10:48:18 -0500 Subject: setup: install_config added, README updated --- Makefile | 4 ++++ README.md | 6 +++++- config.mk | 1 + utils/settings.cfg | 10 +++++----- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4df3d18..4521115 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,10 @@ install: all install -d $(MANPREFIX)/man1 install -m 644 doc/ml.1 $(MANPREFIX)/man1/ml.1 +install_config: + mkdir -p ~/.config/ml + sed "s!utils/weights.bin!${CFGPREFIX}/ml.weights!" utils/settings.cfg > ${CFGPREFIX}/ml.cfg + uninstall: rm -v $(BINPREFIX)/${BIN} rm -v $(MANPREFIX)/man1/ml.1 diff --git a/README.md b/README.md index 9baa0ac..1e53f55 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ A simple neural network maker developed to train json data ``` git clone https://git.juanvalencia.xyz/ml cd ml +make sudo make install +make install_config ``` ## Uninstall @@ -22,16 +24,18 @@ sudo make uninstall ``` ## Usage + ``` Usage: ml train [Options] JSON_FILE or: ml predict [-o FILE] FILE -Train and predict json data Options: -h, --help Show this message -a, --alpha=ALPHA Learning rate (only works with train) -e, --epochs=EPOCHS Epochs to train the model (only works with train) -o, --output=FILE Output file (only works with predict) + -c, --config=FILE Configuration filepath [default=~/.config/ml/ml.cfg] + Examples: $ ml train -e 150 -a 1e-4 housing.json diff --git a/config.mk b/config.mk index b9350ff..0301b2e 100644 --- a/config.mk +++ b/config.mk @@ -2,3 +2,4 @@ PREFIX ?= /usr/local BINPREFIX := $(PREFIX)/bin MANPREFIX := $(PREFIX)/share/man +CFGPREFIX := ~/.config/ml diff --git a/utils/settings.cfg b/utils/settings.cfg index eee85fc..83a0b62 100644 --- a/utils/settings.cfg +++ b/utils/settings.cfg @@ -1,15 +1,15 @@ [net] loss = square ; options (square) -epochs = 200 ; comment -alpha = 1e-2 +epochs = 500 ; comment +alpha = 1 weights_path = utils/weights.bin -inputs = x -labels = y +inputs = x, y +labels = z ; activation options (relu, sigmoid, softplus, leaky_relu) [layer] -neurons=20 +neurons=10 activation=sigmoid [outlayer] -- cgit v1.2.3-70-g09d2