I have several two-dimensional graphs, each of which has seven unique numerical characteristics that can be used to generate these graphs. I have the x and y coordinates of all these graphs, along with their numerical characteristics, in the form of a large number of CSV files. I want to predict the numerical characteristics of each of these graphs by using a machine learning or deep learning model (either by using the images of the graphs or by using the coordinates of the points of each of the graphs)
For example, here is one of my graphs:
And the unique numerical characteristics of this graph are [8.76e15, 8e-1, 5e-2, 5e-3, 5e-2, 9.65e-1, 2.1e-9] (I have the coordinate pairs (x, y) of all the points of this graph in the form of a two-column CSV file and I can work with them as well).
So far, I have looked for many pre-trained models and searched sites like HuggingFace for such models and also searched a lot in GitHub codes. I also searched the Papers with Code site for articles that have done the same thing, but unfortunately, I still haven't found anything! I tried several times to write a network myself, but due to the complexities of doing this and not having enough knowledge about how to set the hyperparameters of the network to achieve the desired result, I encountered many errors and could not do this!
For example, I wrote the following code:
X = []
y = []
directory = "data"
for csv_file in os.listdir(directory):
data = pd.read_csv(f"{directory}/{csv_file}")
X.append(data.iloc[1:, :2].astype(float).values)
y.append(data.iloc[0, 2:].astype(float).values)
X = np.array(X, dtype=np.float64) # X.shape: (50000, 253, 2)
y = np.array(y, dtype=np.float64) # y.shape: (50000, 7)
X_train = X[:40000, :, :]
X_val = X[40000:, :, :]
y_train = y[:40000, :]
y_val = y[40000:, :]
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_val_scaled = scaler.fit_transform(X_val)
inputs = keras.layers.Input(shape=(X.shape[1], X.shape[2]))
lstm_out = keras.layers.LSTM(32)(inputs)
outputs = keras.layers.Dense(7)(lstm_out)
model = keras.Model(inputs=inputs, outputs=outputs)
model.compile(optimizer=keras.optimizers.Adam(learning_rate=0.01), loss="mse")
model.summary()
history = model.fit(
x=X_train,
y=y_train,
epochs=10,
)
which had a very high loss and was not good at all.
How can I do this?