# Unsupervised - starting point

**URL:** <https://community.konduit.ai/t/unsupervised-starting-point/340>\
**Category:** DL4J\
**Created:** [March 30, 2020, 6:03pm UTC](https://community.konduit.ai/t/unsupervised-starting-point/340 "2020-03-30T18:03:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lavajaw](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/lavajaw/32/118_2.png) [@lavajaw](https://community.konduit.ai/u/lavajaw)\
**Post date:** [March 30, 2020, 6:03pm UTC](https://community.konduit.ai/t/unsupervised-starting-point/340/1 "2020-03-30T18:03:30Z")

</div>

Hello, i want to make unsupervised neural network (clustering problem) via dl4j. Where i can find some examples or what i should read first?  
Thanks

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [March 30, 2020, 6:18pm UTC](https://community.konduit.ai/t/unsupervised-starting-point/340/2 "2020-03-30T18:18:38Z")

</div>

For unsupervised clustering with neural networks you will usually train the network with reconstruction labels, or some other unsupervised task (e.g. fill in the blank for text models) and use a bottleneck layer in the middle of the network.

Once that network is trained, you use it to transform your input data into the corresponding vectors, and then apply the clustering algorithm of your choice on that.

---

<div class="post-metadata">

**Author:** ![lavajaw](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/lavajaw/32/118_2.png) [@lavajaw](https://community.konduit.ai/u/lavajaw)\
**Post date:** [March 30, 2020, 6:21pm UTC](https://community.konduit.ai/t/unsupervised-starting-point/340/3 "2020-03-30T18:21:44Z")

</div>

Is there any example I can look into?

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [March 30, 2020, 6:35pm UTC](https://community.konduit.ai/t/unsupervised-starting-point/340/4 "2020-03-30T18:35:22Z")

</div>

There are multiple ways you can approach that. One would be using a variational auto encoder, for which we have an example here:  
[https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/unsupervised/variational/VariationalAutoEncoderExample.java#L45](https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/unsupervised/variational/VariationalAutoEncoderExample.java#L45)

The anomaly detection example also features a bottleneck:  
[https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/unsupervised/sequenceanomalydetection/SequenceAnomalyDetection.java#L127-L133](https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/unsupervised/sequenceanomalydetection/SequenceAnomalyDetection.java#L127-L133)

And while outdated and therefore not copy&paste-able for running, this tutorial also covers clustering:  
[https://deeplearning4j.konduit.ai/getting-started/tutorials/advanced-autoencoder#clustering-the-output](https://deeplearning4j.konduit.ai/getting-started/tutorials/advanced-autoencoder#clustering-the-output)
