From 660aac88a7ddde2713a3d6cd34bc065386f62d57 Mon Sep 17 00:00:00 2001 From: ulises-jeremias Date: Sat, 9 Dec 2023 21:41:38 -0300 Subject: [PATCH] Passed fmt --- datasets/imdb.v | 8 +++----- datasets/mnist.v | 12 +++++------- examples/nn_mnist/main.v | 8 +++----- examples/nn_simple_two_layer/main.v | 12 +++++------- examples/nn_xor/main.v | 8 +++----- storage/cpu.v | 8 +++----- 6 files changed, 22 insertions(+), 34 deletions(-) diff --git a/datasets/imdb.v b/datasets/imdb.v index 204413a3..7155a85a 100644 --- a/datasets/imdb.v +++ b/datasets/imdb.v @@ -3,11 +3,9 @@ module datasets import vtl import os -pub const ( - imdb_folder_name = 'aclImdb' - imdb_file_name = '${imdb_folder_name}_v1.tar.gz' - imdb_base_url = 'http://ai.stanford.edu/~amaas/data/sentiment/' -) +pub const imdb_folder_name = 'aclImdb' +pub const imdb_file_name = '${imdb_folder_name}_v1.tar.gz' +pub const imdb_base_url = 'http://ai.stanford.edu/~amaas/data/sentiment/' // ImdbDataset is a dataset for sentiment analysis. pub struct ImdbDataset { diff --git a/datasets/mnist.v b/datasets/mnist.v index 9e16cf26..83df51cb 100644 --- a/datasets/mnist.v +++ b/datasets/mnist.v @@ -3,13 +3,11 @@ module datasets import vtl import os -pub const ( - mnist_base_url = 'http://yann.lecun.com/exdb/mnist/' - mnist_train_images_file = 'train-images-idx3-ubyte.gz' - mnist_train_labels_file = 'train-labels-idx1-ubyte.gz' - mnist_test_images_file = 't10k-images-idx3-ubyte.gz' - mnist_test_labels_file = 't10k-labels-idx1-ubyte.gz' -) +pub const mnist_base_url = 'http://yann.lecun.com/exdb/mnist/' +pub const mnist_train_images_file = 'train-images-idx3-ubyte.gz' +pub const mnist_train_labels_file = 'train-labels-idx1-ubyte.gz' +pub const mnist_test_images_file = 't10k-images-idx3-ubyte.gz' +pub const mnist_test_labels_file = 't10k-labels-idx1-ubyte.gz' // MnistDataset is a dataset of MNIST handwritten digits. pub struct MnistDataset { diff --git a/examples/nn_mnist/main.v b/examples/nn_mnist/main.v index 44dea651..525e32b5 100644 --- a/examples/nn_mnist/main.v +++ b/examples/nn_mnist/main.v @@ -6,11 +6,9 @@ import vtl.datasets import vtl.nn.models import vtl.nn.optimizers -const ( - batch_size = 28 - epochs = 1 - batches = 100 -) +const batch_size = 28 +const epochs = 1 +const batches = 100 fn main() { // Autograd context / neuralnet graph diff --git a/examples/nn_simple_two_layer/main.v b/examples/nn_simple_two_layer/main.v index 7792ceb8..65a17722 100644 --- a/examples/nn_simple_two_layer/main.v +++ b/examples/nn_simple_two_layer/main.v @@ -5,13 +5,11 @@ import vtl.autograd import vtl.nn.models import vtl.nn.optimizers -const ( - batch_size = 64 - input_dim = 1000 - hidden_dim = 100 - output_dim = 10 - epochs = 500 -) +const batch_size = 64 +const input_dim = 1000 +const hidden_dim = 100 +const output_dim = 10 +const epochs = 500 // Learning XOR function with a neural network. diff --git a/examples/nn_xor/main.v b/examples/nn_xor/main.v index c178116b..a0166c87 100644 --- a/examples/nn_xor/main.v +++ b/examples/nn_xor/main.v @@ -5,11 +5,9 @@ import vtl.autograd import vtl.nn.models import vtl.nn.optimizers -const ( - batch_size = 32 - epochs = 6 - batches = 100 -) +const batch_size = 32 +const epochs = 6 +const batches = 100 // Learning XOR function with a neural network. diff --git a/storage/cpu.v b/storage/cpu.v index 2a395129..0730105a 100644 --- a/storage/cpu.v +++ b/storage/cpu.v @@ -1,10 +1,8 @@ module storage -pub const ( - vector_minimum_capacity = 2 - vector_growth_factor = 2 - vector_shrink_threshold = 1.0 / 4.0 -) +pub const vector_minimum_capacity = 2 +pub const vector_growth_factor = 2 +pub const vector_shrink_threshold = 1.0 / 4.0 // CpuStorage @[heap]