0
$\begingroup$

For a uni project I'm trying to fit a keras sequential model to a few thousand given datapoints with are approximately in the range $y \in [-0.03,0.03]$ and have the domain $x \in (0, 409.6)$.

I'm using the following model definition

Sequential([
  Input(shape=(1,)),
  feature_normalizer,
  layers.Dense(512, activation='relu'),
  layers.Dense(512, activation='relu'),
  layers.Dense(512, activation='relu'),
  layers.Dense(512, activation='relu'),
  layers.Dense(512, activation='relu'),
  layers.Dense(1, activation="linear")
])

a batch size of 32 and the Adam Optimizer with a learning rate ot 0.0001.

Using this configuration and 10000 epochs some parts of the domain are really poorly fitted: Poorly fitted data whereas the approximation is better in other areas: Good fitted data

My loss history looks like this Loos plot

Is there anything I can do to improve the accuracy of my model? Or should I just train it with more epochs. Any tips would by appreciated :)

$\endgroup$

3 Answers 3

0
$\begingroup$

have you tried feature scaling ? standardizing your features before training the model and try working with regularization techniques like l1,l2

try using different algorithms such as xgboost regressor, random forest, gradient boosting as ensemble methods.

$\endgroup$
2
  • $\begingroup$ Features and labels are being scaled. I will try the methods you listed. Thank you! $\endgroup$
    – Chunk1
    Commented Aug 31 at 8:48
  • $\begingroup$ that's lovely do give me the dataset and other dependencies that u are having currently are using if u still arent able to do it ill help you out $\endgroup$ Commented Aug 31 at 13:39
0
$\begingroup$

The way you are drawing the points makes it look like you are dealing with a time series forecasting problem. If that is the case I would suggest changing from the feedforward NN architecture you are currently implementing to a recurrent NN type of architecture.

A starting example taken from the tensorflow tutorials is here

$\endgroup$
1
  • $\begingroup$ It isnt really a time series, its a meassurement over some length. Would a recurrent neural network also be better in this situation? $\endgroup$
    – Chunk1
    Commented Aug 31 at 8:47
0
$\begingroup$

Few things you can do

  1. Try with the Sequence models architectures
  2. Remove stationarity from the time series if possible?
  3. With current architectures, try adding more layers too.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.