#Why my accuracy always has same value
45 messages · Page 1 of 1 (latest)
Okay your going to need to give us more than that lol. What data are you working with? How have you organised you data? What type of model did you train? Do you have a CFM that we could see?
CFM = confusion matrix
And also seeing your code would be helpful
I am working on BI-RADS and breast composition classification so its multi label classification. I categorized my data by giving 0 and 1. My loss func is "categorical_crossentropy" and optimizer is Adam. Unfortunately I have not a CFM. My code is very complicated. But I can show you if you want to see it. Thank you very much in advance
Note: My model is EfficientNet
Yes, please show us a CFM at the beginning of training and at the end of 5 epochs
And what framework are you using?
Sir, I am sorry for writing late but I have an error.
ValueError: Classification metrics can't handle a mix of multiclass and unknown targets
And this is my code:
pred = model.predict(x_train, batch_size = 32)
pred = np.argmax(pred, axis=1)
y_train = np.argmax(y_train, axis=1)
print(classification_report(y_train, pred))
what can ı do?
I using keras
What are the rows and what are the columns?
Sir, I guess I solved problem
My loss is not always same
but
my accuracy very low
and my validation accuracy
Based on the confusion matrix your accuracy on whatever amount of data this matrix was generated from should be 790/837 which is pretty high, so I think you have to revisit your code cause there are bugs
*847
Thank you very much for your help sir.
I have one last question for you about my other model. I am waiting an output in 56,56,24 shape but I took in 28,28,24 shape. What can ı do?
@willow tartan Please provide more detail. You are asking people who know nothing about what you are doing or how you are doing it or for what purpose, so can you please provide some code snippets or something
Sorry for my inexperience
########### A2 bloack ###############
block_arg0 = {'kernel_size':3,'strides':2,'expand_ratio':6,'num_repeat':1,'input_filters':16,'se_ratio':0.25,
'output_filters':24,'id_skip':0}
block_arg = pd.Series(data = block_arg0)
"""Mobile Inverted Residual block along with Squeeze and Excitation block."""
kernel_size = block_arg.kernel_size
num_repeat= block_arg.num_repeat
input_filters= block_arg.input_filters
output_filters= block_arg.output_filters
expand_ratio= block_arg.expand_ratio
id_skip= block_arg.id_skip
strides= block_arg.strides
se_ratio= block_arg.se_ratio
Genişleme Evresi
expanded_filters = input_filters*expand_ratio
x = (Conv2D(expanded_filters, 1, padding='same', use_bias=False))(x)
x = (BatchNormalization())(x)
x = (Activation(swish_act))(x)
Depthwise Evrişim Evresi
x = (DepthwiseConv2D(int(kernel_size) * int(kernel_size), int(strides) * int(strides), padding='same', use_bias=False))(x)
x = (BatchNormalization())(x)
x = (Activation(swish_act))(x)
Sıkıştırma ve Çıkarma Evresi
se = GlobalAveragePooling2D()(x)
se = (Reshape((1, 1, int(expanded_filters) )))(se)
squeezed_filters = max (1, int(input_filters * se_ratio))
se = (Conv2D(squeezed_filters , 1, activation=swish_act, padding='same'))(se)
se = (Conv2D(expanded_filters, 1, activation='sigmoid', padding='same'))(se)
x = (multiply([x, se]))
Çıkış
x = Conv2D(output_filters, 1, padding='same', use_bias=False)(x)
x = BatchNormalization()(x)
is this your code or code you found elsewhere?
The block before this block produces output of size 112, 112, 16 and I expect output from this block with size 56,56,24
okay, lets turn this into a learning experience for you
In a CNN, what changes the size of your input/output/feature maps?
not my code. just ıI organized according myself
filters of conv ?
or padding?
and?
maybe pooling
not "maybe pooling", it is pooling
so
- your actual input size that you choose
- your convolution filters and amount of padding
and - Your pooling or upsampling operations
so now
go through your model and trace out how the size changes from input to output on a sheet of paper and then figure out what you can do to get the output size that you want
Sir I need your helps. I worked hard on model architecture and fixed bugs. I used dropout and data augmentation(to 16k imageset) to reduce overfitting. I used binary crossentropy loss func and adam optimizer(lr = 0.001). I trained the model for 50(batch_size=128) epoch but metrics(loss,acc,,val_loss,val_acc) haven't changed much and I trained to model again but this time for 250 epoch(batch_size). But again metrics haven't changed much.