{"action":"created","issue":{"url":"https://api.github.com/repos/bmcfee/pumpp/issues/5","repository_url":"https://api.github.com/repos/bmcfee/pumpp","labels_url":"https://api.github.com/repos/bmcfee/pumpp/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/bmcfee/pumpp/issues/5/comments","events_url":"https://api.github.com/repos/bmcfee/pumpp/issues/5/events","html_url":"https://github.com/bmcfee/pumpp/issues/5","id":163679496,"number":5,"title":"Sampler module","user":{"login":"bmcfee","id":1190540,"avatar_url":"https://avatars.githubusercontent.com/u/1190540?v=3","gravatar_id":"","url":"https://api.github.com/users/bmcfee","html_url":"https://github.com/bmcfee","followers_url":"https://api.github.com/users/bmcfee/followers","following_url":"https://api.github.com/users/bmcfee/following{/other_user}","gists_url":"https://api.github.com/users/bmcfee/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcfee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcfee/subscriptions","organizations_url":"https://api.github.com/users/bmcfee/orgs","repos_url":"https://api.github.com/users/bmcfee/repos","events_url":"https://api.github.com/users/bmcfee/events{/privacy}","received_events_url":"https://api.github.com/users/bmcfee/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bmcfee/pumpp/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"bmcfee","id":1190540,"avatar_url":"https://avatars.githubusercontent.com/u/1190540?v=3","gravatar_id":"","url":"https://api.github.com/users/bmcfee","html_url":"https://github.com/bmcfee","followers_url":"https://api.github.com/users/bmcfee/followers","following_url":"https://api.github.com/users/bmcfee/following{/other_user}","gists_url":"https://api.github.com/users/bmcfee/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcfee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcfee/subscriptions","organizations_url":"https://api.github.com/users/bmcfee/orgs","repos_url":"https://api.github.com/users/bmcfee/repos","events_url":"https://api.github.com/users/bmcfee/events{/privacy}","received_events_url":"https://api.github.com/users/bmcfee/received_events","type":"User","site_admin":false},"assignees":[{"login":"bmcfee","id":1190540,"avatar_url":"https://avatars.githubusercontent.com/u/1190540?v=3","gravatar_id":"","url":"https://api.github.com/users/bmcfee","html_url":"https://github.com/bmcfee","followers_url":"https://api.github.com/users/bmcfee/followers","following_url":"https://api.github.com/users/bmcfee/following{/other_user}","gists_url":"https://api.github.com/users/bmcfee/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcfee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcfee/subscriptions","organizations_url":"https://api.github.com/users/bmcfee/orgs","repos_url":"https://api.github.com/users/bmcfee/repos","events_url":"https://api.github.com/users/bmcfee/events{/privacy}","received_events_url":"https://api.github.com/users/bmcfee/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-07-04T13:41:54Z","updated_at":"2016-08-31T16:05:05Z","closed_at":null,"body":"Given a data dict, implement patch/frame sampling.\r\n\r\n### Interface:\r\n\r\n- Patch duration\r\n   - None = full track\r\n- Multi-annotation policy\r\n   - random sample for each patch (flatten the annotation index)\r\n   - all annotations\r\n- Keys\r\n   - if None, return all\r\n   - else, filter to only sample `'{key}/*'` from the data dict, for each selected key\r\n- n_samples\r\n\r\n### Partial annotation policies?\r\n- Only return slices where all annotations are annotated?\r\n   - does not scale / hard to make work with multiple annotations\r\n- Dynamic masking\r\n   - BaseTaskTransformer should record the valid range (in frames) for the annotation, not the `mask`.  Empty annotations have a valid range of `[0,0)`.\r\n   - Whenever a patch is sampled, compute the overlap of the sample index with the valid range, and use a threshold to determine `mask`."},"comment":{"url":"https://api.github.com/repos/bmcfee/pumpp/issues/comments/243813697","html_url":"https://github.com/bmcfee/pumpp/issues/5#issuecomment-243813697","issue_url":"https://api.github.com/repos/bmcfee/pumpp/issues/5","id":243813697,"user":{"login":"bmcfee","id":1190540,"avatar_url":"https://avatars.githubusercontent.com/u/1190540?v=3","gravatar_id":"","url":"https://api.github.com/users/bmcfee","html_url":"https://github.com/bmcfee","followers_url":"https://api.github.com/users/bmcfee/followers","following_url":"https://api.github.com/users/bmcfee/following{/other_user}","gists_url":"https://api.github.com/users/bmcfee/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcfee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcfee/subscriptions","organizations_url":"https://api.github.com/users/bmcfee/orgs","repos_url":"https://api.github.com/users/bmcfee/repos","events_url":"https://api.github.com/users/bmcfee/events{/privacy}","received_events_url":"https://api.github.com/users/bmcfee/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T16:05:04Z","updated_at":"2016-08-31T16:05:04Z","body":"How should this actually be implemented?  We have a few options.\r\n\r\n1. Pure generator function:\r\n```python\r\ndata_dict = pumpp.apply(aud_f, jams_f, *transformers)\r\n\r\nfor sample in sampler(data_dict, patch_duration, keys, n_samples):\r\n    ...\r\n```\r\nThis is the simplest approach, and resembles the prior implementation in crema.\r\nThe downside of this approach is that you have to instantiate multiple generators when dealing with multiple files, and synchronize parameters between them.\r\n\r\n2. Object per stream:\r\n```python\r\ndata_dict = pumpp.apply(aud_f, jams_f, *transformers)\r\nsampler = pumpp.Sampler(data_dict, patch_duration, keys, n_samples)\r\n\r\nfor sample in sampler:\r\n    ...\r\n```\r\nThis has the same drawbacks as above, but is portable across process boundaries.\r\n\r\n3. Shared object, per-datum generators:\r\n```python\r\ndata_dict = pumpp.apply(aud_f, jams_f, *transformers)\r\nsampler = pumpp.Sampler(patch_duration, keys, n_samples)\r\n\r\nfor sample in sampler(data_dict):\r\n    ...\r\n```\r\n\r\nThis one is nice because you can share the sampler object across all input files.  It should also play nicely with pescador streamer objects."}}
{"actor":{"display_login":"bmcfee"}}