-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d0ab0d
commit cb67111
Showing
1 changed file
with
17 additions
and
7 deletions.
There are no files selected for viewing
24 changes: 17 additions & 7 deletions
24
discojs/discojs-core/src/dataset/data_loader/data_loader.ts
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,15 +1,25 @@ | ||
import { Task } from '../..' | ||
import { Task } from '../../' | ||
import { Dataset } from '../dataset' | ||
import { Data, DataSplit } from '../data' | ||
|
||
export interface DataConfig { features?: string[], labels?: string[], shuffle?: boolean, validationSplit?: number, inference?: boolean } | ||
export interface DataConfig { | ||
features?: string[] | ||
labels?: string[] | ||
shuffle?: boolean | ||
validationSplit?: number | ||
inference?: boolean | ||
} | ||
|
||
export abstract class DataLoader<Source> { | ||
constructor (protected task: Task) {} | ||
export abstract class DataLoader< | ||
Source, | ||
Sources = Source | Source[], | ||
Config extends DataConfig = DataConfig | ||
> { | ||
constructor(protected task: Task) {} | ||
|
||
abstract createData (dataset: Dataset, size?: number): Promise<Data> | ||
abstract createData(dataset: Dataset, size?: number): Promise<Data> | ||
|
||
abstract load (source: Source, config: DataConfig): Promise<Dataset> | ||
abstract load(source: Source, config: Config): Promise<Dataset> | ||
|
||
abstract loadAll (sources: Source[], config: DataConfig): Promise<DataSplit> | ||
abstract loadAll(sources: Sources, config: Config): Promise<DataSplit> | ||
} |