# How to optimize textCNN with non-static word2vec

**URL:** <https://community.konduit.ai/t/how-to-optimize-textcnn-with-non-static-word2vec/439>\
**Category:** DL4J\
**Created:** [April 22, 2020, 2:15am UTC](https://community.konduit.ai/t/how-to-optimize-textcnn-with-non-static-word2vec/439 "2020-04-22T02:15:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackwingf](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/blackwingf/32/87_2.png) [@blackwingf](https://community.konduit.ai/u/blackwingf)\
**Post date:** [April 22, 2020, 2:15am UTC](https://community.konduit.ai/t/how-to-optimize-textcnn-with-non-static-word2vec/439/1 "2020-04-22T02:15:25Z")

</div>

I learned that word vector from word2vec can be fine tuned when training textCNN model, so how to set the params in textCNN example?

---

<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:** [April 22, 2020, 6:32am UTC](https://community.konduit.ai/t/how-to-optimize-textcnn-with-non-static-word2vec/439/2 "2020-04-22T06:32:54Z")

</div>

You can easily use any of the DL4J Word Vector implementations as the Initialization for an Embedding Layer.

All you have to do is set it as the `.weightInit` for that layer with:

> **[Eclipse Deeplearning4j](https://github.com/deeplearning4j)**
>
> The Eclipse Deeplearning4j Project. Eclipse Deeplearning4j has 3 repositories available. Follow their code on GitHub.

And EmbeddingInitializer is implemented by all of the Embedding generating classes:

> All Known Implementing Classes:  
> [ArrayEmbeddingInitializer](https://deeplearning4j.org/api/latest/org/deeplearning4j/nn/weights/embeddings/ArrayEmbeddingInitializer.html), [FastText](https://deeplearning4j.org/api/latest/org/deeplearning4j/models/fasttext/FastText.html), [Glove](https://deeplearning4j.org/api/latest/org/deeplearning4j/models/glove/Glove.html), [Node2Vec](https://deeplearning4j.org/api/latest/org/deeplearning4j/models/node2vec/Node2Vec.html), [ParagraphVectors](https://deeplearning4j.org/api/latest/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.html), [SequenceVectors](https://deeplearning4j.org/api/latest/org/deeplearning4j/models/sequencevectors/SequenceVectors.html), [SparkParagraphVectors](https://deeplearning4j.org/api/latest/org/deeplearning4j/spark/models/paragraphvectors/SparkParagraphVectors.html), [SparkSequenceVectors](https://deeplearning4j.org/api/latest/org/deeplearning4j/spark/models/sequencevectors/SparkSequenceVectors.html), [SparkWord2Vec](https://deeplearning4j.org/api/latest/org/deeplearning4j/spark/models/word2vec/SparkWord2Vec.html), [StaticWord2Vec](https://deeplearning4j.org/api/latest/org/deeplearning4j/models/word2vec/StaticWord2Vec.html), [Word2Vec](https://deeplearning4j.org/api/latest/org/deeplearning4j/models/word2vec/Word2Vec.html), [Word2Vec](https://deeplearning4j.org/api/latest/org/deeplearning4j/spark/models/embeddings/word2vec/Word2Vec.html), [WordVectorsImpl](https://deeplearning4j.org/api/latest/org/deeplearning4j/models/embeddings/wordvectors/WordVectorsImpl.html)

---

<div class="post-metadata">

**Author:** ![jcabot](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/jcabot/32/700_2.png) [@jcabot](https://community.konduit.ai/u/jcabot)\
**Post date:** [December 31, 2021, 12:42pm UTC](https://community.konduit.ai/t/how-to-optimize-textcnn-with-non-static-word2vec/439/3 "2021-12-31T12:42:43Z")

</div>

Where is this textCNN example? I tried to find it in the docs and on deeplearning4j-examples repo but I couldn’t find it.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [December 31, 2021, 12:47pm UTC](https://community.konduit.ai/t/how-to-optimize-textcnn-with-non-static-word2vec/439/4 "2021-12-31T12:47:31Z")

</div>

@jcabot We deleted a lot of older examples with the most recent release due to lack of polish. You may find the old examples here: [GitHub - eclipse/deeplearning4j-examples at ab\_beta7](https://github.com/eclipse/deeplearning4j-examples/tree/ab_beta7)
