Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

At text classification example#945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
atuzhykov wants to merge89 commits intodeeplearning4j:master
base:master
Choose a base branch
Loading
fromKonduitAI:at_text_classification_example

Conversation

atuzhykov
Copy link

What changes were proposed in this pull request?

(Please fill in changes proposed in this fix)

How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)

Please review
https://github.com/eclipse/deeplearning4j/blob/master/CONTRIBUTING.md before opening a pull request.

Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
l2 1e-6 > 1e-3Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
l2 1e-3 > 1e-6Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
atuzhykovand others added27 commitsMarch 5, 2020 01:03
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
)Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
…r1e-4Signed-off-by: atuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Copy link
Contributor

@AlexDBlackAlexDBlack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looking good, just a few minor improvements to make.
Can we also make a backup of the branch, then flatten + sign on this branch as described here:https://deeplearning4j.org/eclipse-contributors

Otherwise I'm happy with this 👍

* As far model is predisposed to overfitting we also add l2 regularization and dropout for certain layers.
* To prepare reviews we use BertIterator, which is MultiDataSetIterator for training BERT (Transformer) models.
* We congigure BertIterator for supervised sequence classification:
* 0. As tokenizer we use BertWordPieceTokenizerFactory with provided BERT BASE UNCASED vocabulary.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Maybe let's improve this slightly, add another line under 0.:
BertIterator and BertWordPieceTokenizer implement the Word Piece sub-word tokenization algorithm, with a vocabulary size of 30522 tokens.

int listenerFrequency = 20;
net.setListeners(new StatsListener(statsStorage, listenerFrequency), new ScoreIterationListener(50));
//Attach the StatsStorage instance to the UI: this allows the contents of the StatsStorage to be visualized
uiServer.attach(statsStorage);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Maybe let's comment out the UI by default, as it adds some overhead (slows down training a bit). Users can uncomment it if they want to run it with UI. That would look like this:

        /*        //Uncomment this section to run the example with the user interface        UIServer uiServer = UIServer.getInstance();        //Configure where the network information (gradients, activations, score vs. time etc) is to be stored        //Then add the StatsListener to collect this information from the network, as it trains        StatsStorage statsStorage = new FileStatsStorage(new File(System.getProperty("java.io.tmpdir"), "ui-stats-" + System.currentTimeMillis() + ".dl4j"));        int listenerFrequency = 20;        net.setListeners(new StatsListener(statsStorage, listenerFrequency), new ScoreIterationListener(50));        //Attach the StatsStorage instance to the UI: this allows the contents of the StatsStorage to be visualized        uiServer.attach(statsStorage);        */                net.setListeners(new ScoreIterationListener(50));

net.fit(train);

// Get and print accuracy, precision, recall & F1 and confusion matrix
Evaluation eval = net.doEvaluation(test, new Evaluation[]{new Evaluation()})[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

For MultiLayerNetwork, we can usenet.evaluate(test)

pom.xml Outdated
@@ -28,7 +28,7 @@
<properties>
<!-- Change the nd4j.backend property to nd4j-cuda-9.2-platform,nd4j-cuda-10.0-platform or nd4j-cuda-10.1-platform to use CUDA GPUs -->
<nd4j.backend>nd4j-native-platform</nd4j.backend>
<!-- <nd4j.backend>nd4j-cuda-10.2-platform</nd4j.backend>-->
<!-- <nd4j.backend>nd4j-cuda-10.0-platform</nd4j.backend>-->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Leave this commented out with 10.2

Signed-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
…ation classSigned-off-by: Andrii Tuzhykov <andrewtuzhykov@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@AlexDBlackAlexDBlackAlexDBlack requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@atuzhykov@AlexDBlack

[8]ページ先頭

©2009-2025 Movatter.jp