Data Source (Core)#
alts.core.oracle.data_source
- class DataSource(query_shape, result_shape)[source]#
Bases:
Configurable,QueryableDescriptionADataSourceis a source of learning data for the model in training.It returns results (y-values) to given queries (x-values) upon request.The generation of its data depends on the individual implementation.Generally, the same queries may return different result each time.- Parameters:
query_shape (tuple of ints) – The expected shape of the queries
result_shape (tuple of ints) – The expected shape of the results
- property exhausted: bool#
- DescriptionA
DataSourceis exhausted if all its available data has been querried.ReturnsFalseby default- Returns:
Whether the
DataSourcehas been exhausted- Return type:
boolean
- query(self, queries) data_points[source]#
- Description
query()is the access point to the data of theDataSource.It returns the results to given queries.
- query_constrain(self) QueryConstrain[source]#
- Description
query_constrain()is a getter-function for the constrains around queries to theDataSource.Constrains can affect thecount,shapeand therangesof a query.For more information, see ConstrainsCurrent ConstrainsShape:query_shapeValue Range: (-inf, inf) for all values- Returns:
Constrains around queries
- Return type:
- query_shape: Tuple[int, ...] = NOTSET#
- result_constrain(self) ResultConstrain[source]#
- DescriptionCurrent ConstrainsShape:
result_shape- Returns:
Constrains to results
- Return type:
ResultConstrain
- result_shape: Tuple[int, ...] = NOTSET#
- class TimeDataSource(query_shape)[source]#
Bases:
DataSourceDescriptionATimeDataSourceis aDataSourcein which the first entry of a query is a non-negative number (representing time).- Parameters:
result_shape (tuple of ints) – The expected shape of results
- query(self, queries) data_points[source]#
- Description
- Parameters:
queries – Requested Query
- Returns:
Processed Query, Result
- Return type:
A tuple of two NDArray
- Raises:
NotImplementedError
- query_constrain(self) QueryConstrain[source]#
- DescriptionCurrent ConstrainsShape:
query_shape, (1,)Range of first value: [0, inf)Range of other values: (-inf, inf)- Returns:
Constrains around queries
- Return type:
- query_shape: Tuple[int, ...] = (1,)#
- class TimeDataSourceWraper(query_shape, data_source)[source]#
Bases:
TimeDataSourceDescription- Parameters:
query_shape (tuple of ints) – The expected shape of queries
data_source (DataSource) – The
DataSourceto query from.
- data_source: DataSource = NOTSET#
- query(self, queries) data_points[source]#
- Description
query()queries from the initializedDataSourcedata_sourceof theTimeDataSourceWrapper. SeeDataSource.query().- Parameters:
queries – Requested Query
- Returns:
Processed Query, Result
- Return type:
A tuple of two NDArray
- query_constrain(self) QueryConstrain[source]#
- DescriptionCurrent ConstrainsShape:
query_shape, (1,)Range of first value: [0, t) where t is the upper bound of that value indata_sourceRange of other values: (-inf, inf)- Returns:
Constrains around queries
- Return type:
- query_shape: Tuple[int, ...] = (1,)#