Questions tagged [sgd]
63 questions
0
votes
1 answer
expected axis -1 of input shape to have value 20 but received input with shape (None, 29)
ValueError: Input 0 of layer sequential_66 is incompatible with the layer: expected axis -1 of input shape to have value 20 but received input with shape (None, 29)
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import…

PhamQuangTrung
- 31
- 4
0
votes
1 answer
Could not interpret optimizer identifier, SGD, in Keras
I have tried to replace this
from keras.optimizers import SGD
with
from tensorflow.keras.optimizers import SGD
but this still doesn't work
Here is my code
from tensorflow.keras.optimizers import SGD
from keras.initializers import…

Wu Kris
- 77
- 8
0
votes
1 answer
Why do I need to use ravel() in this case?
I am really confused about why do I need to use ravel() before fitting the data to SGDRegressor.
This is the code:
from sklearn.linear_model import SGDRegressor
sgd_reg = SGDRegressor(max_iter = 1000, tol = 1e-3, penalty = None, eta0=…

Wu Kris
- 77
- 8
0
votes
1 answer
How can we interpret feature importances for Stochastic Gradient Descent Classifier?
I have a SGDClassifier model trained with scikit-learn. I extract features names with .get_feature_names() and coefficients with .coef_
I combine the 2 columns in a dataframe like this :
feature value
hiroshima 3.918584
wildfire …

Ahmed K
- 21
- 2
0
votes
1 answer
About tf.keras SGD batch
I want to use SGD optimizer in tf.keras.
But SGD detail said
Gradient descent (with momentum) optimizer.
Dose it mean SGD doesn't support "Randomly shuffle examples in the data set phase"?
I checked the SGD source,
It seems that there is no random…
user15070195
0
votes
0 answers
Reinforcement Learning: SGD use and independence of samples in sequences
I am taking a course in RL and many times, learning policy parameters of value function weights essentially boils down to using Stochastic Gradient Descent (SGD). The agent is represented as having a sequence of states S_t, actions A_t, and reaping…

Amine
- 134
- 11
0
votes
1 answer
How would you optimize dividing bi variate data in R?
I'm not looking for a specific line a code - just built in functions or common packages that may help me do the following. Basically, something like, write up some code and use this function. I'm stuck on how to actually optimize - should I use…

we_are_all_in_this_together
- 509
- 2
- 4
- 12
0
votes
3 answers
Accuracy and loss does not change with RMSprop optimizer
The dataset is CIFAR10. I've created a VGG-like network:
class FirstModel(nn.Module):
def __init__(self):
super(FirstModel, self).__init__()
self.vgg1 = nn.Sequential(
nn.Conv2d(3, 16, 3, padding=1),
…

Sunny Duckling
- 317
- 1
- 2
- 13
0
votes
1 answer
Random sampling from multiple vectors in python
So I have an assignment to code Stoachastic gradient decent and basically i am finding it a bit of a problem to randomly sample from multiple vectors while keeping the order intact. My code follows:
import numpy as np
import matplotlib.pyplot as…

Yousef Kaddoura
- 31
- 5
0
votes
1 answer
Why does keras (SGD) optimizer.minimize() not reach global minimum in this example?
I'm in the process of completing a TensorFlow tutorial via DataCamp and am transcribing/replicating the code examples I am working through in my own Jupyter notebook.
Here are the original instructions from the coding problem :
I'm running the…

Kuba_R
- 11
- 2
0
votes
0 answers
Trying to change IP config on Zebra printer with SGD code
I am trying to configure the IP, subnet, and gateway addresses on a zebra ZT410 printer with SGD commands.
I am using the "Zebra setup utility", my getvar commands work, but setvar commands do not work. What Am I doing wrong ? My code is below...
!…

Komakino_1251
- 220
- 2
- 13
0
votes
1 answer
Understanding CNN training results
I would appreciate your explanation on following :)
I trained CNN network that classifies TWO image classes.
I used 'SGD' optimizer and 'categorical_crossentropy' loss function.
My results are as follows:
- training loss = 0.28
- training accuracy =…

Ivan Geek
- 1
- 1
- 1
0
votes
1 answer
Multiclass classification confidence score using multiclass classification using predict_proba of SGDclassifier
I am using Logistic regression in SGDClassifier to perform multi-class classification of ~10k category.
To get confidence score for predicted result I am using predict_proba function.
But I am getting prediction probability value of …

Ranjana Girish
- 473
- 7
- 17
0
votes
1 answer
Value Error : Only 2 class/es in training fold, but 1 in overall dataset. This is not supported for decision_function with imbalanced folds
I am learning machine learning and creating my first model on #mnist data set.
Can anyone help me over here? I have tried Stratified Fold, kfold and other methods to resolve this issue.
Pandas Version '0.25.1', Python Version 3.7, using Anaconda…

Anuj Mahawar
- 1
- 3
0
votes
0 answers
My ANN is ignoring a class sometimes, possible solutions
My ANN has two inputs and 16 outputs, sometimes it ignore some classes, even though my dataset has almost the same number of examples by class, as you can see in this image:the points in the 3rd row 4th column is simply ignored, it's very common…

Romulo Junior
- 1
- 1