Search in sources :

Example 1 with IrisDataFetcher

use of org.deeplearning4j.datasets.fetchers.IrisDataFetcher in project deeplearning4j by deeplearning4j.

the class DataSets method iris.

public static DataSet iris(int num) {
    IrisDataFetcher fetcher = new IrisDataFetcher();
    fetcher.fetch(num);
    return fetcher.next();
}
Also used : IrisDataFetcher(org.deeplearning4j.datasets.fetchers.IrisDataFetcher)

Example 2 with IrisDataFetcher

use of org.deeplearning4j.datasets.fetchers.IrisDataFetcher in project deeplearning4j by deeplearning4j.

the class RBMTests method testIrisRectifiedHidden.

@Test
public void testIrisRectifiedHidden() {
    IrisDataFetcher fetcher = new IrisDataFetcher();
    fetcher.fetch(150);
    DataNormalization norm = new NormalizerStandardize();
    DataSet d = fetcher.next();
    norm.fit(d);
    norm.transform(d);
    INDArray params = Nd4j.create(1, 4 * 3 + 4 + 3);
    RBM rbm = getRBMLayer(4, 3, HiddenUnit.RECTIFIED, VisibleUnit.LINEAR, params, true, false, 1, LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD);
    rbm.fit(d.getFeatureMatrix());
}
Also used : DataNormalization(org.nd4j.linalg.dataset.api.preprocessor.DataNormalization) INDArray(org.nd4j.linalg.api.ndarray.INDArray) DataSet(org.nd4j.linalg.dataset.DataSet) IrisDataFetcher(org.deeplearning4j.datasets.fetchers.IrisDataFetcher) NormalizerStandardize(org.nd4j.linalg.dataset.api.preprocessor.NormalizerStandardize) Test(org.junit.Test)

Example 3 with IrisDataFetcher

use of org.deeplearning4j.datasets.fetchers.IrisDataFetcher in project deeplearning4j by deeplearning4j.

the class RBMTests method testIrisGaussianHidden.

@Test
public void testIrisGaussianHidden() {
    IrisDataFetcher fetcher = new IrisDataFetcher();
    fetcher.fetch(150);
    DataNormalization norm = new NormalizerStandardize();
    DataSet d = fetcher.next();
    norm.fit(d);
    norm.transform(d);
    INDArray params = Nd4j.create(1, 4 * 3 + 4 + 3);
    RBM rbm = getRBMLayer(4, 3, HiddenUnit.GAUSSIAN, VisibleUnit.GAUSSIAN, params, true, false, 1, LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD);
    rbm.fit(d.getFeatureMatrix());
}
Also used : DataNormalization(org.nd4j.linalg.dataset.api.preprocessor.DataNormalization) INDArray(org.nd4j.linalg.api.ndarray.INDArray) DataSet(org.nd4j.linalg.dataset.DataSet) IrisDataFetcher(org.deeplearning4j.datasets.fetchers.IrisDataFetcher) NormalizerStandardize(org.nd4j.linalg.dataset.api.preprocessor.NormalizerStandardize) Test(org.junit.Test)

Aggregations

IrisDataFetcher (org.deeplearning4j.datasets.fetchers.IrisDataFetcher)3 Test (org.junit.Test)2 INDArray (org.nd4j.linalg.api.ndarray.INDArray)2 DataSet (org.nd4j.linalg.dataset.DataSet)2 DataNormalization (org.nd4j.linalg.dataset.api.preprocessor.DataNormalization)2 NormalizerStandardize (org.nd4j.linalg.dataset.api.preprocessor.NormalizerStandardize)2