My code has an issue identifying the search space in grid search. #5417
Labels
invalid/unrelated
unrelated to this project or invalid type of issues
needs-more-info
More info is needed to complete the issue
"I am working on the backend code of my Jupyter Notebook, and I'm encountering an issue when running the model. Here's the code:
`# Imports
import numpy as np
import pandas as pd
from scipy import stats
Sklearn
from sklearn.metrics import r2_score
from ML.ml_utils import *
from sklearn.model_selection import train_test_split
FNN
import tensorflow as tf
import keras_tuner as kt
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, BatchNormalization
from tensorflow.keras.optimizers import SGD, Adam
from tensorflow.keras.callbacks import EarlyStopping
from keras_tuner import HyperParameters
from keras_tuner import Objective
from keras_tuner.tuners import GridSearch, RandomSearch
from your_module import create_model
FeedForwardNN and related classes
class FeedForwardNN(tf.keras.Model):
def init(self, input_dim=None, random_seed=42):
super(FeedForwardNN, self).init()
self.seed = random_seed
self.input_dim = 2048
self.model = self.build_model()
When I attempt to run the hyperparameter search with this setup, the search_space_summary() displays the following output:
Search space summaryDefault search space size: 0
`
As a result, the hyperparameter search doesn't execute. I suspect the issue is related to the hp=kt.HyperParameters configuration, but I have tried multiple approaches without success.
Does anyone have suggestions for how to correct this and enable proper hyperparameter tuning?"
The text was updated successfully, but these errors were encountered: