Last active
September 10, 2023 15:19
-
-
Save VictorSaenger/5488c718f039de7fd14c9886332da616 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Choose optimizer: | |
| optim = optimizers.Adam(lr=0.00015) | |
| # create NN for news clissification: | |
| news_DNN = Sequential() | |
| news_DNN.add(Dense(40, input_dim=512, activation = 'relu',kernel_regularizer=l2(0.1))) | |
| news_DNN.add(Dropout(0.25)) | |
| news_DNN.add(Dense(40, activation = 'relu',kernel_regularizer=l2(0.1))) | |
| news_DNN.add(Dropout(0.25)) | |
| # Output layer with multiclass activation function: | |
| news_DNN.add(Dense(4,activation='softmax')) | |
| # Compile model: | |
| news_DNN.compile(loss='sparse_categorical_crossentropy', optimizer=otim, metrics=['acc']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I tried running your code based on this article (https://towardsdatascience.com/media-bias-detection-using-deep-learning-libraries-in-python-44efef4918d1) and encountered a bug which I had issues solving :'( I am referencing this for my final year project and would like to seek your advice on this!
Line 16 had a NameError when using 'otim' and NotImplementedError when using 'optim'

