{"id":22297492,"url":"https://github.com/rustonaut/keras-plot","last_synced_at":"2025-03-25T22:43:49.058Z","repository":{"id":84690016,"uuid":"75203893","full_name":"rustonaut/keras-plot","owner":"rustonaut","description":"live ploting with bokeh, port of blocks-extras.extensions.Plot to keras","archived":false,"fork":false,"pushed_at":"2016-11-30T16:12:24.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T20:14:52.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustonaut.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":"2016-11-30T16:11:40.000Z","updated_at":"2016-11-30T16:12:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb5d1e9c-aa81-4ca9-9564-204c2043f54d","html_url":"https://github.com/rustonaut/keras-plot","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/rustonaut%2Fkeras-plot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fkeras-plot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fkeras-plot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fkeras-plot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustonaut","download_url":"https://codeload.github.com/rustonaut/keras-plot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245556960,"owners_count":20634889,"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":[],"created_at":"2024-12-03T17:49:57.366Z","updated_at":"2025-03-25T22:43:49.031Z","avatar_url":"https://github.com/rustonaut.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# keras-plot\n\nA mostly strait forward port of `blocks-extras.extensions.Plot` to a keras callback,\nincluding most of the original drawback and benefits.\n\nNote: Require bokeh version 0.10!!, like the blocks version\n\nNote: this is mostly a fast straight forward port, with some little goodies added in and a bit of refactoring\n  do not expect production quality or maintance for this package\n\n\n## Installation\n\nNo special inatallation requirements, but because it relies on a old version of bokeh I won't upload it\non PyPI, you can use e.g.: `pip install git+https://github.com/dathinab/keras-plot.git --user`\n\n\n## Changes compared to `blocks-extras.extensions.Plot`\n\n- some refactoring making unessesary complex internal code mor simple and readable\n- removed `start_server` option, as it should not have existed at all\n- changed the default `server_url `behaviour (there is not simple mapping from the config mechanism from blocks to keras)\n- added some small nice goodies:\n    - you can just pass in the same functions to the plots channel parameter, as you can pass to the fit\n      functions `metrics` parameter. Be aware that many functions are implemented both in `keras.objectives` and\n      `keras.metrics` and that e.g. a `mean_squared_error` objective is not the same as a `mean_squared_error` metric!\n      The Plot class intentionally rejects keras.objective functions as this is mostly likely a bug, which can lead\n      to non obvious error messages, if the objective is also used as a metric in the training functionality.\n\n    - Also both 'accuracy' and 'acc' will map to 'acc' as this is how keras behaves.\n\n\n## Example\n\n(note: it's quite a nonsensical example)\n\nBefore running this example make sure to start a bokeh server of version 0.10 on the\nlocalhost, port 5006 (wich is the default for it) or add parameters to Plot constructor.\n\n```python\nfrom keras_plot import Plot\nimport numpy\n\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Activation\n\nmodel = Sequential()\nmodel.add(Dense(output_dim=1, input_dim=100))\nmodel.add(Activation(\"relu\"))\n\nfrom keras.optimizers import SGD\nimport keras.objectives as objectives\nfrom keras.metrics import mean_absolute_error, binary_accuracy\n\nmodel.compile(\n    loss=objectives.mean_squared_error,\n    optimizer=SGD(),\n    metrics=[binary_accuracy, mean_absolute_error]\n)\n\nX_train = numpy.random.random(size=(300, 100))\nY_train = numpy.random.randint(0, 2, size=(300, 1))\n\nmodel.fit(X_train, Y_train, nb_epoch=50, batch_size=10, callbacks=[\n    Plot(\n        document_name=\"test4231\",\n        channels=[\n            # the first plot (not that MSE+Accuracy in same plot make hardly any sense)\n            ['loss', binary_accuracy],\n            # the second plot\n            [mean_absolute_error]\n        ],\n    )\n])\n```\n\n\n## Collection of possible improvements\n\n- switch to newer bokeh version\n- when plotting after every batch also add a (samely) colored graph ploted after every epoch, which is kind of\n  the smothed version of \"after every batch\"\n- possible mix \"after every batch\" and \"after every epoch\" for different metrics\n- possible add filters like \"moving window smoothing\"\n- change API to accept bokeh Session instead of a url\n    - for login, configuarability etc.\n    - possible add some load/create from config function for it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustonaut%2Fkeras-plot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustonaut%2Fkeras-plot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustonaut%2Fkeras-plot/lists"}