Recent comments in /f/deeplearning
FairMathematician595 OP t1_iwxmdka wrote
Reply to comment by thebravescientist in Medicinal Dataset Review. by FairMathematician595
We are currently working on the image dataset.
Side effects is a really nice option, would definitely add that.
thebravescientist t1_iwxhe92 wrote
Reply to Medicinal Dataset Review. by FairMathematician595
Great collection. This can help millions others too.. I had a couple of questions and suggestions. Q1. Is the data collected manually, or is it processed from some source. (Need this for data reliability) Q2. How different is this from say 1mg.com etc where we get similar data?
Suggestions;
- Would have been good if an image of the medicine
- Some metadata like side effects etc would have been added benefits...
FairMathematician595 OP t1_iwvbxr6 wrote
Reply to comment by IshanDandekar in Medicinal Dataset Review. by FairMathematician595
Yes please give us suggestions what to add more to make this dataset more useful.
IshanDandekar t1_iwvbkly wrote
Reply to Medicinal Dataset Review. by FairMathematician595
Holy smokes, thanks for the post. Will make sure to check it out!
Constant-Cranberry29 OP t1_iwoc176 wrote
Reply to comment by Hamster729 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
still the same even I drop abs, drop normalization, and change last layer to model.add(Dense(1, activation=None, use_bias=False)) it doesn't work
Hamster729 t1_iwo99fy wrote
Reply to comment by Constant-Cranberry29 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
That's a very odd looking time decay rule, and I'm almost certain that it does not do what you expect it to do.
Try:
def lr_time_based_decay(epoch, lr):
return lr*0.95
(also see my suggestion from the edit to my previous post)
Constant-Cranberry29 OP t1_iwo71pb wrote
Reply to comment by Lexa_21 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
it doesn't work
Constant-Cranberry29 OP t1_iwo6vm1 wrote
Reply to comment by Hamster729 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
initial_learning_rate = 0.02
epochs = 50
decay = initial_learning_rate / epochs
def lr_time_based_decay(epoch, lr):
return lr * 1 / (1 + decay * epoch)
history = model.fit(
x_train,
y_train,
epochs=50,
validation_split=0.2,
batch_size=64,
callbacks=[LearningRateScheduler(lr_time_based_decay, verbose=2)],
)
Constant-Cranberry29 OP t1_iwo6ukg wrote
Reply to comment by Hamster729 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
>Okay. So, as I understand, your labels are usually either zero (before normalization), or negative, and, very rarely, they are positive.
>
>With the abs, it's easy for the model to reproduce the "baseline" level, because it's still zero after normalization, and as long as the last Dense produces a large negative number, sigmoid turns that number into zero.
>
>I think it would work even better if, instead of abs, you set all positive labels to zero, then normalize. (After normalization, the "baseline" level will become 1, also easy to reproduce).
>
>In both cases, will work for data points that originally had negative or zero labels, but it won't work for data points with originally positive labels.
>
>You have a problem without normalization, because the "baseline" level no longer 0 or 1 and your model needs to converge on that number. I think it would get there eventually, but you'll need more training, and probably learning rate decay (replace the constant learning rate with a tf.keras.optimizers.schedules.LearningRateSchedule object, and play with its settings.)
>
>The question is, do you want, and do you expect to be able to, reproduce positive labels? Or are they just random noise? If you don't need to reproduce them, just set them to zero. If they are valid and you need to reproduce them, do more training.
I have try using tf.keras.optimizers.schedules.LearningRateSchedule object, it still doesn't work
Hamster729 t1_iwo4ma4 wrote
Reply to comment by Constant-Cranberry29 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
Okay. So, as I understand, your labels are usually either zero (before normalization), or negative, and, very rarely, they are positive.
With the abs, it's easy for the model to reproduce the "baseline" level, because it's still zero after normalization, and as long as the last Dense produces a large negative number, sigmoid turns that number into zero.
I think it would work even better if, instead of abs, you set all positive labels to zero, then normalize. (After normalization, the "baseline" level will become 1, also easy to reproduce).
In both cases, the model will work for data points that originally had negative or zero labels, but it won't work for data points with originally positive labels.
You have a problem without normalization, because the "baseline" level no longer 0 or 1 and your model needs to converge on that number. I think it would get there eventually, but you'll need more training, and probably learning rate decay (replace the constant learning rate with a tf.keras.optimizers.schedules.LearningRateSchedule object, and play with its settings.)
The question is, do you want, and do you expect to be able to, reproduce positive labels? Or are they just random noise? If you don't need to reproduce them, just set them to zero. If they are valid and you need to reproduce them, do more training.
P.S. There are other things you could try. Here's an easy one. Drop the abs, drop the normalization, and change the last layer to: model.add(Dense(1, activation=None, use_bias=False))
Constant-Cranberry29 OP t1_iwnz3zj wrote
Reply to comment by Hamster729 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
I have edit the pictures which contain normalization data
Constant-Cranberry29 OP t1_iwnyhip wrote
Reply to comment by Hamster729 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
df = pd.read_csv('1113_Rwalk40s1.csv', low_memory=False)
columns = ['Fx']]
selected_df = df[columns]
FCDatas = selected_df[:2050]
SmartInsole = np.array(SIData[:2050])
FCData = np.array(FCDatas)
Dataset = np.concatenate((SmartInsole, FCData), axis=1)
scaler_in = MinMaxScaler(feature_range=(0, 1))
scaler_out = MinMaxScaler(feature_range=(0, 1))
data_scaled_in = scaler_in.fit_transform(Dataset[:,0:89])
data_scaled_out = scaler_out.fit_transform(Dataset[:,89:90])
Hamster729 t1_iwny1c8 wrote
Reply to comment by Constant-Cranberry29 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
Can I see the code that does the reverse transform, in the case without abs?
sqweeeeeeeeeeeeeeeps t1_iwnxlbc wrote
Reply to comment by Constant-Cranberry29 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
? Not sure. Train it longer, lower learning rate, are u using teacher forcing? I’m not very familiar with best LSTM practices.
Constant-Cranberry29 OP t1_iwnxdah wrote
Reply to comment by sqweeeeeeeeeeeeeeeps in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
I want reduce the shifting prediction if I not use the abs()
sqweeeeeeeeeeeeeeeps t1_iwnx6pv wrote
Reply to comment by Constant-Cranberry29 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
What’s your problem? Normalized data is good.
Constant-Cranberry29 OP t1_iwnx4ze wrote
Reply to comment by sqweeeeeeeeeeeeeeeps in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
so what should I do for solving this problem?
Constant-Cranberry29 OP t1_iwnx2yp wrote
Reply to comment by Hamster729 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
if you looking from the number why that is not 0-1 because before plotting the value I already transform it to original value.
sqweeeeeeeeeeeeeeeps t1_iwnu8yt wrote
Reply to How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
You are misinterpreting what “normalizing” is. It converts your data to fit a standard normal distribution. That means, you have positive and negative numbers centered around 0. This is optimal for most deep learning models. The interval [0,1] is not good because you want some weights to be negative as certain features negatively impact certain results.
arhetorical t1_iwmwkn0 wrote
Reply to comment by eternal-abyss-77 in Can someone explain me the math behind this paper and tell me whether the way I have understood this paper is right or not? by eternal-abyss-77
It's not, they're just explaining the positioning of the pixels in the figure.
Hamster729 t1_iwmtbs9 wrote
Reply to How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
It is not clear what you are doing, because your code does not match your plots. The model in your code outputs values in 0..1 range, but your plots have large positive and negative values. To help you, we would need to understand what exactly is going on. I want either the complete model or the physical significance of your data. Generally speaking, unless signs in your data have no significance (so e.g. a +5 and a -5 correspond to the same fundamental physical state), applying an abs to the data would only make the model perform worse.
pornthrowaway42069l t1_iwmr91a wrote
Reply to comment by Constant-Cranberry29 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
emmm... 2 parameter box-cox transform? If that doesn't work as well, maybe there the problem is with something else, between neglog and 2 parameter box-cox you should get decent normalization I feel.
Lexa_21 t1_iwlyy3b wrote
Reply to comment by Lexa_21 in How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
In pseudo code: if (x<0) { x = 1/2 * x/minValue } else { x = 1/2 * x/maxValue + 0.5 }
Lexa_21 t1_iwlyig7 wrote
Reply to How to normalize data which contain positive and negative numbers into 0 and 1 by Constant-Cranberry29
You can try to transform your negative values into the [0, 0.5] interval and your positive values into the [0.5, 1] interval.
FairMathematician595 OP t1_iwxmkzy wrote
Reply to comment by FairMathematician595 in Medicinal Dataset Review. by FairMathematician595
The data is scraped from the web. You can definitely find similar data on any site that sells medicines.