{"id":21078459,"url":"https://github.com/carlo-/fcnet","last_synced_at":"2026-04-09T08:54:40.773Z","repository":{"id":77771820,"uuid":"132033389","full_name":"carlo-/FCNet","owner":"carlo-","description":"Simple Python implementation of a fully connected neural network","archived":false,"fork":false,"pushed_at":"2018-06-10T21:47:52.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T23:17:32.696Z","etag":null,"topics":["cifar10","fully-connected-network","machine-learning","neural-network"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlo-.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-03T18:15:58.000Z","updated_at":"2018-06-10T21:47:53.000Z","dependencies_parsed_at":"2023-09-06T17:32:39.748Z","dependency_job_id":null,"html_url":"https://github.com/carlo-/FCNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlo-%2FFCNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlo-%2FFCNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlo-%2FFCNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlo-%2FFCNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlo-","download_url":"https://codeload.github.com/carlo-/FCNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243521287,"owners_count":20304187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cifar10","fully-connected-network","machine-learning","neural-network"],"created_at":"2024-11-19T19:40:33.524Z","updated_at":"2025-12-28T09:26:33.490Z","avatar_url":"https://github.com/carlo-.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FCNet\nPython implementation of a fully connected neural network.\n\nTraining is performed exclusively on CPU, and is implemented as Mini-batch Gradient Descent.\\\nAll settings of the descent can be customized for tuning.\n\n## Technical details\n- **Initialization:** He\n- **Activation function:** ReLU\n- **Cost function:** Cross-entropy loss + regularization term\n- **Regularization:** L2 with customizable factor (lambda)\n- **Output:** Softmax of the scores at the final layer\n\n## Network configuration\nThe `Net` object must be initialized with two arguments, an array containing the number of nodes at each layer (including input and output sizes), and a dictionary representing the configuration of the gradient descent.\n```Python\nnet_sizes = [3072, 50, 10] # [input, ...hidden, output]\ndescent_config = {} # empty for simplicity\nnet = Net(net_sizes, descent_config)\n```\nIn the example above, the initialized network has an input of `3072` dimensions, one single hidden layer with `50` nodes, and an output of `10` dimensions.\n\n## Descent configuration\nBelow all settings for the gradient descent with their default values:\n```Python\ndescent_config = {\n    'eta': 0.01, # learning rate\n    'batch_size': 100, # size of each batch to be used for training\n    'epochs': 40, # number of epochs\n    'gamma': 0.0, # momentum factor\n    'decay_rate': 1.0, # rate of decay of eta\n    'lambda': 0.0, # regularization factor\n    'batch_normalize': True, # whether or not batch normalization should be used\n    'plateau_guard': None, # if the speed of descent becomes greater than this value, eta is divided by 10.0\n    'overfitting_guard': None, # if the speed of descent becomes greater than this value, training is aborted\n    'output_folder': None # if specified, the model will be exported here after each epoch \n}\n```\n\n## Full example\n```Python\nnp.random.seed(42)\n\nX, Y, y = dataset.load_multibatch_cifar10()\nX_test, Y_test, y_test = dataset.load_cifar10(batch='test_batch')\n\nK, d = (Y.shape[0], X.shape[0])\nnet_sizes = [d, 50, 30, K]\n\ndescent_config = {\n    'eta': 0.015,\n    'batch_size': 100,\n    'epochs': 20,\n    'gamma': 0.6,\n    'decay_rate': 0.93,\n    'lambda': 0.0001,\n    'batch_normalize': True,\n    'plateau_guard': -0.001,\n    'overfitting_guard': 0.0,\n    'output_folder': '../model/'\n}\n\nnet = Net(net_sizes, descent_config)\nnet.train(X, Y, X_test, Y_test)\n\ntraining_accuracy = net.compute_accuracy(X, y)\ntest_accuracy = net.compute_accuracy(X_test, y_test)\n```\n\n\n## License\nThis project is released under the MIT license. See `LICENSE` for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlo-%2Ffcnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlo-%2Ffcnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlo-%2Ffcnet/lists"}