BlacksmithNo4415
BlacksmithNo4415 t1_j6x1ugb wrote
Reply to comment by International_Deer27 in Loss function fluctuating by International_Deer27
BlacksmithNo4415 t1_j6uwn1n wrote
Reply to comment by BlacksmithNo4415 in Loss function fluctuating by International_Deer27
i can try to help you though, i worked as a deep learning engineer in computer vision:
- do you mean the dimension of 1 sample is [2000, 5] ? that is a very weird shape for an image. usually they have a shape of [h, w, 3] and [h, w, 4] for video data - a temporal additional dimension is added
- what do you want this model should be classifying ? so far it sounds more trivial - but depending on the object it might be a bit more complex.
- the more complex your task -> more complex your model must be -> a larger data set you will need
- how are the labels distributed in your data set ?
- do you use adversarial attacks for robustness ? don't do that at the beginning.
- are you sure that a cnn is the proper model for signal classification ?
- how do you want to represent your dataset ? what should be the 3rd axes represent as an information ?
- btw dropouts makes it also more difficult for the model to overfit. you use this so the model learns to generalize
- i think the model is way to complex when the task is actually trivial. but i never did any signal classification
- the use of sigmoid can lead to exploding gradients
BlacksmithNo4415 t1_j6usty4 wrote
Reply to comment by International_Deer27 in Loss function fluctuating by International_Deer27
no, that was an example code to show you how much better the code is readable when you use markdowns..
DLPlotter is a library i am building in the moment.. :)
BlacksmithNo4415 t1_j6tfpkg wrote
Reply to comment by International_Deer27 in Loss function fluctuating by International_Deer27
try using markdowns:
​
plotter = DLPlotter() # add this line
model = MyModel()
...
total_loss = 0
for epoch in range(5):
for step, (x, y) in enumerate(loader):
...
output = model(x)
loss = loss_func(output, y)
total_loss += loss.item()
...
config = dict(lr=0.001, batch_size=64, ...)
plotter.collect_parameter("exp001"", config, total_loss / (5 * len(loader)) # add this line
plotter.construct() # add this line
BlacksmithNo4415 t1_j6tfgmy wrote
Reply to Loss function fluctuating by International_Deer27
too me it also sounds like a bad learning rate. have you checked the distribution of your weights for each layer in each step?
P.S: try hyperparameter optimization methods like grid search or baysian. in that way you get faster an answer to your question..
BlacksmithNo4415 t1_j6x2xia wrote
Reply to comment by International_Deer27 in Loss function fluctuating by International_Deer27
i've checked for papers that do exactly what you want.
so as I assumed this data is time sensitive and therefor you need an additional temporal dimension.
this model needs to be more complex in order to solve this problem.
i suggest reading this:
https://bmcmedinformdecismak.biomedcentral.com/articles/10.1186/s12911-021-01736-y
​
BTW: have you tried grid search for finding the right hyperparametrs?
oh and your model does improve..
have you increased the data set size??