{"id":15293058,"url":"https://github.com/neka-nat/tensorboard-chainer","last_synced_at":"2025-11-10T02:04:22.034Z","repository":{"id":57474125,"uuid":"99386460","full_name":"neka-nat/tensorboard-chainer","owner":"neka-nat","description":"tensorboard for chainer","archived":false,"fork":false,"pushed_at":"2020-05-10T11:58:44.000Z","size":5318,"stargazers_count":40,"open_issues_count":2,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T03:23:09.418Z","etag":null,"topics":["chainer","tensorboard","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neka-nat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-04T23:26:48.000Z","updated_at":"2023-09-08T17:28:17.000Z","dependencies_parsed_at":"2022-09-12T21:01:14.556Z","dependency_job_id":null,"html_url":"https://github.com/neka-nat/tensorboard-chainer","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/neka-nat%2Ftensorboard-chainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neka-nat%2Ftensorboard-chainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neka-nat%2Ftensorboard-chainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neka-nat%2Ftensorboard-chainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neka-nat","download_url":"https://codeload.github.com/neka-nat/tensorboard-chainer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328166,"owners_count":21085262,"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":["chainer","tensorboard","tensorflow"],"created_at":"2024-09-30T16:38:47.055Z","updated_at":"2025-11-10T02:04:21.981Z","avatar_url":"https://github.com/neka-nat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/neka-nat/tensorboard-chainer.svg?branch=master)](https://travis-ci.org/neka-nat/tensorboard-chainer)\n[![codecov](https://codecov.io/gh/neka-nat/tensorboard-chainer/branch/master/graph/badge.svg)](https://codecov.io/gh/neka-nat/tensorboard-chainer)\n\n[![Code Climate](https://codeclimate.com/github/neka-nat/tensorboard-chainer/badges/gpa.svg)](https://codeclimate.com/github/neka-nat/tensorboard-chainer)\n\n[![PyPI version](https://badge.fury.io/py/tensorboard-chainer.svg)](https://badge.fury.io/py/tensorboard-chainer)\n\n# tensorboard-chainer\n\nWrite tensorboard events with simple command.\nincluding scalar, image, histogram, audio, text, graph and embedding.\n\nThis is based on [tensorboard-pytorch](https://github.com/lanpa/tensorboard-pytorch).\n\n## Usage\n\nInstall tensorflow.\n\n```\npip install tensorflow\n```\n\nExecute demo.py and tensorboard.\nAccess \"localhost:6006\" in your browser.\n\n```\ncd examples\npython demo.py\ntensorboard --logdir runs\n```\n\n## Scalar example\n\n![graph](https://raw.githubusercontent.com/neka-nat/tensorboard-chainer/master/screenshots/scalar.png)\n\n## Histogram example\n\n![graph](https://raw.githubusercontent.com/neka-nat/tensorboard-chainer/master/screenshots/histogram.png)\n\n## Graph example\n\n![graph](https://raw.githubusercontent.com/neka-nat/tensorboard-chainer/master/screenshots/graph.gif)\n\n## Name scope\n\nLike tensorflow, nodes in the graph can be grouped together in the namespace to make it easy to see.\n\n```python\nimport chainer\nimport chainer.functions as F\nimport chainer.links as L\nfrom tb_chainer import name_scope, within_name_scope\n\nclass MLP(chainer.Chain):\n    def __init__(self, n_units, n_out):\n        super(MLP, self).__init__()\n        with self.init_scope():\n            self.l1 = L.Linear(None, n_units)  # n_in -\u003e n_units\n            self.l2 = L.Linear(None, n_units)  # n_units -\u003e n_units\n            self.l3 = L.Linear(None, n_out)  # n_units -\u003e n_out\n\n    @within_name_scope('MLP')\n    def __call__(self, x):\n        with name_scope('linear1', self.l1.params()):\n            h1 = F.relu(self.l1(x))\n        with name_scope('linear2', self.l2.params()):\n            h2 = F.relu(self.l2(h1))\n        with name_scope('linear3', self.l3.params()):\n            o = self.l3(h2)\n        return o\n```\n\nHow to save the logs using this model is shown below.\n`add_all_variable_images` is the function that saves the Variable's data in the model that matches the pattern as an images.\n`add_all_parameter_histograms` is the function that save histograms of the Parameter's data in the model that match the pattern.\n\n```python\nfrom datetime import datetime\nfrom tb_chainer import SummaryWriter\n\nmodel = L.Classifier(MLP(1000, 10))\n\nres = model(chainer.Variable(np.random.rand(1, 784).astype(np.float32)),\n            chainer.Variable(np.random.rand(1).astype(np.int32)))\n\nwriter = SummaryWriter('runs/'+datetime.now().strftime('%B%d  %H:%M:%S'))\nwriter.add_graph([res])\nwriter.add_all_variable_images([res], pattern='.*MLP.*')\nwriter.add_all_parameter_histograms([res], pattern='.*MLP.*')\n\nwriter.close()\n```\n\n## Reference\n\n* [tensorboard-pytorch](https://github.com/lanpa/tensorboard-pytorch)\n* [tensorboard_logger](https://github.com/TeamHG-Memex/tensorboard_logger)\n* [tfchain](https://github.com/mitmul/tfchain)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneka-nat%2Ftensorboard-chainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneka-nat%2Ftensorboard-chainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneka-nat%2Ftensorboard-chainer/lists"}