Questions tagged [implementation]

Implementation refers to the specific mechanisms in which an algorithm is written in code

119 questions
9
votes
0 answers

Training value neural network AlphaGo style

I have been trying to replicate the results obtained by AlphaGo following their supervise learning protocol. The papers specify that they use a network that has two heads: a value head that predicts the winner of the game and a policy head that…
6
votes
1 answer

Keras - Implementation of custom loss function with multiple outputs

I am trying to replicate (a way smaller version) the AlphaGo Zero system. However, in the network model, I am having a problem. The loss function I am supposed to implement is the following: $$l = (z - v)^2 - \pi^T log(p) + c…
ihavenoidea
  • 205
  • 2
  • 6
6
votes
0 answers

Optimal implementation of vanilla DQN loss in Keras

I've implemented vanilla DQN for continuous/non-images (no CNN) states in keras. But, I'm not sure if my implementation of the loss computation is optimal. For reminder the loss is defined as : $loss=(r+\gamma max_{a'} Q(s',a')-Q(s,a))^2…
Johan Gras
  • 61
  • 1
6
votes
1 answer

What are the main differences between uwot and umap packages in R?

There are two packages in R that implement the UMAP algorithm for low-dimensional embedding ('uwot' and 'umap'). I've found they can give vastly different results for some datasets. For example, the embeddings below are of the same $4001$…
5
votes
1 answer

Feature scaling worsens performance?

I noticed that feature scaling can destroy completely neural networks performance in some cases. Below are my results that you can reproduce easily. I use a neural network to approximate function $g$ on $[0,100]$ as…
Soumirai
  • 151
  • 2
4
votes
1 answer

How to define discrete action space with continuous values in OpenAI Gym?

I am trying to use a reinforcement learning solution in an OpenAI Gym environment that has 6 discrete actions with continuous values, e.g. increase parameter 1 with 2.2, decrease parameter 1 with 1.6, decrease parameter 3 with 1 etc. I have seen in…
Cristian M
  • 187
  • 1
  • 3
  • 7
4
votes
2 answers

RNN in pseudo-code

A few years ago, I understood the classical MLP neural network much better when I wrote an implementation from scratch (using only Python + Numpy, without using tensorflow). Now I'd like to do the same for recurrent neural networks. For a standard…
Basj
  • 180
  • 2
  • 18
4
votes
1 answer

Unable to learn weights of a Word2Vec model

I was going to implement a word embedding model - namely Word2Vec - by following this TensorFlow tutorial and adapting the code a little bit. Unfortunately, though, my model won't learn anything. I've used TensorBoard to keep track of the value of…
3
votes
1 answer

Issues with self-implemented logistic regression

I am trying to self-implement a logistic regression algorithm to do some self-learning but I am having a bit of trouble with achieving similar accuracy to the logistic regression of sklearn. Here is the code I am using (the dataset I am using is the…
3
votes
1 answer

Policy Gradient not "learning"

I'm attempting to implement the policy gradient taken from the "Hands-On Machine Learning" book by Geron, which can be found here. The notebook uses Tensorflow and I'm attempting to do it with PyTorch. My models look as follows: model =…
3
votes
3 answers

Does the Koalas library allow to use all Pandas machine learning libraries like Scikit-Learn, XGBoost, and TensorFlow?

I would like to implement a model based on some cleaned and prepared data set. I already have a bit of experience with PySpark, but from a data scientist's perspective it can be cumbersome to work with it. Therefore I would like to try Koalas. I…
3
votes
0 answers

Improving a simple trig model

I have some data which I know is well approximated as a trig function, and I can fit it with scipy.optimize.curve_fit as follows: from __future__import division import numpy as np from scipy.optimize import curve_fit import matplotlib.pyplot as…
3
votes
2 answers

Damerau-Levenshtein Edit Distance in Python

I found some python code on Damerau Levensthein edit distance through Google, but when I looked at their comments, many said that the algorithms were incorrect. I am confused. Can someone share a correct python code on Damerau Levensthein…
howardpotts
  • 51
  • 1
  • 3
3
votes
0 answers

Neural network cost is constant never changing during training

I am trying to build a binary classifier to predict a pulsar star with Single Hidden layer Neural Network. But the cost on training dataset after almost 100 iterations has no change, following is the implementation with python numpy. import…
3
votes
0 answers

Validation score (f1) remains the same when swapping labels

I have an imbalanced dataset (True labels are ~10x than False labels) and thus use the f_beta score as a metric for model performance, as such: def fbeta(beta): def f1(y_true, y_pred): def recall(y_true, y_pred): …
1
2 3 4 5 6 7 8