-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion for dataset factory template to replace gdeep.data.torch_datasets.TorchDataLoader #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would separate the factory patter proposal + the refactoring of the constants to from the preprocessing.
The factory part can be merge, the preprocessing part of the other hand needs to adapt to the new API
""" | ||
factory = DatasetFactory() | ||
factory.register_builder("Torchvision", TorchvisionDatasetBuilder()) | ||
factory.register_builder("Tori", TorchvisionDatasetBuilder()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is should be the ToriDatasetBuilder
import numpy as np | ||
import torch | ||
from transformers import BatchFeature | ||
from transformers.feature_extraction_sequence_utils import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after our discussion, we have decided to change the API. Can you please remove this change from this branch and only keep the factory proposal as well as the creation of the consternates in gdeep.utility
import numpy as np | ||
import torch | ||
from transformers import BatchFeature | ||
from transformers.feature_extraction_sequence_utils import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after our discussion, we have decided to change the API. Can you please remove this change from this branch and only keep the factory proposal as well as the creation of the consternates in gdeep.utility
|
||
|
||
|
||
class PersistenceDiagramFeatureExtractor(FeatureExtractionMixin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here: API has changed
|
||
|
||
|
||
class PersistenceDiagramFeatureExtractor(FeatureExtractionMixin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here: API has changed
attention_masks = features['attention_mask'] | ||
del pd_extractor | ||
pd_extractor = PersistenceDiagramFeatureExtractor.from_pretrained('preprocessor_config.json') | ||
# %% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after our discussion, we have decided to change the API. Can you please remove this file from this branch and only keep the factory proposal as well as the creation of the consternates in gdeep.utility
@@ -0,0 +1,17 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after our discussion, we have decided to change the API. Can you please remove this file from this branch and only keep the factory proposal as well as the creation of the consternates in gdeep.utility
@@ -0,0 +1,17 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after our discussion, we have decided to change the API. Can you please remove this file from this branch and only keep the factory proposal as well as the creation of the consternates in gdeep.utility
@@ -0,0 +1,5 @@ | |||
# %% | |||
import torch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is incomplete, can you please remove it?
@@ -0,0 +1,5 @@ | |||
# %% | |||
import torch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is incomplete, can you please remove it?
Reference issues/PRs
[BUG] Naming of the module gdeep.data.torch_datasets #66.
Furthermore, it would be great to have a unified interface for loading custom datasets
and the default datasets. This would also allow for a consistent API for loading
datasets. The concrete issue I have is that I want to add my persistence dataset from
graphs using the same interface, though I would have to make a lot of changes to the
existing implementation of the TorchDataLoader class and hence making it harder to
maintain.
The current implementation does not allow to the passing of additional kwargs to the
TorchDataset class and these are passed onward to the custom Datasets. Compare
the issue that Nicolas had about varying the number of points per torus in the
torus dataset.
Types of changes
Description
get_dataset
function and these are passed onward to the custom Datasets.Notice this is only a suggestion on how this streamline the dataset API!