{"action":"created","comment":{"url":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/comments/236925601","pull_request_review_id":179104618,"id":236925601,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjkyNTYwMQ==","diff_hunk":"@@ -325,3 +325,172 @@ describe('Dataset', () => {\n         .toThrowError(/Cannot get spectrograms as tensors because.*empty/);\n   });\n });\n+\n+describe('Dataset serialization', () => {\n+  function getRandomExample(\n+      label: string, numFrames: number, frameSize: number,\n+      rawAudioNumSamples?: number, rawAudioSampleRateHz?: number): Example {\n+    const spectrogramData = [];\n+    for (let i = 0; i < numFrames * frameSize; ++i) {\n+      spectrogramData.push(Math.random());\n+    }\n+    const output: Example = {\n+      label,\n+      spectrogram: {data: new Float32Array(spectrogramData), frameSize}\n+    };\n+    if (rawAudioNumSamples != null) {\n+      const rawAudioData: number[] = [];\n+      for (let i = 0; i < rawAudioNumSamples; ++i) {\n+        rawAudioData.push(Math.random());\n+      }\n+      const rawAudio: RawAudioData = {\n+        data: new Float32Array(rawAudioData),\n+        sampleRateHz: rawAudioSampleRateHz\n+      };\n+      output.rawAudio = rawAudio;\n+    }\n+    return output;\n+  }\n+\n+  it('serializeExample-deserializeExapmle round trip, no raw audio', () => {","path":"speech-commands/src/dataset_test.ts","position":45,"original_position":45,"commit_id":"21576f7b72c78e392c5324c138aae5f3ccfc03a0","original_commit_id":"21576f7b72c78e392c5324c138aae5f3ccfc03a0","user":{"login":"rusheywood","id":45184414,"node_id":"MDQ6VXNlcjQ1MTg0NDE0","avatar_url":"https://avatars3.githubusercontent.com/u/45184414?v=4","gravatar_id":"","url":"https://api.github.com/users/rusheywood","html_url":"https://github.com/rusheywood","followers_url":"https://api.github.com/users/rusheywood/followers","following_url":"https://api.github.com/users/rusheywood/following{/other_user}","gists_url":"https://api.github.com/users/rusheywood/gists{/gist_id}","starred_url":"https://api.github.com/users/rusheywood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rusheywood/subscriptions","organizations_url":"https://api.github.com/users/rusheywood/orgs","repos_url":"https://api.github.com/users/rusheywood/repos","events_url":"https://api.github.com/users/rusheywood/events{/privacy}","received_events_url":"https://api.github.com/users/rusheywood/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n  it('serializeExample-deserializeExample round trip, no raw audio', () => {\r\n```","created_at":"2018-11-28T02:53:29Z","updated_at":"2018-11-28T02:53:30Z","html_url":"https://github.com/tensorflow/tfjs-models/pull/111#discussion_r236925601","pull_request_url":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/111","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/comments/236925601"},"html":{"href":"https://github.com/tensorflow/tfjs-models/pull/111#discussion_r236925601"},"pull_request":{"href":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/111","id":232790936,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNzkwOTM2","html_url":"https://github.com/tensorflow/tfjs-models/pull/111","diff_url":"https://github.com/tensorflow/tfjs-models/pull/111.diff","patch_url":"https://github.com/tensorflow/tfjs-models/pull/111.patch","issue_url":"https://api.github.com/repos/tensorflow/tfjs-models/issues/111","number":111,"state":"open","locked":false,"title":"[speech-commands] Implement Dataset serialize and deserialize; Update demo accordingly","user":{"login":"caisq","id":16824702,"node_id":"MDQ6VXNlcjE2ODI0NzAy","avatar_url":"https://avatars2.githubusercontent.com/u/16824702?v=4","gravatar_id":"","url":"https://api.github.com/users/caisq","html_url":"https://github.com/caisq","followers_url":"https://api.github.com/users/caisq/followers","following_url":"https://api.github.com/users/caisq/following{/other_user}","gists_url":"https://api.github.com/users/caisq/gists{/gist_id}","starred_url":"https://api.github.com/users/caisq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caisq/subscriptions","organizations_url":"https://api.github.com/users/caisq/orgs","repos_url":"https://api.github.com/users/caisq/repos","events_url":"https://api.github.com/users/caisq/events{/privacy}","received_events_url":"https://api.github.com/users/caisq/received_events","type":"User","site_admin":false},"body":"Add new methods to the transfer-learning class:\r\n- serializeExamples()\r\n- loadExamples()\r\n\r\nIn the demo, support\r\n- Downloading serialized examples as two files: <basename>.json and <basename>.bin\r\n- Loading from user-uploaded files of the same format as above.\r\n\r\nSee screenshot:\r\n![image](https://user-images.githubusercontent.com/16824702/49115268-616f3a00-f268-11e8-9f4d-c63b79ec833a.png)\r\n\r\n\r\n<!-- Reviewable:start -->\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/tensorflow/tfjs-models/111)\r\n<!-- Reviewable:end -->\r\n","created_at":"2018-11-21T20:32:25Z","updated_at":"2018-11-28T02:53:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c044f875c4e6bde9e886eeb32f8835b533549fb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/111/commits","review_comments_url":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/111/comments","review_comment_url":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tensorflow/tfjs-models/issues/111/comments","statuses_url":"https://api.github.com/repos/tensorflow/tfjs-models/statuses/21576f7b72c78e392c5324c138aae5f3ccfc03a0","head":{"label":"caisq:sc-dataset-2","ref":"sc-dataset-2","sha":"21576f7b72c78e392c5324c138aae5f3ccfc03a0","user":{"login":"caisq","id":16824702,"node_id":"MDQ6VXNlcjE2ODI0NzAy","avatar_url":"https://avatars2.githubusercontent.com/u/16824702?v=4","gravatar_id":"","url":"https://api.github.com/users/caisq","html_url":"https://github.com/caisq","followers_url":"https://api.github.com/users/caisq/followers","following_url":"https://api.github.com/users/caisq/following{/other_user}","gists_url":"https://api.github.com/users/caisq/gists{/gist_id}","starred_url":"https://api.github.com/users/caisq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caisq/subscriptions","organizations_url":"https://api.github.com/users/caisq/orgs","repos_url":"https://api.github.com/users/caisq/repos","events_url":"https://api.github.com/users/caisq/events{/privacy}","received_events_url":"https://api.github.com/users/caisq/received_events","type":"User","site_admin":false},"repo":{"id":142198003,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIxOTgwMDM=","name":"tfjs-models","full_name":"caisq/tfjs-models","private":false,"owner":{"login":"caisq","id":16824702,"node_id":"MDQ6VXNlcjE2ODI0NzAy","avatar_url":"https://avatars2.githubusercontent.com/u/16824702?v=4","gravatar_id":"","url":"https://api.github.com/users/caisq","html_url":"https://github.com/caisq","followers_url":"https://api.github.com/users/caisq/followers","following_url":"https://api.github.com/users/caisq/following{/other_user}","gists_url":"https://api.github.com/users/caisq/gists{/gist_id}","starred_url":"https://api.github.com/users/caisq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caisq/subscriptions","organizations_url":"https://api.github.com/users/caisq/orgs","repos_url":"https://api.github.com/users/caisq/repos","events_url":"https://api.github.com/users/caisq/events{/privacy}","received_events_url":"https://api.github.com/users/caisq/received_events","type":"User","site_admin":false},"html_url":"https://github.com/caisq/tfjs-models","description":"Pretrained models for TensorFlow.js","fork":true,"url":"https://api.github.com/repos/caisq/tfjs-models","forks_url":"https://api.github.com/repos/caisq/tfjs-models/forks","keys_url":"https://api.github.com/repos/caisq/tfjs-models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caisq/tfjs-models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caisq/tfjs-models/teams","hooks_url":"https://api.github.com/repos/caisq/tfjs-models/hooks","issue_events_url":"https://api.github.com/repos/caisq/tfjs-models/issues/events{/number}","events_url":"https://api.github.com/repos/caisq/tfjs-models/events","assignees_url":"https://api.github.com/repos/caisq/tfjs-models/assignees{/user}","branches_url":"https://api.github.com/repos/caisq/tfjs-models/branches{/branch}","tags_url":"https://api.github.com/repos/caisq/tfjs-models/tags","blobs_url":"https://api.github.com/repos/caisq/tfjs-models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caisq/tfjs-models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caisq/tfjs-models/git/refs{/sha}","trees_url":"https://api.github.com/repos/caisq/tfjs-models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caisq/tfjs-models/statuses/{sha}","languages_url":"https://api.github.com/repos/caisq/tfjs-models/languages","stargazers_url":"https://api.github.com/repos/caisq/tfjs-models/stargazers","contributors_url":"https://api.github.com/repos/caisq/tfjs-models/contributors","subscribers_url":"https://api.github.com/repos/caisq/tfjs-models/subscribers","subscription_url":"https://api.github.com/repos/caisq/tfjs-models/subscription","commits_url":"https://api.github.com/repos/caisq/tfjs-models/commits{/sha}","git_commits_url":"https://api.github.com/repos/caisq/tfjs-models/git/commits{/sha}","comments_url":"https://api.github.com/repos/caisq/tfjs-models/comments{/number}","issue_comment_url":"https://api.github.com/repos/caisq/tfjs-models/issues/comments{/number}","contents_url":"https://api.github.com/repos/caisq/tfjs-models/contents/{+path}","compare_url":"https://api.github.com/repos/caisq/tfjs-models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caisq/tfjs-models/merges","archive_url":"https://api.github.com/repos/caisq/tfjs-models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caisq/tfjs-models/downloads","issues_url":"https://api.github.com/repos/caisq/tfjs-models/issues{/number}","pulls_url":"https://api.github.com/repos/caisq/tfjs-models/pulls{/number}","milestones_url":"https://api.github.com/repos/caisq/tfjs-models/milestones{/number}","notifications_url":"https://api.github.com/repos/caisq/tfjs-models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caisq/tfjs-models/labels{/name}","releases_url":"https://api.github.com/repos/caisq/tfjs-models/releases{/id}","deployments_url":"https://api.github.com/repos/caisq/tfjs-models/deployments","created_at":"2018-07-24T18:30:20Z","updated_at":"2018-11-27T15:32:36Z","pushed_at":"2018-11-27T22:24:55Z","git_url":"git://github.com/caisq/tfjs-models.git","ssh_url":"git@github.com:caisq/tfjs-models.git","clone_url":"https://github.com/caisq/tfjs-models.git","svn_url":"https://github.com/caisq/tfjs-models","homepage":"https://js.tensorflow.org","size":23053,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"tensorflow:master","ref":"master","sha":"269e994c6478586e223bc41be63b87ab8e015b2f","user":{"login":"tensorflow","id":15658638,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1NjU4NjM4","avatar_url":"https://avatars1.githubusercontent.com/u/15658638?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"repo":{"id":127968704,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc5Njg3MDQ=","name":"tfjs-models","full_name":"tensorflow/tfjs-models","private":false,"owner":{"login":"tensorflow","id":15658638,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1NjU4NjM4","avatar_url":"https://avatars1.githubusercontent.com/u/15658638?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/tensorflow/tfjs-models","description":"Pretrained models for TensorFlow.js","fork":false,"url":"https://api.github.com/repos/tensorflow/tfjs-models","forks_url":"https://api.github.com/repos/tensorflow/tfjs-models/forks","keys_url":"https://api.github.com/repos/tensorflow/tfjs-models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tensorflow/tfjs-models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tensorflow/tfjs-models/teams","hooks_url":"https://api.github.com/repos/tensorflow/tfjs-models/hooks","issue_events_url":"https://api.github.com/repos/tensorflow/tfjs-models/issues/events{/number}","events_url":"https://api.github.com/repos/tensorflow/tfjs-models/events","assignees_url":"https://api.github.com/repos/tensorflow/tfjs-models/assignees{/user}","branches_url":"https://api.github.com/repos/tensorflow/tfjs-models/branches{/branch}","tags_url":"https://api.github.com/repos/tensorflow/tfjs-models/tags","blobs_url":"https://api.github.com/repos/tensorflow/tfjs-models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tensorflow/tfjs-models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tensorflow/tfjs-models/git/refs{/sha}","trees_url":"https://api.github.com/repos/tensorflow/tfjs-models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tensorflow/tfjs-models/statuses/{sha}","languages_url":"https://api.github.com/repos/tensorflow/tfjs-models/languages","stargazers_url":"https://api.github.com/repos/tensorflow/tfjs-models/stargazers","contributors_url":"https://api.github.com/repos/tensorflow/tfjs-models/contributors","subscribers_url":"https://api.github.com/repos/tensorflow/tfjs-models/subscribers","subscription_url":"https://api.github.com/repos/tensorflow/tfjs-models/subscription","commits_url":"https://api.github.com/repos/tensorflow/tfjs-models/commits{/sha}","git_commits_url":"https://api.github.com/repos/tensorflow/tfjs-models/git/commits{/sha}","comments_url":"https://api.github.com/repos/tensorflow/tfjs-models/comments{/number}","issue_comment_url":"https://api.github.com/repos/tensorflow/tfjs-models/issues/comments{/number}","contents_url":"https://api.github.com/repos/tensorflow/tfjs-models/contents/{+path}","compare_url":"https://api.github.com/repos/tensorflow/tfjs-models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tensorflow/tfjs-models/merges","archive_url":"https://api.github.com/repos/tensorflow/tfjs-models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tensorflow/tfjs-models/downloads","issues_url":"https://api.github.com/repos/tensorflow/tfjs-models/issues{/number}","pulls_url":"https://api.github.com/repos/tensorflow/tfjs-models/pulls{/number}","milestones_url":"https://api.github.com/repos/tensorflow/tfjs-models/milestones{/number}","notifications_url":"https://api.github.com/repos/tensorflow/tfjs-models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tensorflow/tfjs-models/labels{/name}","releases_url":"https://api.github.com/repos/tensorflow/tfjs-models/releases{/id}","deployments_url":"https://api.github.com/repos/tensorflow/tfjs-models/deployments","created_at":"2018-04-03T21:04:35Z","updated_at":"2018-11-28T00:19:15Z","pushed_at":"2018-11-28T00:19:13Z","git_url":"git://github.com/tensorflow/tfjs-models.git","ssh_url":"git@github.com:tensorflow/tfjs-models.git","clone_url":"https://github.com/tensorflow/tfjs-models.git","svn_url":"https://github.com/tensorflow/tfjs-models","homepage":"https://js.tensorflow.org","size":33665,"stargazers_count":1557,"watchers_count":1557,"language":"TypeScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":388,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":388,"open_issues":5,"watchers":1557,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/111"},"html":{"href":"https://github.com/tensorflow/tfjs-models/pull/111"},"issue":{"href":"https://api.github.com/repos/tensorflow/tfjs-models/issues/111"},"comments":{"href":"https://api.github.com/repos/tensorflow/tfjs-models/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tensorflow/tfjs-models/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/tensorflow/tfjs-models/statuses/21576f7b72c78e392c5324c138aae5f3ccfc03a0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"rusheywood"}}