Comments (4)
Hi,
The error is caused because of the floating point division at the following line,
parent_i = (place_in_level + 1) / 2
The above line returns 1.5 in your case and it was supposed to return 1. I assume you are running the code on python 3.x so you can just change that line to,
parent_i = (place_in_level + 1) // 2
to fix it(making it so called 'integer division'). The problem is I wrote the code on python 2.7 and really did not really think about this back then.
You can check this thread for even more info.
I will go over the code to see if there are any more issues with regards to this case and do the updates.
from x-armed-bandits.
I went over the code and it looks like that was the only problematic division, thanks for pointing it out 🥇
from x-armed-bandits.
Hi,
awesome, this fixed it. I also thought it was this problem, my thinking was that two nodes with different "i" obviously need the same parent, so there should be a rounding somewhere.
from x-armed-bandits.
You are definitely right, I used integer division to utilize the floor round in it.
from x-armed-bandits.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x-armed-bandits.