optkeras | wrapper around Keras and Optuna for hyperparameter | Machine Learning library
kandi X-RAY | optkeras Summary
kandi X-RAY | optkeras Summary
OptKeras: wrapper around Keras and Optuna for hyperparameter optimization
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Perform a random grid search
- Print the results of the study
- Sync the experiment with Optuna
- Run the optimizer
- Generate the Optuna log file
- Remove all model files that are not in the best fit
- Return the default trial value
- Returns the path to the model
- Convert a list of strings into a list
- Perform post - processing
- Called when an epoch is finished
- Save trial_best_logs as a dict
- Get the current datetime
- Calls the optimizer
- Initialize start epoch
optkeras Key Features
optkeras Examples and Code Snippets
""" Step 0. Import Keras, Optuna, and OptKeras """
from keras.models import Sequential
from keras.layers import Flatten, Dense, Conv2D
from keras.optimizers import Adam
import keras.backend as K
import optuna
from optkeras.optkeras import OptKeras
pip install optkeras
pip install git+https://github.com/Minyus/optkeras.git
python setup.py install
Community Discussions
Trending Discussions on optkeras
QUESTION
I wrote a simple Keras code, in which I use CNN for fashion mnist dataset. Everything works great. I implemented my own class and classification is OK.
However, I wanted to use Optuna, as OptKeras (Optuna wrapper for Keras), you can see an example here: https://medium.com/@Minyus86/optkeras-112bcc34ec73.
However, something is wrong with my code. When I try to use optKeras inside my own class. Here's the code: (ordinary run
method works, but optuna_run
gives an error: AttributeError: type object 'FrozenTrial' has no attribute '_field_types'
.
ANSWER
Answered 2020-Jul-06 at 23:29It seems that optkeras (version I got was 0.0.7) being not quite up-to-date with optuna library is the reason for the issue. I was able to make it work with optuna 1.5.0 by doing the following changes:
First, you'll need to monkey-patch get_default_trial
like this before running your code:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install optkeras
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page