-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from hyp1231/master
REFACTOR: data & sampler & dataloader
- Loading branch information
Showing
6 changed files
with
153 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .dataset import * | ||
from .data import Data | ||
from .dataloader import * |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
# @Author : Yupeng Hou | ||
# @Email : houyupeng@ruc.edu.cn | ||
# @File : dataloader.py | ||
|
||
from torch.utils import data | ||
from sampler import Sampler | ||
|
||
class AbstractDataLoader(data.DataLoader): | ||
def __init__(self, config, dataset): | ||
self.config = config | ||
self.dataset = dataset | ||
self.sampler = Sampler(config, dataset) | ||
|
||
class PairwiseDataLoader(AbstractDataLoader): | ||
def __init__(self, config, dataset): | ||
super(PairwiseDataLoader, self).__init__(config, dataset) |
Oops, something went wrong.