generic-github-user / Circle-Counter

A simple TensorFlow.js project to count randomly generated circles

Home Page:https://generic-github-user.github.io/Circle-Counter/src/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create convolutional model/neural network layers diagram

generic-github-user opened this issue · comments

For reference, the model currently looks like this:

image

Here's the (slightly abridged) model creation code:

const model = tf.sequential();

model.add(tf.layers.conv2d(
	{
		inputShape: [res[0], res[1], 1],
		filters: conv_filters,
		kernelSize: 3,
		strides: 1,
		activation: 'relu'
	}
));
model.add(tf.layers.maxPooling2d(
	{
		poolSize: 2,
		strides: 2
	}
));
model.add(tf.layers.conv2d(
	{
		filters: conv_filters,
		kernelSize: 3,
		stride: 1,
		activation: 'relu'
	}
));
model.add(tf.layers.maxPooling2d(
	{
		poolSize: 2,
		strides: 2
	}
));
model.add(tf.layers.conv2d(
	{
		filters: conv_filters,
		kernelSize: 3,
		stride: 1,
		activation: 'relu'
	}
));
model.add(tf.layers.maxPooling2d(
	{
		poolSize: 2,
		strides: 2
	}
));

model.add(tf.layers.flatten({}));
model.add(tf.layers.dense({units: 32}));
model.add(tf.layers.leakyReLU());
model.add(tf.layers.dropout(0.8, {rate: 0.8}));

model.add(tf.layers.dense({units: 1}));

Finished diagram:

image

(Also add this to the README when that is done - #20)