Skip to content

Commit ef3b9b5

Browse files
committed
docs: Preparing release notes for v1.5.3 [WIP 4]
Signed-off-by: mandar2812 <[email protected]>
1 parent 51b8e44 commit ef3b9b5

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

docs/releases/mydoc_release_notes_153.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,35 @@
44

55
## Additions
66

7+
### Data Set API
78

9+
The `DataSet` family of classes helps the user to create and transform potentially large number of data instances.
10+
Users can create and perform complex transformations on data sets, using the `DataPipe` API or simple Scala functions.
11+
12+
```scala
13+
import _root_.io.github.mandar2812.dynaml.probability._
14+
import _root_.io.github.mandar2812.dynaml.pipes._
15+
import io.github.mandar2812.dynaml.tensorflow._
16+
17+
18+
val random_numbers = GaussianRV(0.0, 1.0) :* GaussianRV(1.0, 2.0)
19+
20+
//Create a data set.
21+
val dataset1 = dtfdata.dataset(random_numbers.iid(10000).draw)
22+
23+
val filter_gr_zero = DataPipe[(Double, Double), Boolean](c => c._1 > 0d && c._2 > 0d)
24+
25+
//Filter elements
26+
val data_gr_zero = dataset1.filter(filter_gr_zero)
27+
28+
val abs_func: (Double, Double) => (Double, Double) = (c: (Double, Double)) => (math.abs(c._1), math.abs(c._2))
29+
30+
//Map elements
31+
val data_abs = dataset1.map(abs_func)
32+
33+
```
34+
35+
Find out more about the `DataSet` API and its capabilities in the scala [docs]().
836

937
### Tensorflow Integration
1038

@@ -69,6 +97,9 @@
6997

7098
#### Dynamical Systems: Continuous Time RNN
7199

100+
Continuous time recurrent neural networks (CTRNN) are an important class of recurrent neural networks. They enable
101+
the modelling of non-linear and potentially complex dynamical systems of multiple variables, with feedback.
102+
72103
- Added CTRNN layer: `dtflearn.ctrnn`
73104

74105
- Added CTRNN layer with inferable time step: `dtflearn.dctrnn`.

dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/tensorflow/data/DataSet.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,23 @@ class DataSet[X](val data: Iterable[X]) {
5151

5252
lazy val size: Int = data.toSeq.length
5353

54+
55+
def filter(filterFn: X => Boolean): DataSet[X] = DataSet[X](data.filter(filterFn))
56+
5457
/**
5558
* Filter elements of this data set which satisfy
5659
* a predicate.
5760
* */
58-
def filter(pipe: DataPipe[X, Boolean]): DataSet[X] = DataSet[X](self.data.filter(pipe(_)))
61+
def filter(pipe: DataPipe[X, Boolean]): DataSet[X] = filter(pipe.run _)
62+
63+
64+
def filterNot(filterFn: X => Boolean): DataSet[X] = DataSet[X](data.filterNot(filterFn))
5965

6066
/**
6167
* Filter elements of this data set which does not
6268
* satisfy a predicate.
6369
* */
64-
def filterNot(pipe: DataPipe[X, Boolean]): DataSet[X] = DataSet[X](self.data.filterNot(pipe(_)))
70+
def filterNot(pipe: DataPipe[X, Boolean]): DataSet[X] = filterNot(pipe.run _)
6571

6672
/**
6773
* Creates a new data set of type [[Y]]
@@ -101,6 +107,9 @@ class DataSet[X](val data: Iterable[X]) {
101107
* */
102108
def concatenate(other: DataSet[X]): DataSet[X] = DataSet[X](self.data ++ other.data)
103109

110+
111+
def transform[Y](transformation: Iterable[X] => Iterable[Y]): DataSet[Y] = DataSet[Y](transformation(data))
112+
104113
/**
105114
* Transform the underlying collection in a way that uses potentially all of its elements.
106115
* */

0 commit comments

Comments
 (0)