I've been considering fast poker hand evaluation in Python. It occurred to me that one way to speed the process up would be to represent all the card faces and suits as prime numbers and multiply them together to represent the hands. To whit:
class Poker...

Asked By Yes - that Jake.

I found this programming problem while looking at a job posting on SO. I thought it was pretty interesting and as a beginner Python programmer I attempted to tackle it. However I feel my solution is quite...messy...can anyone make any suggestions to optim...

Asked By Sunandmoon

I found this programming problem while looking at a job posting on SO. I thought it was pretty interesting and as a beginner Python programmer I attempted to tackle it. However I feel my solution is quite...messy...can anyone make any suggestions to optim...

Asked By Sunandmoon

I created a Sequential model using tf.keras as follows:
model = tf.keras.Sequential()
model.add(tf.keras.layers.Dense(8, input_dim=4))
model.add(tf.keras.layers.Dense(3, activation=tf.nn.softmax))
opt = tf.train.AdamOptimizer(learning_rate=0.001)
model....

Asked By Nicolas Bortolotti

I am using the Python API for Tensorflow. I am trying to implement the Rosenbrock function given below without the use of a Python loop:
My current implementation is as follows:
def rosenbrock(data_tensor):
columns = tf.unstack(data_tensor)
s...

Asked By John P.

Possible Duplicate:
Flattening a shallow list in Python
Flatten (an irregular) list of lists in Python
EDIT: The question is not how to do it - this has been discussed in other questions - the question is, which is the fastest method?
I've f...

Asked By Rory

What is a good way to split a NumPy array randomly into training and testing/validation dataset? Something similar to the cvpartition or crossvalind functions in Matlab.

Asked By erik

This is the best algorithm I could come up.
def get_primes(n):
numbers = set(range(n, 1, -1))
primes = []
while numbers:
p = numbers.pop()
primes.append(p)
numbers.difference_update(set(range(p*2, n+1, p)))
return ...

Asked By jbochi

After many attempts trying optimize code, it seems that one last resource would be to attempt to run the code below using multiple cores. I don't know exactly how to convert/re-structure my code so that it can run much faster using multiple cores. I will ...

Asked By zd5151

I want to write a new optimization algorithm for my network on Tensorflow. I hope to implement the Levenberg Marquardt optimization algorithm, which now is excluded from TF API. I found poor documentation on how to write a custom optimizer, so i ask if so...

Asked By Alberto Manzini

I want to write a new optimization algorithm for my network on Tensorflow. I hope to implement the Levenberg Marquardt optimization algorithm, which now is excluded from TF API. I found poor documentation on how to write a custom optimizer, so i ask if so...

Asked By Alberto Manzini

Somebody have already asked a similar question, but the solution, which is given there, does not work for me.
I am trying to use Adam optimizer in tensorflow. Here is a part of my code about it :
adamOptimizer = tf.train.AdamOptimizer(learning_rate=0.00...

Asked By Taras Kucherenko

I'm trying to use TensorFlow's Gradient Descent Optimizer to solve 2-dimension Rosenbrock function, but as I ran the program, the optimizer sometimes goes towards the infinity. Also sometime, without changing anything, it can find the right neighborhood b...

Asked By K. Lindholm

I am loading from a saved model and I would like to be able to reset a tensorflow optimizer such as an Adam Optimizer. Ideally something like:
sess.run([tf.initialize_variables(Adamopt)])
or
sess.run([Adamopt.reset])
I have tried looking for an answ...

Asked By Steven