Git Product home page Git Product logo

optuna-allennlp's Introduction

experimental_result

Optuna using AllenNLP

Demonstration for using Optuna with AllenNLP integration.

Quick Start

Google Colab

Open in Colab

On your computer

# create virtual environment
python3 -m venv venv
. venv/bin/activate

# install libraries
pip install -r requirements.txt

# train a model using AllenNLP cli
allennlp train -s result/allennlp config/imdb_baseline.jsonnet

# run hyperparameter optimization
python optuna_train.py

# define-and-run style example
python optuna_train_custom_trainer.py --device 0 --target_metric accuracy --base_serialization_dir result

[New!!] Use allennlp-optuna

You can use allennlp-optuna, an AllenNLP plugin for hyperparameter optimization.

# Installation
pip install allennlp-optuna

# You need to register allennlp-optuna to allennlp using .allennlp_plugins
# It is not required if .allennlp_plugins already exists on your working directory
echo 'allennlp_optuna' >> .allennlp_plugins

# optimization
allennlp tune config/imdb_optuna.jsonnet config/hparams.json --serialization-dir result

Attention!

Demonstration uses GPU. If you want to run the scripts in this repository, please update cuda_device = -1 in allennlp config and optuna_config.

Blog Articles

optuna-allennlp's People

Contributors

himkt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

optuna-allennlp's Issues

Allennlp Optuna pruner

Hi there,

Thanks for this awesome package.

Is there an allennlp Optuna pruner that is ready to be used?
I tried using the original pruner from pytorch_lighting but I couldn't figure out how to report the metric after each epoch to the metric call back model.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.