From 573fc4e1e836364e5ad4a210b7560eeec3ad0314 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Mon, 7 Feb 2022 13:55:14 -0500 Subject: [PATCH] Add JavaScript WebGL example + Update READMEs --- README.md | 2 + javascript/README.md | 9 ++ javascript/webgl/01_simple-shape/index.html | 165 ++++++++++++++++++++ javascript/webgl/README.md | 9 ++ python/linear-regression/README.md | 14 -- python/markov-model/README.md | 2 +- python/neural-network/README.md | 10 +- 7 files changed, 191 insertions(+), 20 deletions(-) create mode 100644 javascript/README.md create mode 100644 javascript/webgl/01_simple-shape/index.html create mode 100644 javascript/webgl/README.md diff --git a/README.md b/README.md index 5e32133..126aff9 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ github.com/shaunrd0/klips/ ├── blockchain # Blockchain related project templates and examples ├── cpp # C++ programs, datastructures, and other examples ├── figlet # Figlet fonts I like :) +├── javascript # Javascript projects and examples +├── python # Python scripts or tools I've made ├── README.md └── scripts # Bash scripts ``` diff --git a/javascript/README.md b/javascript/README.md new file mode 100644 index 0000000..f64aa8e --- /dev/null +++ b/javascript/README.md @@ -0,0 +1,9 @@ +# Javascript + +This directory contains Javascript projects and examples that I've made. + +``` +github.com/shaunrd0/klips/javascript +├── webgl # Examples of using WebGL within JS +└── README.md +``` diff --git a/javascript/webgl/01_simple-shape/index.html b/javascript/webgl/01_simple-shape/index.html new file mode 100644 index 0000000..dc96903 --- /dev/null +++ b/javascript/webgl/01_simple-shape/index.html @@ -0,0 +1,165 @@ + + + + + 01_simple-shape + + + + + + + + + + + +

This is test HTML with some CSS. Logging with JS...
The following block is an OpenGL canvas

+ + + + + + + \ No newline at end of file diff --git a/javascript/webgl/README.md b/javascript/webgl/README.md new file mode 100644 index 0000000..f96f0fe --- /dev/null +++ b/javascript/webgl/README.md @@ -0,0 +1,9 @@ +# Javascript + +This directory contains examples of using WebGL within JavaScript. + +``` +github.com/shaunrd0/klips/javascript/webgl +├── 01_simple-shape # Drawing a simple solid color triangle with WebGL +└── README.md +``` diff --git a/python/linear-regression/README.md b/python/linear-regression/README.md index 2ff2dc1..67fcf04 100644 --- a/python/linear-regression/README.md +++ b/python/linear-regression/README.md @@ -32,20 +32,6 @@ optional arguments: Optionally provide file for data to be read from. Each point must be on it's own line with format x,y ``` -Running linear regression program -```bash -python3.9 linear-regression.py --file ./input.txt --silent -Finding fitting line plot for given data [(1, 3), (2, 7), (3, 5), (4, 9), (5, 11), (6, 12), (7, 15)] -points_avg: (5.117647058823529, 5.235294117647059) -variance: (241.76470588235296, 193.05882352941177) -sigma: (3.887196176892422, 3.4736402333270258) -covariance: 0.8455882352941174 -correlation: 0.0626235432924427 -Our line Y = BX + A must pass through the point (5.117647058823529, 5.235294117647059) -Y = (0.05596107055961069)X + 4.9489051094890515 -For X = 4.5, Y is predicted to be 5.200729927007299 -``` - By default, the following linear regression is calculated and displayed ```bash python3.9 linear-regression.py diff --git a/python/markov-model/README.md b/python/markov-model/README.md index 9c130d6..c08729c 100644 --- a/python/markov-model/README.md +++ b/python/markov-model/README.md @@ -90,7 +90,7 @@ Final paths sorted by probability: (0, 2, 1, 0, 2) has probability: 0.001395 ``` -By default, a random Hidden Markov Model and visualization will be generated +By default, a random Hidden Markov Model and visualization will be generated and the sequence `[A, B, D, C]` will be used. ```bash python3.9 markov-model.py diff --git a/python/neural-network/README.md b/python/neural-network/README.md index b49b761..b4ea7c4 100644 --- a/python/neural-network/README.md +++ b/python/neural-network/README.md @@ -8,10 +8,10 @@ python3.9 -m pip install -r requirements.txt Neural network implementation using Python CLI to dynamically generate a resizable network and then run a given number of learning cycles on the provided data set. As an example, the IRIS dataset is used to classify flower types using petal measurements. -Input layer perceptron count can be adjusted with `INPUTS` positional parameter -Hidden layer perceptron count can be adjusted with `PERCEPTRONS` positional parameter -Output layer perceptron count can be adjusted with `OUTPUTS` positional parameter -Hidden layers can be added or removed using`--hidden-layers` option setting +Input layer perceptron count can be adjusted with `INPUTS` positional parameter. +Hidden layer perceptron count can be adjusted with `PERCEPTRONS` positional parameter. +Output layer perceptron count can be adjusted with `OUTPUTS` positional parameter. +Hidden layers can be added or removed using`--hidden-layers` option setting. Node bias can be initialized randomly or with provided data. Perceptron edge weight bias can be initialized randomly or with provided data. Threshold for perceptron fire can be initialized randomly or with provided data. @@ -96,7 +96,7 @@ If the length of an input sequence does not match the number of input nodes requ If the length of possible label classifications does not match the number of output nodes requested, a warning will show. In both cases, the program corrects the node count to match the input data / labels, and not the requested node count. -The total number of output labels provided must match the total number of the number of input sequences. +The total number of output labels provided must match the total number of input sequences. Running NN program uses IRIS data set by default. Warnings will be shown if input and output node count is changed without providing new input.