{"id":19543149,"url":"https://github.com/yeonghyeon/white-box-layer","last_synced_at":"2026-02-28T08:35:04.918Z","repository":{"id":44565504,"uuid":"371594688","full_name":"YeongHyeon/white-box-layer","owner":"YeongHyeon","description":"Deep Learning Package based on TensorFlow. ","archived":false,"fork":false,"pushed_at":"2022-05-09T06:01:58.000Z","size":152,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-05T05:42:50.538Z","etag":null,"topics":["deep-learning","deep-learning-library","machine-learning","neural-network","python","tensorflow","tensorflow2"],"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/YeongHyeon.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}},"created_at":"2021-05-28T05:53:39.000Z","updated_at":"2024-04-08T09:39:44.000Z","dependencies_parsed_at":"2022-09-11T19:20:53.288Z","dependency_job_id":null,"html_url":"https://github.com/YeongHyeon/white-box-layer","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YeongHyeon%2Fwhite-box-layer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YeongHyeon%2Fwhite-box-layer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YeongHyeon%2Fwhite-box-layer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YeongHyeon%2Fwhite-box-layer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YeongHyeon","download_url":"https://codeload.github.com/YeongHyeon/white-box-layer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224040405,"owners_count":17245762,"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":["deep-learning","deep-learning-library","machine-learning","neural-network","python","tensorflow","tensorflow2"],"created_at":"2024-11-11T03:17:37.423Z","updated_at":"2026-02-28T08:35:04.870Z","avatar_url":"https://github.com/YeongHyeon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/YeongHyeon/white-box-layer/blob/master/misc/wblayer-logo-withtext.png?raw=true\"\u003e\u003cp\u003e\n    \u003cimg src=\"misc/wblayer-logo.png\" width=\"450\"\u003e\n  \u003c/p\u003e\u003c/a\u003e\n\u003c/div\u003e  \n\n---\n\u003ca href=\"https://github.com/YeongHyeon/white-box-layer\"\u003eWhite-Box-Layer\u003c/a\u003e is a Python module for deep learning built on top of TensorFlow and is distributed under the MIT license.  \n\nThe project was started in May 2021 by \u003ca href=\"https://github.com/YeongHyeon\"\u003eYeongHyeon Park\u003c/a\u003e.  \nThis project does not limit for participation.  \nContribute now!  \n\n## Installation\n\n### Dependencies\nwhiteboxlayer requires:\n* Numpy: 1.19.5  \n* Scipy: 1.4.1  \n* TensorFlow: 2.4.0  \n\n### User installation\nYou can install the white-box-layer via simple command as below.  \n``` sh\n$ pip install whiteboxlayer\n```\n\n## Development\nWe welcome new contributors of all experience levels. The white-box-layer community goals are to be helpful, welcoming, and effective. The Development Guide has detailed information about contributing code, documentation, tests, and more. We've included some basic information in this README.\n\n## Example\n\n### Example for Convolutional Neural Network\nAn example of constructing a convolutional neural network is covered. The relevant source code is additionally provided following links.  \n* \u003ca href=\"https://github.com/yeonghyeon/white-box-layer/blob/master/examples/example_cnn.ipynb\"\u003eJupyter notebook\u003c/a\u003e  \n\n#### Define TensorFlow based module\n``` python\nclass Neuralnet(tf.Module):\n\n    def __init__(self, **kwargs):\n        super(Neuralnet, self).__init__()\n\n        self.who_am_i = kwargs['who_am_i']\n        self.dim_h = kwargs['dim_h']\n        self.dim_w = kwargs['dim_w']\n        self.dim_c = kwargs['dim_c']\n        self.num_class = kwargs['num_class']\n        self.filters = kwargs['filters']\n\n        self.layer = wbl.Layers()\n\n        self.forward = tf.function(self.__call__)\n\n    @tf.function\n    def __call__(self, x, verbose=False):\n\n        logit = self.__nn(x=x, name=self.who_am_i, verbose=verbose)\n        y_hat = tf.nn.softmax(logit, name=\"y_hat\")\n\n        return logit, y_hat\n\n    def __nn(self, x, name='neuralnet', verbose=True):\n\n        for idx, _ in enumerate(self.filters[:-1]):\n            if(idx == 0): continue\n            x = self.layer.conv2d(x=x, stride=1, \\\n                filter_size=[3, 3, self.filters[idx-1], self.filters[idx]], \\\n                activation='relu', name='%s-%dconv' %(name, idx), verbose=verbose)\n            x = self.layer.maxpool(x=x, ksize=2, strides=2, \\\n                name='%s-%dmp' %(name, idx), verbose=verbose)\n\n        x = tf.reshape(x, shape=[x.shape[0], -1], name=\"flat\")\n        x = self.layer.fully_connected(x=x, c_out=self.filters[-1], \\\n                activation='relu', name=\"%s-clf0\" %(name), verbose=verbose)\n        x = self.layer.fully_connected(x=x, c_out=self.num_class, \\\n                activation=None, name=\"%s-clf1\" %(name), verbose=verbose)\n\n        return x\n```\n\n#### Initializing module\n``` python\nmodel = Neuralnet(\\\n    who_am_i=\"CNN\", \\\n    dim_h=28, dim_w=28, dim_c=1, \\\n    num_class=10, \\\n    filters=[1, 32, 64, 128])\n\ndummy = tf.zeros((1, model.dim_h, model.dim_w, model.dim_c), dtype=tf.float32)\nmodel.forward(x=dummy, verbose=True)\n```\n\n#### Results\n``` sh\nConv (CNN-1conv) (1, 28, 28, 1) -\u003e (1, 28, 28, 32)\nMaxPool (CNN-1mp) (1, 28, 28, 32) \u003e (1, 14, 14, 32)\nConv (CNN-2conv) (1, 14, 14, 32) -\u003e (1, 14, 14, 64)\nMaxPool (CNN-2mp) (1, 14, 14, 64) \u003e (1, 7, 7, 64)\nFC (CNN-clf0) (1, 3136) -\u003e (1, 128)\nFC (CNN-clf1) (1, 128) -\u003e (1, 10)\nConv (CNN-1conv) (1, 28, 28, 1) -\u003e (1, 28, 28, 32)\nMaxPool (CNN-1mp) (1, 28, 28, 32) \u003e (1, 14, 14, 32)\nConv (CNN-2conv) (1, 14, 14, 32) -\u003e (1, 14, 14, 64)\nMaxPool (CNN-2mp) (1, 14, 14, 64) \u003e (1, 7, 7, 64)\nFC (CNN-clf0) (1, 3136) -\u003e (1, 128)\nFC (CNN-clf1) (1, 128) -\u003e (1, 10)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeonghyeon%2Fwhite-box-layer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeonghyeon%2Fwhite-box-layer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeonghyeon%2Fwhite-box-layer/lists"}