|
| 1 | +--- |
| 2 | +title: Release notes 1.4.1 |
| 3 | +tags: [getting_started,release_notes] |
| 4 | +keywords: release notes, announcements, what's new, new features |
| 5 | +last_updated: March 26, 2017 |
| 6 | +summary: "Version 1.4.1 of DynaML, released March 26, 2017, implements a number of new models (Extended Skew GP, student T process, generalized least squares, etc) and features." |
| 7 | +sidebar: mydoc_sidebar |
| 8 | +permalink: mydoc_release_notes_141.html |
| 9 | +folder: mydoc |
| 10 | +--- |
| 11 | + |
| 12 | +## Pipes API |
| 13 | + |
| 14 | +### Additions |
| 15 | + |
| 16 | +The pipes API has been vastly extended by creating pipes which encapsulate functions of multiple arguments leading to the following end points. |
| 17 | + |
| 18 | + - `DataPipe2[A, B, C]`: Pipe which takes 2 arguments |
| 19 | + - `DataPipe3[A, B, C, D]` : Pipe which takes 3 arguments |
| 20 | + - `DataPipe4[A, B, C, D, E]`: Pipe which takes 4 arguments |
| 21 | + |
| 22 | +Furthermore there is now the ability to create pipes which return pipes, something akin to curried functions in functional programming. |
| 23 | + |
| 24 | + - `MetaPipe`: Takes an argument returns a `DataPipe` |
| 25 | + - `MetaPipe21`: Takes 2 arguments returns a `DataPipe` |
| 26 | + - `MetaPipe12`: Takes an argument returns a `DataPipe2` |
| 27 | + |
| 28 | + |
| 29 | + A new kind of Stream data pipe, `StreamFlatMapPipe` is added to represent data pipelines which can perform flat map like operations on streams. |
| 30 | + |
| 31 | + |
| 32 | +```scala |
| 33 | +val mapFunc: (I) => Stream[J] = ... |
| 34 | +val streamFMPipe = StreamFlatMapPipe(mapFunc) |
| 35 | +``` |
| 36 | + |
| 37 | + - Added Data Pipes API for Apache Spark RDDs. |
| 38 | + |
| 39 | +```scala |
| 40 | +val num = 20 |
| 41 | +val numbers = sc.parallelize(1 to num) |
| 42 | +val convPipe = RDDPipe((n: Int) => n.toDouble) |
| 43 | + |
| 44 | +val sqPipe = RDDPipe((x: Double) => x*x) |
| 45 | + |
| 46 | +val sqrtPipe = RDDPipe((x: Double) => math.sqrt(x)) |
| 47 | + |
| 48 | +val resultPipe = RDDPipe((r: RDD[Double]) => r.reduce(_+_).toInt) |
| 49 | + |
| 50 | +val netPipeline = convPipe > sqPipe > sqrtPipe > resultPipe |
| 51 | +netPipeline(numbers) |
| 52 | +``` |
| 53 | + |
| 54 | + - Added `UnivariateGaussianScaler` class for gaussian scaling of univariate data. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +## Core API |
| 60 | + |
| 61 | +### Additions |
| 62 | + |
| 63 | + |
| 64 | +**Package** `dynaml.models.bayes` |
| 65 | + |
| 66 | +This new package will house stochastic prior models, currently there is support for GP and Skew GP priors, to see a starting example see `stochasticPriors.sc` in the `scripts` directory of the DynaML source. |
| 67 | + |
| 68 | +---- |
| 69 | + |
| 70 | +**Package** `dynaml.kernels` |
| 71 | + |
| 72 | + - Added `evaluateAt(h)(x,y)` and `gradientAt(h)(x,y)`; expressing `evaluate(x,y)` and `gradient(x,y)` in terms of them |
| 73 | + - Added `asPipe` method for Covariance Functions |
| 74 | + - For backwards compatibility users are advised to extend |
| 75 | + `LocalSVMKernel` in their custom Kernel implementations incase they do |
| 76 | + not want to implement the `evaluateAt` API endpoints. |
| 77 | + - Added [`FeatureMapKernel`](https://github.com/transcendent-ai-labs/DynaML/blob/master/dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/lm/SparkLogisticGLM.scala), representing kernels which can be explicitly decomposed into feature mappings. |
| 78 | + - Added Matern half integer kernel [`GenericMaternKernel[I]`](https://github.com/transcendent-ai-labs/DynaML/blob/master/dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/kernels/GenericMaternKernel.scala) |
| 79 | + - Added `block(S: String*)` method to block any hyper-parameters of kernels. |
| 80 | + - Added `NeuralNetworkKernel` and `GaussianSpectralKernel`. |
| 81 | + - Added `DecomposableCovariance` |
| 82 | + |
| 83 | +```scala |
| 84 | +import io.github.mandar2812.dynaml.DynaMLPipe._ |
| 85 | +import io.github.mandar2812.dynaml.kernels._ |
| 86 | + |
| 87 | + |
| 88 | +implicit val ev = VectorField(6) |
| 89 | +implicit val sp = breezeDVSplitEncoder(2) |
| 90 | +implicit val sumR = sumReducer |
| 91 | + |
| 92 | +val kernel = new LaplacianKernel(1.5) |
| 93 | +val other_kernel = new PolynomialKernel(1, 0.05) |
| 94 | + |
| 95 | +val decompKernel = new DecomposableCovariance(kernel, other_kernel)(sp, sumReducer) |
| 96 | + |
| 97 | +val other_kernel1 = new FBMKernel(1.0) |
| 98 | + |
| 99 | +val decompKernel1 = new DecomposableCovariance(decompKernel, other_kernel1)(sp, sumReducer) |
| 100 | + |
| 101 | +val veca = DenseVector.tabulate[Double](8)(math.sin(_)) |
| 102 | +val vecb = DenseVector.tabulate[Double](8)(math.cos(_)) |
| 103 | + |
| 104 | +decompKernel1.evaluate(veca, vecb) |
| 105 | + |
| 106 | +``` |
| 107 | + |
| 108 | +---- |
| 109 | + |
| 110 | +**Package** `dynaml.algebra` |
| 111 | + |
| 112 | +Partitioned Matrices/Vectors and the following operations |
| 113 | + - Addition, Subtraction |
| 114 | + - Matrix, vector multiplication |
| 115 | + - LU, Cholesky |
| 116 | + - A\y, A\Y |
| 117 | + |
| 118 | +Added calculation of quadratic forms, namely: |
| 119 | + |
| 120 | + - `quadraticForm` which calculates x<sup>T</sup> A<sup>-1</sup> x |
| 121 | + - `crossQuadraticForm` which calculates y<sup>T</sup> A<sup>-1</sup> x |
| 122 | + |
| 123 | +Where A is assumed to be a symmetric positive semi-definite matrix |
| 124 | + |
| 125 | +Usage: |
| 126 | + |
| 127 | +```scala |
| 128 | +import io.github.mandar2812.dynaml.algebra._ |
| 129 | + |
| 130 | +val x: DenseVector[Double] = ... |
| 131 | +val y: DenseVector[Double] = ... |
| 132 | +val a: DenseMatrix[Double] = ... |
| 133 | + |
| 134 | +quadraticForm(a,x) |
| 135 | +crossQuadraticForm(y, a, x) |
| 136 | + |
| 137 | +``` |
| 138 | + |
| 139 | +---- |
| 140 | + |
| 141 | +**Package** `dynaml.modelpipe` |
| 142 | + |
| 143 | +New package created, moved all inheriting classes of `ModelPipe` to this package. |
| 144 | + |
| 145 | +Added the following: |
| 146 | + |
| 147 | + - `GLMPipe2` A pipe taking two arguments and returning a `GeneralizedLinearModel` instance |
| 148 | + - `GeneralizedLeastSquaresPipe2`: |
| 149 | + - `GeneralizedLeastSquaresPipe3`: |
| 150 | + |
| 151 | +---- |
| 152 | + |
| 153 | +**Package** `dynaml.models` |
| 154 | + |
| 155 | + - Added a new Neural Networks API: `NeuralNet` and `GenericFFNeuralNet`, for an example refer to `TestNNDelve` in `dynaml-examples`. |
| 156 | + - `GeneralizedLeastSquaresModel`: The [GLS](https://en.wikipedia.org/wiki/Generalized_least_squares) model. |
| 157 | + - `ESGPModel`: The implementation of a skew gaussian process regression model |
| 158 | + - [Warped Gaussian Process](https://github.com/transcendent-ai-labs/DynaML/blob/master/dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/gp/WarpedGPModel.scala) models **WIP** |
| 159 | + - Added mean function capability to Gaussian Process and Student T process models. |
| 160 | + - Added Apache Spark implementation of Generalized Linear Models; see [SparkGLM](https://github.com/transcendent-ai-labs/DynaML/blob/master/dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/lm/SparkGLM.scala), [SparkLogisticModel](https://github.com/transcendent-ai-labs/DynaML/blob/master/dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/lm/SparkLogisticGLM.scala), [SparkProbitGLM](https://github.com/transcendent-ai-labs/DynaML/blob/master/dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/lm/SparkLogisticGLM.scala) |
| 161 | + |
| 162 | + ---- |
| 163 | + |
| 164 | +**Package** `dynaml.probability` |
| 165 | + |
| 166 | + - `MultivariateSkewNormal` as specified in [Azzalani et. al](https://arxiv.org/pdf/0911.2093.pdf) |
| 167 | + - `ExtendedMultivariateSkewNormal` |
| 168 | + - `UESN` and `MESN` representing an alternative formulation of the skew gaussian family from Adcock and Shutes. |
| 169 | + - `TruncatedGaussian`: Truncated version of the Gaussian distribution. |
| 170 | + - [Matrix Normal Distribution](https://en.wikipedia.org/wiki/Matrix_normal_distribution) |
| 171 | + - Added _Expectation_ operator for `RandomVariable` implementations in the `io.github.mandar2812.dynaml.probability` package object. Usage example given below. |
| 172 | + - `SkewGaussian`, `ExtendedSkewGaussian`: An breeze implementation of the SkewGaussian and extended Skew-Gaussian distributions respectively |
| 173 | + - `PushforwardMap`, `DifferentiableMap` added: `PushforwardMap` enables creating new random variables with defined density from base random variables. |
| 174 | + |
| 175 | +``` scala |
| 176 | +import io.github.mandar2812.dynaml.analysis._ |
| 177 | +import io.github.mandar2812.dynaml.probability._ |
| 178 | +import io.github.mandar2812.dynaml.probability.distributions._ |
| 179 | + |
| 180 | +val g = GaussianRV(0.0, 0.25) |
| 181 | +val sg = RandomVariable(SkewGaussian(1.0, 0.0, 0.25)) |
| 182 | + |
| 183 | +//Define a determinant implementation for the Jacobian type (Double in this case) |
| 184 | +implicit val detImpl = identityPipe[Double] |
| 185 | + |
| 186 | +//Defines a homeomorphism y = exp(x) x = log(y) |
| 187 | +val h: PushforwardMap[Double, Double, Double] = PushforwardMap( |
| 188 | + DataPipe((x: Double) => math.exp(x)), |
| 189 | + DifferentiableMap( |
| 190 | + (x: Double) => math.log(x), |
| 191 | + (x: Double) => 1.0/x) |
| 192 | +) |
| 193 | + |
| 194 | +//Creates a log-normal random variable |
| 195 | +val p = h->g |
| 196 | + |
| 197 | +//Creates a log-skew-gaussian random variable |
| 198 | +val q = h->sg |
| 199 | + |
| 200 | +//Calculate expectation of q |
| 201 | +println("E[Q] = "+E(q)) |
| 202 | +``` |
| 203 | + - Added _Markov Chain Monte Carlo_ (MCMC) based inference schemes `ContinuousMCMC` and the underlying sampling implementation in `GeneralMetropolisHastings`. |
| 204 | + - Added implementation of _Approximate Bayesian Computation_ (ABC) in the `ApproxBayesComputation` class. |
| 205 | + |
| 206 | + |
| 207 | +``` scala |
| 208 | +//The mean |
| 209 | +val center: DenseMatrix[Double] = ... |
| 210 | +//Covariance (positive semi-def) matrix among rows |
| 211 | +val sigmaRows: DenseMatrix[Double] = ... |
| 212 | +//Covariance (positive semi-def) matrix among columns |
| 213 | +val sigmaCols: DenseMatrix[Double] = ... |
| 214 | +val matD = MatrixNormal(center, sigmaRows, sigmaCols) |
| 215 | +``` |
| 216 | + - [Matrix T Distribution](https://en.wikipedia.org/wiki/Matrix_t-distribution) (_Experimental_) |
| 217 | + |
| 218 | +``` scala |
| 219 | +//The degrees of freedom (must be > 2.0 for existence of finite moments) |
| 220 | +val mu: Double = ... |
| 221 | +//The mean |
| 222 | +val center: DenseMatrix[Double] = ... |
| 223 | +//Covariance (positive semi-def) matrix among rows |
| 224 | +val sigmaRows: DenseMatrix[Double] = ... |
| 225 | +//Covariance (positive semi-def) matrix among columns |
| 226 | +val sigmaCols: DenseMatrix[Double] = ... |
| 227 | +val matD = MatrixT(mu, center, sigmaCols, sigmaRows) |
| 228 | +``` |
| 229 | + |
| 230 | +---- |
| 231 | + |
| 232 | +**Package** `dynaml.optimization` |
| 233 | + |
| 234 | + - Added `ProbGPCommMachine` which performs grid search or CSA and then instead of selecting a single hyper-parameter configuration calculates a weighted Gaussian Process committee where the weights correspond to probabilities or confidence on each model instance (hyper-parameter configuration). |
| 235 | + |
| 236 | +**Package** `dynaml.utils` |
| 237 | + |
| 238 | + - Added [multivariate gamma function](https://en.wikipedia.org/wiki/Multivariate_gamma_function) |
| 239 | + |
| 240 | +``` scala |
| 241 | +//Returns logarithm of multivariate gamma function |
| 242 | +val g = mvlgamma(5, 1.5) |
| 243 | +``` |
| 244 | + |
| 245 | +---- |
| 246 | + |
| 247 | +**Package** `dynaml.dataformat` |
| 248 | + |
| 249 | + - Added support for reading _MATLAB_ `.mat` files in the [`MAT`](https://github.com/transcendent-ai-labs/DynaML/blob/master/dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/dataformat/MAT.scala) object. |
| 250 | + |
| 251 | + |
| 252 | +### Improvements/Bug Fixes |
| 253 | + |
| 254 | +**Package** `dynaml.probability` |
| 255 | + |
| 256 | + - Removed `ProbabilityModel` and replaced with `JointProbabilityScheme` and `BayesJointProbabilityScheme`, major refactoring to `RandomVariable` API. |
| 257 | + |
| 258 | +---- |
| 259 | + |
| 260 | +**Package** `dynaml.optimization` |
| 261 | + |
| 262 | + - Improved logging of `CoupledSimulatedAnnealing` |
| 263 | + - Refactored `GPMLOptimizer` to `GradBasedGlobalOptimizer` |
| 264 | + |
| 265 | +---- |
| 266 | + |
| 267 | +**Package** `dynaml.utils` |
| 268 | + - Correction to `utils.getStats` method used for calculating mean and variance of data sets consisting of `DenseVector[Double]`. |
| 269 | + - `minMaxScalingTrainTest` `minMaxScaling` of `DynaMLPipe` using `GaussianScaler` instead of `MinMaxScaler` for processing of features. |
| 270 | + |
| 271 | +---- |
| 272 | + |
| 273 | +**Package** `dynaml.kernels` |
| 274 | + |
| 275 | + - Fix to `CoRegCauchyKernel`: corrected mismatch of hyper-parameter string |
| 276 | + - Fix to `SVMKernel` objects matrix gradient computation in the case when kernel dimensions are not multiples of block size. |
| 277 | + - Correction to gradient calculation in RBF kernel family. |
| 278 | + - Speed up of kernel gradient computation, kernel and kernel gradient matrices with respect to the model hyper-parameters now calculated in a single pass through the data. |
0 commit comments