{"action":"created","issue":{"url":"https://api.github.com/repos/rtavenar/tslearn/issues/53","repository_url":"https://api.github.com/repos/rtavenar/tslearn","labels_url":"https://api.github.com/repos/rtavenar/tslearn/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/rtavenar/tslearn/issues/53/comments","events_url":"https://api.github.com/repos/rtavenar/tslearn/issues/53/events","html_url":"https://github.com/rtavenar/tslearn/issues/53","id":342259219,"node_id":"MDU6SXNzdWUzNDIyNTkyMTk=","number":53,"title":"Save shapelet model","user":{"login":"gio8tisu","id":37589160,"node_id":"MDQ6VXNlcjM3NTg5MTYw","avatar_url":"https://avatars1.githubusercontent.com/u/37589160?v=4","gravatar_id":"","url":"https://api.github.com/users/gio8tisu","html_url":"https://github.com/gio8tisu","followers_url":"https://api.github.com/users/gio8tisu/followers","following_url":"https://api.github.com/users/gio8tisu/following{/other_user}","gists_url":"https://api.github.com/users/gio8tisu/gists{/gist_id}","starred_url":"https://api.github.com/users/gio8tisu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gio8tisu/subscriptions","organizations_url":"https://api.github.com/users/gio8tisu/orgs","repos_url":"https://api.github.com/users/gio8tisu/repos","events_url":"https://api.github.com/users/gio8tisu/events{/privacy}","received_events_url":"https://api.github.com/users/gio8tisu/received_events","type":"User","site_admin":false},"labels":[{"id":597918895,"node_id":"MDU6TGFiZWw1OTc5MTg4OTU=","url":"https://api.github.com/repos/rtavenar/tslearn/labels/new%20feature","name":"new feature","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-18T09:58:29Z","updated_at":"2018-10-05T15:39:35Z","closed_at":null,"author_association":"NONE","body":"I would like to save my trained shapelet model. Any help will be appreciated.\r\nThanks."},"comment":{"url":"https://api.github.com/repos/rtavenar/tslearn/issues/comments/427408633","html_url":"https://github.com/rtavenar/tslearn/issues/53#issuecomment-427408633","issue_url":"https://api.github.com/repos/rtavenar/tslearn/issues/53","id":427408633,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzQwODYzMw==","user":{"login":"murometz","id":2499658,"node_id":"MDQ6VXNlcjI0OTk2NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2499658?v=4","gravatar_id":"","url":"https://api.github.com/users/murometz","html_url":"https://github.com/murometz","followers_url":"https://api.github.com/users/murometz/followers","following_url":"https://api.github.com/users/murometz/following{/other_user}","gists_url":"https://api.github.com/users/murometz/gists{/gist_id}","starred_url":"https://api.github.com/users/murometz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murometz/subscriptions","organizations_url":"https://api.github.com/users/murometz/orgs","repos_url":"https://api.github.com/users/murometz/repos","events_url":"https://api.github.com/users/murometz/events{/privacy}","received_events_url":"https://api.github.com/users/murometz/received_events","type":"User","site_admin":false},"created_at":"2018-10-05T15:39:35Z","updated_at":"2018-10-05T15:39:35Z","author_association":"NONE","body":"> Hi all,\r\n> \r\n> Indeed, that would be a nice functionality. @gio8tisu : if you just need to access your shapelets afterwards, I would get inspiration from the second solution given by @GillesVandewiele and do something like:\r\n> \r\n> ```python\r\n> from tslearn.utils import save_timeseries_txt\r\n> \r\n> shapelets = my_trained_model.shapelets_as_time_series_\r\n> save_timeseries_txt(\"/path/to/my/file.txt\", shapelets)\r\n> ```\r\n> \r\n> But definitely, it would be nice to be able to serialize the whole model. Hence, I add the \"new feature\" label (I really do not have time to do it right now, sorry).\r\n> \r\n> NB : an in-between solution if you are used to `keras` would be to save all weights to disk (you can access them via the `get_weights` method) and when you want to reuse your model, build a new shapelet model with the correct architecture, reload all the weights and set the model's weights accordingly.\r\n\r\nHi. thank you very much for your work.\r\n\r\nHow to load weights?\r\n\r\nI save the weights from trained model:\r\n\r\nCreate model:\r\nshp_clf_1 = ShapeletModel(n_shapelets_per_size=shapelet_sizes,\r\n                        optimizer=Adagrad(lr=.01),\r\n                        weight_regularizer=.01,\r\n                        max_iter=8000,\r\n                        verbose_level=0)\r\n\r\nNow I want to load weights and predict without training.\r\n\r\nHow?\r\n\r\nThank you very much!\r\nRegards\r\nIlja Rasin\r\n\r\n"}}
{"actor":{"display_login":"murometz"}}