在neuraxle 文档中显示了一个示例,使用存储库在管道中延迟加载数据,请参阅以下代码:
from neuraxle.pipeline import Pipeline, MiniBatchSequentialPipeline
from neuraxle.base import ExecutionContext
from neuraxle.steps.column_transformer import ColumnTransformer
from neuraxle.steps.flow import TrainOnlyWrapper
training_data_ids = training_data_repository.get_all_ids()
context = ExecutionContext('caching_folder').set_service_locator({
BaseRepository: training_data_repository
})
pipeline = Pipeline([
ConvertIDsToLoadedData().assert_has_services(BaseRepository),
ColumnTransformer([
(range(0, 2), DateToCosineEncoder()),
(3, CategoricalEnum(categeories_count=5, starts_at_zero=True)),
]),
Normalizer(),
TrainOnlyWrapper(DataShuffler()),
MiniBatchSequentialPipeline([
Model()
], batch_size=128)
]).with_context(context)
但是,它没有显示如何实现BaseRepository和ConvertIDsToLoadedData类。实施这些课程的最佳方式是什么?谁能举个例子吗?
慕勒3428872
相关分类