{"action":"created","comment":{"url":"https://api.github.com/repos/bartvm/blocks/pulls/comments/23185252","id":23185252,"diff_hunk":"@@ -0,0 +1,61 @@\n+\"\"\"Extensions for saving and loading the state of a training process.\"\"\"\n+import dill\n+\n+from blocks.extensions import SimpleExtension\n+\n+\n+class SaveLoadBase(SimpleExtension):\n+    \"\"\"The base class for save-load extensions.\n+\n+    Contains the logic that can be shared by different save-load\n+    extensions.\n+\n+    \"\"\"\n+    def log_saving_done(self, destination):\n+        \"\"\"Makes a record in the log that saving has been done.\n+\n+        Parameters\n+        ----------\n+        destination : str\n+            The destination where the state of the training process was\n+            saved.\n+\n+        \"\"\"\n+        self.main_loop.log.current_row.saving_done_to = destination\n+\n+\n+class DumpMainLoop(SaveLoadBase):","path":"blocks/extensions/saveload.py","position":27,"original_position":27,"commit_id":"0bb76313403f8bfef65426ed0fc439b99f23a9ee","original_commit_id":"0bb76313403f8bfef65426ed0fc439b99f23a9ee","user":{"login":"rizar","id":654434,"avatar_url":"https://avatars.githubusercontent.com/u/654434?v=3","gravatar_id":"","url":"https://api.github.com/users/rizar","html_url":"https://github.com/rizar","followers_url":"https://api.github.com/users/rizar/followers","following_url":"https://api.github.com/users/rizar/following{/other_user}","gists_url":"https://api.github.com/users/rizar/gists{/gist_id}","starred_url":"https://api.github.com/users/rizar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rizar/subscriptions","organizations_url":"https://api.github.com/users/rizar/orgs","repos_url":"https://api.github.com/users/rizar/repos","events_url":"https://api.github.com/users/rizar/events{/privacy}","received_events_url":"https://api.github.com/users/rizar/received_events","type":"User","site_admin":false},"body":"Hmm, but the method is called `pickle.dump`, isn't it?","created_at":"2015-01-19T20:37:26Z","updated_at":"2015-01-19T20:37:26Z","html_url":"https://github.com/bartvm/blocks/pull/115#discussion_r23185252","pull_request_url":"https://api.github.com/repos/bartvm/blocks/pulls/115","_links":{"self":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/comments/23185252"},"html":{"href":"https://github.com/bartvm/blocks/pull/115#discussion_r23185252"},"pull_request":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/bartvm/blocks/pulls/115","id":27623881,"html_url":"https://github.com/bartvm/blocks/pull/115","diff_url":"https://github.com/bartvm/blocks/pull/115.diff","patch_url":"https://github.com/bartvm/blocks/pull/115.patch","issue_url":"https://api.github.com/repos/bartvm/blocks/issues/115","number":115,"state":"open","locked":false,"title":"Pickling the Main Loop and Resuming from Unpickled","user":{"login":"rizar","id":654434,"avatar_url":"https://avatars.githubusercontent.com/u/654434?v=3","gravatar_id":"","url":"https://api.github.com/users/rizar","html_url":"https://github.com/rizar","followers_url":"https://api.github.com/users/rizar/followers","following_url":"https://api.github.com/users/rizar/following{/other_user}","gists_url":"https://api.github.com/users/rizar/gists{/gist_id}","starred_url":"https://api.github.com/users/rizar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rizar/subscriptions","organizations_url":"https://api.github.com/users/rizar/orgs","repos_url":"https://api.github.com/users/rizar/repos","events_url":"https://api.github.com/users/rizar/events{/privacy}","received_events_url":"https://api.github.com/users/rizar/received_events","type":"User","site_admin":false},"body":"This pull request contains bunch of fixes that make it possible to pickle the whole main loop object, unpickle it and call `run` as if nothing happened at all. More specifically\r\n\r\n* A small fix of the `Application` object to prevent infinite recursion because of overriden `__getattr__`.\r\n\r\n* Refactoring of the main loop: it is now significantly harder to read but can be resumed in the middle of an epoch.\r\n\r\n* Fixing serialization of the `ContainerDataset`'s state.\r\n\r\n* Test of training resumption for a toy dataset and for MNIST\r\n\r\nFinally I added a simple extension `DumpMainLoop` that dumps the main loop to the given destination. And as usual, some refactoring.","created_at":"2015-01-19T17:42:31Z","updated_at":"2015-01-19T20:37:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b63710130cc7b68832c95eee6163f7ff42dc1ecc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bartvm/blocks/pulls/115/commits","review_comments_url":"https://api.github.com/repos/bartvm/blocks/pulls/115/comments","review_comment_url":"https://api.github.com/repos/bartvm/blocks/pulls/comments/{number}","comments_url":"https://api.github.com/repos/bartvm/blocks/issues/115/comments","statuses_url":"https://api.github.com/repos/bartvm/blocks/statuses/0bb76313403f8bfef65426ed0fc439b99f23a9ee","head":{"label":"rizar:checkpointing","ref":"checkpointing","sha":"0bb76313403f8bfef65426ed0fc439b99f23a9ee","user":{"login":"rizar","id":654434,"avatar_url":"https://avatars.githubusercontent.com/u/654434?v=3","gravatar_id":"","url":"https://api.github.com/users/rizar","html_url":"https://github.com/rizar","followers_url":"https://api.github.com/users/rizar/followers","following_url":"https://api.github.com/users/rizar/following{/other_user}","gists_url":"https://api.github.com/users/rizar/gists{/gist_id}","starred_url":"https://api.github.com/users/rizar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rizar/subscriptions","organizations_url":"https://api.github.com/users/rizar/orgs","repos_url":"https://api.github.com/users/rizar/repos","events_url":"https://api.github.com/users/rizar/events{/privacy}","received_events_url":"https://api.github.com/users/rizar/received_events","type":"User","site_admin":false},"repo":{"id":24884672,"name":"blocks","full_name":"rizar/blocks","owner":{"login":"rizar","id":654434,"avatar_url":"https://avatars.githubusercontent.com/u/654434?v=3","gravatar_id":"","url":"https://api.github.com/users/rizar","html_url":"https://github.com/rizar","followers_url":"https://api.github.com/users/rizar/followers","following_url":"https://api.github.com/users/rizar/following{/other_user}","gists_url":"https://api.github.com/users/rizar/gists{/gist_id}","starred_url":"https://api.github.com/users/rizar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rizar/subscriptions","organizations_url":"https://api.github.com/users/rizar/orgs","repos_url":"https://api.github.com/users/rizar/repos","events_url":"https://api.github.com/users/rizar/events{/privacy}","received_events_url":"https://api.github.com/users/rizar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rizar/blocks","description":"","fork":true,"url":"https://api.github.com/repos/rizar/blocks","forks_url":"https://api.github.com/repos/rizar/blocks/forks","keys_url":"https://api.github.com/repos/rizar/blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rizar/blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rizar/blocks/teams","hooks_url":"https://api.github.com/repos/rizar/blocks/hooks","issue_events_url":"https://api.github.com/repos/rizar/blocks/issues/events{/number}","events_url":"https://api.github.com/repos/rizar/blocks/events","assignees_url":"https://api.github.com/repos/rizar/blocks/assignees{/user}","branches_url":"https://api.github.com/repos/rizar/blocks/branches{/branch}","tags_url":"https://api.github.com/repos/rizar/blocks/tags","blobs_url":"https://api.github.com/repos/rizar/blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rizar/blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rizar/blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/rizar/blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rizar/blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/rizar/blocks/languages","stargazers_url":"https://api.github.com/repos/rizar/blocks/stargazers","contributors_url":"https://api.github.com/repos/rizar/blocks/contributors","subscribers_url":"https://api.github.com/repos/rizar/blocks/subscribers","subscription_url":"https://api.github.com/repos/rizar/blocks/subscription","commits_url":"https://api.github.com/repos/rizar/blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/rizar/blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/rizar/blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/rizar/blocks/issues/comments/{number}","contents_url":"https://api.github.com/repos/rizar/blocks/contents/{+path}","compare_url":"https://api.github.com/repos/rizar/blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rizar/blocks/merges","archive_url":"https://api.github.com/repos/rizar/blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rizar/blocks/downloads","issues_url":"https://api.github.com/repos/rizar/blocks/issues{/number}","pulls_url":"https://api.github.com/repos/rizar/blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/rizar/blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/rizar/blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rizar/blocks/labels{/name}","releases_url":"https://api.github.com/repos/rizar/blocks/releases{/id}","created_at":"2014-10-07T09:45:14Z","updated_at":"2014-10-07T14:17:49Z","pushed_at":"2015-01-19T19:42:46Z","git_url":"git://github.com/rizar/blocks.git","ssh_url":"git@github.com:rizar/blocks.git","clone_url":"https://github.com/rizar/blocks.git","svn_url":"https://github.com/rizar/blocks","homepage":null,"size":1466,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bartvm:master","ref":"master","sha":"d5e58bb9c46cee242b71f818e36a9ae8131bba95","user":{"login":"bartvm","id":2299595,"avatar_url":"https://avatars.githubusercontent.com/u/2299595?v=3","gravatar_id":"","url":"https://api.github.com/users/bartvm","html_url":"https://github.com/bartvm","followers_url":"https://api.github.com/users/bartvm/followers","following_url":"https://api.github.com/users/bartvm/following{/other_user}","gists_url":"https://api.github.com/users/bartvm/gists{/gist_id}","starred_url":"https://api.github.com/users/bartvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartvm/subscriptions","organizations_url":"https://api.github.com/users/bartvm/orgs","repos_url":"https://api.github.com/users/bartvm/repos","events_url":"https://api.github.com/users/bartvm/events{/privacy}","received_events_url":"https://api.github.com/users/bartvm/received_events","type":"User","site_admin":false},"repo":{"id":24829371,"name":"blocks","full_name":"bartvm/blocks","owner":{"login":"bartvm","id":2299595,"avatar_url":"https://avatars.githubusercontent.com/u/2299595?v=3","gravatar_id":"","url":"https://api.github.com/users/bartvm","html_url":"https://github.com/bartvm","followers_url":"https://api.github.com/users/bartvm/followers","following_url":"https://api.github.com/users/bartvm/following{/other_user}","gists_url":"https://api.github.com/users/bartvm/gists{/gist_id}","starred_url":"https://api.github.com/users/bartvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartvm/subscriptions","organizations_url":"https://api.github.com/users/bartvm/orgs","repos_url":"https://api.github.com/users/bartvm/repos","events_url":"https://api.github.com/users/bartvm/events{/privacy}","received_events_url":"https://api.github.com/users/bartvm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bartvm/blocks","description":"A Theano framework for building and training neural networks","fork":false,"url":"https://api.github.com/repos/bartvm/blocks","forks_url":"https://api.github.com/repos/bartvm/blocks/forks","keys_url":"https://api.github.com/repos/bartvm/blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bartvm/blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bartvm/blocks/teams","hooks_url":"https://api.github.com/repos/bartvm/blocks/hooks","issue_events_url":"https://api.github.com/repos/bartvm/blocks/issues/events{/number}","events_url":"https://api.github.com/repos/bartvm/blocks/events","assignees_url":"https://api.github.com/repos/bartvm/blocks/assignees{/user}","branches_url":"https://api.github.com/repos/bartvm/blocks/branches{/branch}","tags_url":"https://api.github.com/repos/bartvm/blocks/tags","blobs_url":"https://api.github.com/repos/bartvm/blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bartvm/blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bartvm/blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/bartvm/blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bartvm/blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/bartvm/blocks/languages","stargazers_url":"https://api.github.com/repos/bartvm/blocks/stargazers","contributors_url":"https://api.github.com/repos/bartvm/blocks/contributors","subscribers_url":"https://api.github.com/repos/bartvm/blocks/subscribers","subscription_url":"https://api.github.com/repos/bartvm/blocks/subscription","commits_url":"https://api.github.com/repos/bartvm/blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/bartvm/blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/bartvm/blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/bartvm/blocks/issues/comments/{number}","contents_url":"https://api.github.com/repos/bartvm/blocks/contents/{+path}","compare_url":"https://api.github.com/repos/bartvm/blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bartvm/blocks/merges","archive_url":"https://api.github.com/repos/bartvm/blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bartvm/blocks/downloads","issues_url":"https://api.github.com/repos/bartvm/blocks/issues{/number}","pulls_url":"https://api.github.com/repos/bartvm/blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/bartvm/blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/bartvm/blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bartvm/blocks/labels{/name}","releases_url":"https://api.github.com/repos/bartvm/blocks/releases{/id}","created_at":"2014-10-06T00:08:32Z","updated_at":"2015-01-19T13:36:54Z","pushed_at":"2015-01-19T17:06:52Z","git_url":"git://github.com/bartvm/blocks.git","ssh_url":"git@github.com:bartvm/blocks.git","clone_url":"https://github.com/bartvm/blocks.git","svn_url":"https://github.com/bartvm/blocks","homepage":"","size":3871,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":27,"forks":15,"open_issues":27,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/115"},"html":{"href":"https://github.com/bartvm/blocks/pull/115"},"issue":{"href":"https://api.github.com/repos/bartvm/blocks/issues/115"},"comments":{"href":"https://api.github.com/repos/bartvm/blocks/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/bartvm/blocks/statuses/0bb76313403f8bfef65426ed0fc439b99f23a9ee"}}}}