[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 265 KB, 1352x1528, the book cover.jpg [View same] [iqdb] [saucenao] [google]
8418462 No.8418462 [Reply] [Original]

https://youtu.be/Fd2d7Uq_8wY

https://docs.ufpr.br/~danielsantos/ProbabilisticRobotics.pdf

Let's try to initiate a book reading. This time, as suggested in that "one are you doing right now" thread, by moderating it with short rants of summary, elaborations and asking questions.

As explained in the video, the book seems approachable for a whole bunch of majors, which is why I think it makes a good candidate, and should this work out as I intent, people can go on tangents in various directions. Sorry for the possibly quite bad accent.

An edition of the book pops up if you type in the title in google. It's not the latest edition, but the chapters seem to match.
The second one chapter starts with some probability theory basics (gonna post a screenshot of the .pdf posted above in the next post). I'll continue reading and if there's interest, I will make a short rant about it maybe even tomorrow.
I'll post questions, by me and for other, or add hints at interesting stuff, if I think that's necessary. If there's eventually even a video response, some discussion of any of the topics that come up, that would be even more interesting.

>> No.8418472 [DELETED] 
File: 112 KB, 995x666, first chapters.png [View same] [iqdb] [saucenao] [google]
8418472

>> No.8418485
File: 112 KB, 995x666, first chapters.png [View same] [iqdb] [saucenao] [google]
8418485

https://www.amazon.de/Probabilistic-Robotics-Intelligent-Autonomous-Agents/dp/0262201623

http://www.probabilistic-robotics.org/
e.g. keywords from pic related:

https://en.wikipedia.org/wiki/Recursive_Bayesian_estimation

https://en.wikipedia.org/wiki/Kalman_filter

>> No.8418490

I'm trying to finish a book on model checking right now, but I'll try to get on board with this one. Hopefully we can have a successful reading group at last.

>> No.8418494

btw, if you're going to do videos regularly, get a decent microphone or shout from the top of your lungs pls (preferably the former).

>> No.8418611
File: 285 KB, 1680x1050, Tron_Pacman.jpg [View same] [iqdb] [saucenao] [google]
8418611

The book actually says in Chapter 1 that jumping from Chapter 2 (Probability theory and other math necessities) to Chapter 7 (Mobile Robot Localization: Markov and Gaussian) is a valid option, at least for teaching.

>> No.8419554 [DELETED] 

x

>> No.8420123

Gonna start reading chapter 2 now and will make a video in a few ours

>> No.8420519
File: 2.93 MB, 1352x1528, the book cover 002.png [View same] [iqdb] [saucenao] [google]
8420519

https://youtu.be/qr1Odx1iZGs
Tell me if I should be shorter (less elaborate) with those.
There are at least 2 exercises at end of Chapter 2 that can be approached with having read the first two sections of Chapter 2.

Some definitions are made (not too much detail, though), and some equalities are to be shown.

Conditional probability:
[math] p(x \, | \, y) := \dfrac { 1 } { p(y) } p(x,y) [/math]

Let
[math] p(x \, | \, y,z) := p(x \, | \, z) \, p(y \, | \, z) [/math]

and prove that this is equivalent to
[math] p(x \, | \, z) := p(x \, | \, z, y) [/math]
[math] p(y \, | \, z) := p(y \, | \, z, x) [/math]

and after this in the text, there follow some probability laws that are to be proven as well.

The other exercise is about
[math] Cov[X] := E[X-E[X]]^2 [/math]

One should show that
[math] Cov[X] = E[X^2] - E[X]^2 [/math]

>> No.8421192 [DELETED] 
File: 122 KB, 1024x768, Cnoidal_wave.jpg [View same] [iqdb] [saucenao] [google]
8421192

>> No.8422070

so is anybody gonna reply or what?

>> No.8422074

>>8422070
I actually own this book; have read parts of it.
And I took his online class.
What do you want from me?>>8422070

>> No.8422112

>>8422070
I'm here, senpai. I just haven't had time to watch the second video. I think I'm quite alright with the prereqs tho.

>> No.8422118 [DELETED] 

.>8422074
Questions and answer, generatig discussions.
Any tangenta are welcome.

How many ours is the lecture series?

>> No.8422122
File: 2.12 MB, 3264x1836, IMG_20161019_241417110.jpg [View same] [iqdb] [saucenao] [google]
8422122

>>8422074
Questions and answer, generatig discussions. And so I don't have to post the next stuff in a new thread when the thread leaves the catalog after 12h.
Any tangents to the topics discussed are welcome.

How many ours is the lecture series?

>> No.8422126

>>8422118
it's about 8-12 classes.
a lot of it is split up into quizzes so can't give you a good number for hours, but i'd guess about an hour each.

It was free on Udacity, taught by Sebastian Thrun (your author).

Found the link
https://www.udacity.com/course/artificial-intelligence-for-robotics--cs373

>> No.8422686
File: 189 KB, 583x791, Screen Shot 2016-10-19 at 17.44.59.png [View same] [iqdb] [saucenao] [google]
8422686

Going through the next 7 pages, it's bretty cool. Will report later

>> No.8423220
File: 2.93 MB, 1352x1528, the book cover 003.png [View same] [iqdb] [saucenao] [google]
8423220

New video #3:

https://youtu.be/lBuqQn96i3Q

Previous:

#2, 04 mins, https://youtu.be/qr1Odx1iZGs
#1, 12 mins, https://youtu.be/Fd2d7Uq_8wY
#0, 15 mins, https://youtu.be/eAffVHGjeR8

>> No.8423518

>>8423220
Hey, sorry for being slightly off-topic, but IIRC you said you intended to do a reading of a book on Idris, is that right? Is there any reason why Idris over any of the competitors?

>> No.8423665
File: 118 KB, 720x1280, Screenshot_20161019-233206.png [View same] [iqdb] [saucenao] [google]
8423665

>>8423518
The competitors aren't in practice used to execute code, they are compiled to type check (check if a proof of a theorem is valid)
Agda and Idris are the Haskell dialects, and Agda also uses questionable characters, pic related.
There's the "for programming" book coming out for Idris and it has an irc channel that seems to work

>> No.8423671
File: 2.34 MB, 1836x3264, IMG_20161019_115524139_HDR.jpg [View same] [iqdb] [saucenao] [google]
8423671

PS, related remark, I saw pic related this week

>> No.8423891

I'm a STEM grad and stuff, but sometimes I think this shit gets too ridiculous.

>Probabilistic Robotics
Like, come the fuck on. Seriously?

There are probably like ten people in the world who study this shit. It's complete bullshit, some of these extra-specific STEM fields. It's as if someone jumbled these words together, used some reasonable mathematics and made a fucking book.
>>8418485
This is Stats with some graduate level engineering control theory. So fucking dumb. No reason to create a fucking textbook.

Completely useless.

>> No.8424741

>>8423671
Nice. Reading this right now.

>> No.8424761
File: 80 KB, 392x696, screen696x696.jpg [View same] [iqdb] [saucenao] [google]
8424761

>>8423891
It's Control Theory+Baysian Networks for mechanics, yes.
Don't see the problem if it's a good book?
And no, there are not just "like ten people in the world who study this shit", e.g. stuff like this makes it into Pokemon Go and all Augmented Reality stuff that's about to come.
Initially, I ordered it because it was recommended for me as an intro to

https://en.wikipedia.org/wiki/Kalman_filter

>>8424741
Did you read the part about the reals in the HoTT book. Wonder what's new beyond that.

>> No.8425529

>>8424761
>>8423665
Those Unicode glyphs are optional and if you're using a real editor (Emacs or Vim), they're easy to enter anyway and they look nice. Also, IIRC Agda has a basic IO library and FFI abilities so you could write programs in it as well as in Idris. I agree that Idris is more geared towards general-purpose programming tho.

>>8424761
>Did you read the part about the reals in the HoTT book. Wonder what's new beyond that.
I did. It seems that they generalize the HIIT construction a bit beyond the book. I'm not well-versed in analysis, so this part is not perfectly clear to me.

The other thing seems to be the application of the partiality monad to contain non-termination when comparing reals. I've read that Altenkirch & Danielsson paper a few weeks ago and played with it myself, so this is quite relevant to me, although not surprising.

>> No.8425566

NEXT VIDEO WHEN

>> No.8425836
File: 2.93 MB, 1352x1528, the book cover 004.png [View same] [iqdb] [saucenao] [google]
8425836

https://youtu.be/gnw9KvswXno

>>8425566
NOW

>>8425529
The community around HoTT turns me off quite a bit. I assume for Agda there is a bit more libraries available (even if much of it is completely academic).
However if Agda would produce a coding book, I'd totally read that too. Didn't want to diss the language.

>> No.8425871

If you're looking for a recording software, try OBS (Open Broadcaster Software). It's quite popular among streams, but I believe it should be possible to do local recording only. You can select which windows you want to record, where to place the webcam if you want it, etc. It's open-source and has a Mac OS version.

>> No.8427004

Bump.

>> No.8427010
File: 584 KB, 1234x995, Screen Shot 2016-10-21 at 10.35.47.png [View same] [iqdb] [saucenao] [google]
8427010

>>8427004
Thanks for the bump. I've just written down a programming task and will also summarize it in a video, mabye later.

This is on
https://en.wikipedia.org/wiki/Hidden_Markov_model

---------------------------------

Okay, so today let's care about the example in the text again.

It's from p.24 here:
https://docs.ufpr.br/~danielsantos/ProbabilisticRobotics.pdf

I've posted the 5 relevant pages here:
http://imgur.com/a/WHaay

Here, let's discuss what we need for a computer implementation where we abstract all the particular chances (numbers in [0,1]) in the pdf:

- You have a door that's in one of two states [math] x : Bool [/math]:
x = "open"
or
x = "closed".
- You have a robot which works in discrete time steps, [math]n : {\mathbb N}[/math], and has
2. an unreliable arm to try and open the door (does nothing if it's already open)
3. an unreliable eye to look at the door and find out if it's open

We care about the robots time dependent believe distribution for the state of the door,
[math] bel : {\mathbb N} \to (Bool \to [0,1]) [/math]
which here is just given by the probability that the door is open

[math] bel(n, open) \in [0,1] [/math]

[math] bel(n, closed) := 1-bel(n, open) [/math]

>> No.8427014
File: 177 KB, 877x704, Screen Shot 2016-10-21 at 10.36.06.png [View same] [iqdb] [saucenao] [google]
8427014

You need one initial assumption
[math] bel_n0_open : [0,1] [/math]
and set
[math] bel(0, open) := bel0open [/math]

At each time step, he first can take an action (u) and afterwards measured the door and updates his believe.

You need a model for sensor data z (same type as state in this case)
and
action effects u (a bool, try or dont try to open the door):
Those probabilities are time independent in our model, i.e. given by a few numbers:

1. the chance [math] Z_{x\,closed} : [0,1] [/math] that his sensor gives the right answer when the door is closed
2. the chance [math] Z_{x\,open} : [0,1] [/math] that his sensor gives the right answer when the door is open

3. the chance [math] U_{x\,closed} : [0,1] [/math] that he managed to open the door after he tried open a closed door

Written as functions, we have the conditionals

[math] p_{zx} : Bool \to (Bool \to [0,1]) [/math]
given by
[math] p_{zx}(closed \, | \, closed) = Z_{x\,closed} [/math]
[math] p_{zx}(open \, | \, closed) = 1-Z_{x\,losed} [/math]
[math] p_{zx}(open \, | \, open) = Z_{x\,open} [/math]
[math] p_{zx}(closed \, | \, open) = 1-Z_{x\,open} [/math]

and

[math] p_{x,ux} : Bool \to (Bool \to (Bool \to [0,1])) [/math]
given by
[math] p_{x,ux}(open \, | \, try, closed) = U_{x\,closed} [/math]
[math] p_{x,ux}(closed \, | \, try, closed) = 1-U_{x\,closed} [/math]
[math] p_{x,ux}(open \, | \, dont, closed) = 0 [/math]
[math] p_{x,ux}(closed \, | \, dont, closed) = 1 [/math]
[math] p_{x,ux}(open \, | \, try, open) = 1 [/math]
[math] p_{x,ux}(closed \, | \, try, open) = 0[/math]
[math] p_{x,ux}(open \, | \, dont, open) = 1 [/math]
[math] p_{x,ux}(closed \, | \, dont, open) = 0 [/math]

(use any language of your choice!...)

Next to the program specification:

>> No.8427018
File: 52 KB, 1000x623, arnold arm.jpg [View same] [iqdb] [saucenao] [google]
8427018

Program specification:

------

The code should thus do the following:

When we start we must enter the game parameters (in the command line, say)
>Chance a closed door is measured to be closed" (sets Z_x_closed)
>Chance an open door is measured to be closed" (sets Z_x_open)
>Chance a closed door is opened when he tries to do so (sets U_x_closed)
>Initial believed that the door is open" (sets bel_n0_open)
A random number generator sets the state x to open or closed without telling us.
The game starts, n=0.
The chance bel_n0_open that the door is open is displayed.
>I am 100*bel_n0_open % sure that the door is open.
We're asked if we want to take an action:
>Do you want to try to open the door or quit? y/n/q
We enter "y" OR "n". (i.e. u="try" OR u="dont")
If we try to open the door, the hidden state x is updated, with the chance given by [math] p_{x,ux} [/math] (use a random number generator with those chances).
With the new state, according to [math] p_{zx} [/math], we measure the system (random number generator again) and the measurement result is displayed:
>The door is measured to be open OR The door is measured to be closed
(i.e. z=“open” OR z=closed)
The values u and z are used to run the Bayes Filer, computing bel(n+1,open).
The updated believe is displayed
>I am 100*bel(n+1,open) % sure that the door is open.
and loop.
Under the hood, we keep track of x's, u's and z's.
If we enter "q" instead of "y" or "n", the list of triples is displayed, telling us how we reacted to the hidden state

>>8425871
Thanks, I'll look at it!

>> No.8427035

Ad.:
The second question should be
>Chance an open door is measured to be open
I instead wrote
>Chance an open door is measured to be closed

Also, for the initialization of the game, the random number generator should fix the initial state x according to the bel_n0_open entered.

>> No.8427039

and I guess you LOSE THE GAME if you quit and
1. the door isn't open yet
2. at one time you've tried to open the door even though it was already open

>> No.8427089

>>8427010
This looks kind of similar to things I've done with stochastic reinforcement learning using q-learning
I will read the book up to this part and maybe try to implement this task in Ada or C during the weekend when my schedule clears up a bit!

>> No.8427091
File: 181 KB, 1297x698, Screen Shot 2016-10-21 at 13.42.48.png [View same] [iqdb] [saucenao] [google]
8427091

k, now I did the initialization query in Python 2 (and then some random plays with the input. I personally like us use dictionaries in Python, to avoid duplicating code).

I've pasted that bit of code here:
http://pastebin.com/LKKKTVBY

For whoever wants an interactive editor for Python too, I use Canopy, which has the interactive Python environment integrated.
It's downloadable here
https://www.enthought.com/canopy-subscriptions/

>> No.8427095

>>8427091
>using Python 2
ew

>> No.8427098
File: 58 KB, 634x346, Karli.jpg [View same] [iqdb] [saucenao] [google]
8427098

>>8427089
Great!

I'd like to see some C code (and also Ada I guess), because I really want to learn it.

Also, it would be cool if we found an online environment
like the C++ shell

http://cpp.sh/

so other people can participate and run and modify code without doing everything themselves/on their machine

>> No.8427315

>>8427098
>Also, it would be cool if we found an online environment
What about Jupyter? It supports Python, Hasklel, R and probably a couple more.

>> No.8428371
File: 2.29 MB, 3264x1836, IMG_20161021_163815108.jpg [View same] [iqdb] [saucenao] [google]
8428371

>>8427315
Is that an online tool? I've uded it, but just to send finished scripts per mail.

>> No.8429228

>>8428371
Dunno. I believe it's based on IPython, which does have some cloud apps. This one is probably not so popular, so no free clouds for us. I'd gladly provide an instance if I had a VPS, but I ain't got one.

>> No.8429318
File: 193 KB, 1192x749, Screen Shot 2016-10-22 at 10.40.56.png [View same] [iqdb] [saucenao] [google]
8429318

https://goo DOT gl/heZDk3

>>8429228
So I found the website above (pic related) where you can script and hit the "Execute" button.
However, it didn't accept the interactive input line
>float(input(line+": "))
so I set all the init values to 0.4. It probably works somehow, though. Play around and try and make it run interactively (:

IPython and Jupyther is great, but I don't know if you can continuously interact with a script there? (and when I just went there it also didn't like my Python 2 :)

>> No.8429323

btw. the link above with the DOT replaces with . directly take you to the script

>> No.8430025

>>8427018
I don't really get how the measurements should be taken and updated?

>> No.8430275 [DELETED] 
File: 79 KB, 720x960, 12067206_1012986575389567_374226545_n.jpg [View same] [iqdb] [saucenao] [google]
8430275

>>8430025
Since we don't have a real enviroment, in this script (with the specified goal of updating the robots believe) we must also simulate a real world, i.e. [math] x_n [/math].


When we start the game, we e.g. define the init val
bel0opened = 70%
and then we'll set
x_0 = r
where r is open or closed, and determined by a random sampling
(e.g. take a random real in [0,1] and if it's <0.7 then assign opened to x_0)

Now that's the simulation of the true value and we hide it from the user of the script.
The robot can never know x_n as such either, since it can only store values z_n,
which are prone to error.

The robot can do actions u_n, and in practice they will be determined by the robots believe, bel(x_n).
Like, if you believe to 95% that the turbine of the jet is broken, initiate the ejection seat to save the pilot.

We'll do the scipt in a way (I mean that's my proposal, play around as you want) that it shows us the robots believe and let the user decide if u_n is y or n. If y, then the hidden x_n has some chance of changing (if it's closed, it may be opened by the robots push).

Clear?

I did my taxes today and am gonna summarize the whole program specification in a video.

>> No.8430285 [DELETED] 
File: 79 KB, 720x960, 12067206_1012986575389567_374226545_n.jpg [View same] [iqdb] [saucenao] [google]
8430285

>>8430025
Since we don't have a real enviroment, in this script (with the specified goal of updating the robots believe) we must also simulate a real world, i.e. xn.


When we start the game, we e.g. define the init val
bel0opened = 70%
and then we'll set
x_0 = r
where r is open or closed, and determined by a random sampling
(e.g. take a random real in [0,1] and if it's <0.7 then assign opened to x_0)

Now that's the simulation of the true value and we hide it from the user of the script.
The robot can never know x_n as such either, since it can only store values z_n,
which are prone to error.

The robot can do actions u_n, and in practice they will be determined by the robots believe, bel(x_n).
Like, if you believe to 95% that the turbine of the jet is broken, initiate the ejection seat to save the pilot.

We'll do the script in a way (I mean that's my proposal, play around as you want) that it shows us the robots believe and let the user decide if u_n is y or n. If y, then the hidden x_n has some chance of changing (if it's closed, it may be opened by the robots push).

The measurement result is given by the conditional probability
[math] p_{zx}(z_n,x_n) [/math]
During the measurement step (after the action determined by u), we always measure: We measure if it's open.
The relevant info is
[math] p_{zx}(open,open) [/math]
and
[math] p_{zx}(open,closed) [/math]
Here the second slot is given by the real value x_n. We only get back open or not open, but we don't know which of those two lead there.

Clear?

I did my taxes today and am gonna summarize the whole program specification in a video.

>> No.8430289
File: 79 KB, 720x960, 12067206_1012986575389567_374226545_n.jpg [View same] [iqdb] [saucenao] [google]
8430289

>>8430025
Since we don't have a real enviroment, in this script (with the specified goal of updating the robots believe) we must also simulate a real world, i.e. xn.


When we start the game, we e.g. define the init val
bel0opened = 70%
and then we'll set
x_0 = r
where r is open or closed, and determined by a random sampling
(e.g. take a random real in [0,1] and if it's <0.7 then assign opened to x_0)

Now that's the simulation of the true value and we hide it from the user of the script.
The robot can never know x_n as such either, since it can only store values z_n,
which are prone to error.

The robot can do actions u_n, and in practice they will be determined by the robots believe, bel(x_n).
Like, if you believe to 95% that the turbine of the jet is broken, initiate the ejection seat to save the pilot.

We'll do the script in a way (I mean that's my proposal, play around as you want) that it shows us the robots believe and let the user decide if u_n is y or n. If y, then the hidden x_n has some chance of changing (if it's closed, it may be opened by the robots push).

The measurement result is given by the conditional probability x_n ==> z_n:
[math] p_{zx}(z_n \,|\, x_n) [/math]
During the measurement step (after the action determined by u), we always measure: We measure if it's open.
The relevant info is
[math] p_{zx}(open \,|\, open) [/math]
and
[math] p_{zx}(open \,|\, closed) [/math]
Here the second slot is given by the real value x_n. We only get back open or not open, but we don't know which of those two lead there.

Clear?

I did my taxes today and am gonna summarize the whole program specification in a video.

>> No.8430356 [DELETED] 
File: 70 KB, 1273x370, Screen Shot 2016-10-22 at 22.27.40.png [View same] [iqdb] [saucenao] [google]
8430356

such a function may come in handy:
chance_if(0.7, "foo", "bar")
returns "foo" 70% of the time, and else "bar".

#################

import random

def chance_if(prop = 0.5, val_1 = True, val_2 = False):
rand = random.uniform(0, 1)
if rand <= prop:
v = val_1
else:
v = val_2
return v

### the above implementations has defaults 0.5, True as first value and False as second.

>> No.8430358
File: 73 KB, 1027x345, Screen Shot 2016-10-22 at 22.32.31.png [View same] [iqdb] [saucenao] [google]
8430358

such a function may come in handy:
chance_if(0.7, "foo", "bar")
returns "foo" 70% of the time, and else "bar".

#################


import random

def chance_if(p = 0.5, a = True, b = False):
return a if random.uniform(0, 1) <= p else b

### the above implementations has defaults 0.5, True as first value and False as second.

>> No.8430363
File: 76 KB, 651x378, Screen Shot 2016-10-22 at 22.37.06.png [View same] [iqdb] [saucenao] [google]
8430363

such a function may come in handy:
p_if(0.7, "foo", "bar")
returns "foo" 70% of the time, and else "bar".

#################


import random

def p_if(p=0.5, a=True, b=False):
P = random.uniform(0,1) <= p
return a if P else b

### the above implementations has defaults 0.5, True as first value and False as second.

>> No.8430446
File: 105 KB, 645x275, recursivestateestimation.gif [View same] [iqdb] [saucenao] [google]
8430446

>>8427089
I'm back and I've kind of done the implementation as far as I understood from the text
it does follow the example in the book given the same values, but I don't really know if its valid past that.

It's implemented in Ada, I could maybe git the code if anyone is interested. (I should add some more comments before that though)

So far, it does not update its measured value of the door state past the value given during initialisation
[eqn]p(Z_t=sense\_open|X_t=is\_open) = 0.6[/eqn] and [eqn]p(Z_t=sense\_closed|X_t=is\_closed) = 0.8[/eqn]

It calculates the belief of the door state according to past and the posterior belief calculation.

>> No.8430468
File: 131 KB, 1075x730, Pendel_160924_image_1_.jpg [View same] [iqdb] [saucenao] [google]
8430468

>>8430446
Sounds good.

Yeah, in your clip, you don't specify
[math] p_{x,ux}(open \, | \, try, closed) [/math]
i.e. the probabilistic effect of the action u when the door is closed.

Post the code for sure.
Is it more than one page that you can't just save it on a Pastebin.com page?

>> No.8430532

>>8430468
>>8430468
Its three files in total (2 for package/header containing functions, 1 main file)
As to the values not specified
they were inherited from those specified like done in the book [math]1.0-input[/math]
but its a simple modification to make it a user input
My overall guess is that I've messed up with the Bayesian probabilities, quite new to it

https://github.com/fargelagit/Recursive-State-Estimation

>> No.8430615

>>8430532
I'll write the script in Python tomorrow or the day after, and then I'd like to go through your code.
Although I don't know Ada.
Why did you learn it?

>> No.8430645

>>8430615
Its a neat language (similar to vhdl which I occasionally work with) and its got some niche uses still in safety critical systems
I much prefer it to C due to the strictness of the compiler but ill try to vary between languages as long as im around

>> No.8430717 [DELETED] 
File: 1.12 MB, 1890x1510, znb.jpg [View same] [iqdb] [saucenao] [google]
8430717

To make for longer games, we may add a "random chance that the door pops open"

v_pop = 0.2 ### 20% chance

p(open | closed, try) = v_pop
p(open | closed, don't) = v_pop + (1-v_pop) * U_x_closed

---------

One thing I think about when I read your implementation:
At work I implement measurement loops (sweeps) in a physics lab and also do a GUI where you can stop an ongoing measurement. For this I need a boolean handle 'break', and so my go to way of breaking out of loops is slightly unlike yours:
You use a while(True) and then exit when q is pressed. Do you think it's not nice to e.g. introduce a boolean 'break=True' and go 'while(break)' and have the q-case just set 'break=False'? Might be simpler to read too. But I'm biased.

>> No.8430721
File: 1.12 MB, 1890x1510, znb.jpg [View same] [iqdb] [saucenao] [google]
8430721

One thing I think about when I read your implementation:
At work I implement measurement loops (e.g. frequency sweeps with pic related) in a physics lab and also do a GUI where you can stop an ongoing measurement. For this I need a boolean handle 'break', and so my go to way of breaking out of loops is slightly unlike yours:
You use a while(True) and then exit when q is pressed. Do you think it's not nice to e.g. introduce a boolean 'break=True' and go 'while(break)' and have the q-case just set 'break=False'? Might be simpler to read too. But I'm biased.

Going on:
To make for longer games, we may add a "random chance that the door pops open"

v_pop = 0.2 ### 20% chance
p(open | closed, dont) = v_pop
p(open | closed, try) = v_pop + (1-v_pop) * U_x_closed

Then
v_pop = 0.0
would go back to the book case

>> No.8431765
File: 2.92 MB, 1352x1528, the book cover 005.png [View same] [iqdb] [saucenao] [google]
8431765

New
https://youtu.be/JVxh57HPVw4

Just a short clip to catch up with the schedule.
If somebody knows what to do about the volume for this new software (from >>8425871), let me know. I'll experiment what happens if I change the output, and then, should that not help, look at more settings.

Old (>>8425836)
https://youtu.be/gnw9KvswXno

>> No.8432436 [DELETED] 
File: 353 KB, 1435x639, Screen Shot 2016-10-23 at 20.00.43.png [View same] [iqdb] [saucenao] [google]
8432436

So here the Python version of the game:

http://pastebin.com/iVixvv6q

>> No.8432460 [DELETED] 
File: 457 KB, 1434x791, Screen Shot 2016-10-23 at 20.11.21.png [View same] [iqdb] [saucenao] [google]
8432460

So here the Python version of the game:

http://pastebin.com/cpjtNaTS

>> No.8432509
File: 396 KB, 1387x792, Screen Shot 2016-10-23 at 20.34.25.png [View same] [iqdb] [saucenao] [google]
8432509

So here the Python version of the game:

http://pastebin.com/53cjZH5P

>> No.8433130
File: 2.91 MB, 1352x1528, the book cover 007.png [View same] [iqdb] [saucenao] [google]
8433130

https://youtu.be/soDGH43ALaI
(38 mins)
https://youtu.be/JWKAN0i1fJE
(2 mins)

>> No.8433836

>>8433130
Bump
I will try to revise and push a final Ada version today

>> No.8434306
File: 130 KB, 506x533, Screen Shot 2016-10-24 at 16.10.18.png [View same] [iqdb] [saucenao] [google]
8434306

So I read into the Wikipedia page an think we now understand the notorious Kalman filter:

It's when the true state evolution is given by a linear(ized) relation

[math] x_k = {F}_k x_{k-1} [/math]

(+possibly by a noise term)

and when the sensor is set to measure [math] {H}_{k} x_k [/math]

(the H-matrix can be a projection, thus taking into account that you only measure particular features of the truth, and you can't catch em all.)

and you apply the Bayes Filter with

[math] p( x_k \mid x_{k-1}) = \mathcal{N} ( {F}_k x_{k-1}, {Q}_k) [/math]

[math] p( {z}_k\mid x_k) = \mathcal{N}( {H}_{k} x_k, {R}_k) [/math]

where [math] \mathcal{N}( x, \sigma) [/math] is the normal distribution, except of course with multivariate arguments.

>> No.8434308

[math] \sigma^2 [/math]

>> No.8434322

(and replace Fx with Fx+Bu to include actions u)

>> No.8434445

>>8433836
pushed a final version of the Ada code to
https://github.com/fargelagit/Recursive-State-Estimation

>>8434306
I will take a look at that later this week, busy schedule and all

>> No.8434507

This thread makes me feel good being Statistics major.

>> No.8434518
File: 168 KB, 1080x720, Photo on 24-10-16 at 19.15.jpg [View same] [iqdb] [saucenao] [google]
8434518

>>8434445
Cool, I'll get at it.

>>8434507
Because I'm a pleb?

Damn, I just see the .pdf online doesn't appear to have the exericises at the end of the chapters like the thrid edition book has.
I'd write them down or make screenshots, if people care.

Do you want to do the exercises, statistics major?

>> No.8434523
File: 177 KB, 1080x720, Photo on 24-10-16 at 19.16 #4.jpg [View same] [iqdb] [saucenao] [google]
8434523

>> No.8434524
File: 150 KB, 1080x720, Photo on 24-10-16 at 19.17.jpg [View same] [iqdb] [saucenao] [google]
8434524

>> No.8434526
File: 200 KB, 1080x720, Photo on 24-10-16 at 19.20 #6.jpg [View same] [iqdb] [saucenao] [google]
8434526

>> No.8434530
File: 157 KB, 1080x720, Photo on 24-10-16 at 19.21 #2.jpg [View same] [iqdb] [saucenao] [google]
8434530

</end of chapter>


Here again the link to the book
https://docs.ufpr.br/~danielsantos/ProbabilisticRobotics.pdf

>> No.8434554

>>8434445
How do the "task" and "access" keywords work?

And the notation with the prime, I've never seen that. What other language use this?

Do you like the natural language aspect?

>> No.8434608

>>8418462
Bump, these are the kind of threads /sci/ needs. Right now I'm focused on materials but will def lurk the thread and read some chapters.

>> No.8434636

>>8434554
The task keyword is used to declare concurrent functionality (i.e. extra threads running in pseudo-parallel)
You declare a task type and and define a task body, the type contains either nothing or protected variables and entry calls using the "entry" keyword. The task body is where the functionality of the task is placed.
the "entry" keyword is used by the "accept" keyword in the task body to execute specific functionality whenever called.
Tasks act kind of like objects in other languages, in which you control them using a variable or an access (pointer equivalent in Ada)

access is as I mentioned the keyword to declare pointers in Ada, you use them as you basically would in any other language except you declare a type first e.g.

type integer_ptr is access Integer;
I : integer_ptr;

then you can use them to access other variables in the code doing, say:

example : Integer;
begin
I := example'Access; to access another variable
or do
I := new Integer; to have a a declaration basiacally equivalent to the C declaration int *I;

I could post some example use of both later in the week if you'd like, I'm not the best explainer to ever have lived but it might suffice. I could recommend this if you're interested in learning Ada
https://en.wikibooks.org/wiki/Ada_Style_Guide

And yeah I enjoy the natural language aspect, I think writing extra "unnecessary" words that increase readability is really useful.

>> No.8434640

>>8434636
Forgot about the apostrophe, its used in access handling, like you use -> in C

>> No.8434717

>>8434640
Attributes I mean

>> No.8434772
File: 45 KB, 828x634, hxalpha3.jpg [View same] [iqdb] [saucenao] [google]
8434772

>>8434636
I'm surprised that when you manipulate functions and compute values, often there is no function argument written down, where I'd naively expect one.

And how is it with lists and other data types in this language, you don't seem to use any in the code?
Or is it because you can just always do the ".." thing?

I never had to use pointers (reminds me of coming back to C again)?

How did you get to Ada? Was is use in an introductory course, do you work with embedded software, or what was the reason you got to it?

------

ad best semi-related:
For the lambda heads, I just found those 5 podcast recordings:
http://typetheorypodcast.com/

[math] \lambda n.\, \lambda x.\, \lambda f.\, f(x^n) [/math]

>> No.8434799

>>8434772
function arguments are honestly overrated in regular programming, its useful to pass pointers as arguments to save barely a handful of execution ticks but with the speed of computers its not necessary. global variables take longer to access than local ones though

the ".." thing is for assigning ranges, so 1..100 is 1 through 100, lists I assume you mean like arrays or vectors, they are declared as types, see for example in funcs.ads
there I declared "type uniDist is array (0..99) of Uniformly_Distributed;" this means that every variable i declare of the type uniDist will be an array with the range 0..99 of the type Uniformly_Distributed
range defines are also a very neat thing in Ada, you can do stuff like

type example is array (-5..25) of Integer;

and every variable of the type example will then have a range of -5 to 25, so e.g.
ex : example;
ex(-5) := 4;
would assign the first element of the array to 4.

so data types are declared as types (or subtypes but thats for another post) that either extend other types or have values you've defined (see type doorState and doorAction in funcs.ads)

I got into Ada back in highschool, for some reason my teacher though it to be a good introductory language, and I still use it almost 10 years later.
I'm in embedded control systems currently. Most of the industry revolves around C but I do implementations in Ada on occasion, some employers will love you for knowing both, others wont care.

>> No.8434850

>>8434772
>>8434799
my job sounds fancier than it actually is, i mostly write frameworks and drivers

what about you?

>> No.8434928
File: 234 KB, 1182x665, Fruit_Valerie.jpg [View same] [iqdb] [saucenao] [google]
8434928

>>8434799
>function arguments are honestly overrated in regular programming
Speaking of which, today I realized what bugged me about the presentation of the algorithm in the book.
They write
[math] bel(x_t) = \eta \cdot p(z_{t}\,|\,x_{t}) \cdot \int p(x_{t}\,|\,u_t, x_{t-1}) \, bel(x_{t-1}) \, {\mathrm d}x_{t-1} [/math]

but it should better be written
[math] bel_t(x) = \eta \cdot p(z_{t}\,|\, x) \cdot \int p(x\,|\,u_t, x') \, bel_{t-1}(x') \, {\mathrm d}x' [/math]

>this means that every variable i declare of the type uniDist will be an array with the range 0..99 of the type Uniformly_Distributed
Yeah I kind of meant that there's not brackets, which is very untypical.

>what about you?
https://at.linkedin.com/in/nikolaj-kuntner-0138aa104

>for some reason my teacher though it to be a good introductory language
I guess the natural language aspect makes it easy to read and it's strict. So why not.

>> No.8435955

>>8434928
>but it should better be written
yes thats it

>> No.8436478 [DELETED] 
File: 70 KB, 1280x737, Bri.jpg [View same] [iqdb] [saucenao] [google]
8436478

In your code (>>8430532)
https://github.com/fargelagit/Recursive-State-Estimation

Why is Initialise (defined in funcs.adb as merely calling setDoor) even defined?
Can't you just call setDoor at that position in the main file (bayes.adb)?
Even if not, is it really necessary the procedure is defined via
>procedure Initialise;
in the funcs.ads file?

>> No.8436487 [DELETED] 

Is it because you want setDoor to have it private to funcs.adb while you still need it ONCE in bayes.adb?

If yes, still, is this the best way to go about it - isn't it a bit verbose to add Initialize?

>> No.8436499
File: 70 KB, 1280x737, Bri.jpg [View same] [iqdb] [saucenao] [google]
8436499

In your code (>>8430532)
https://github.com/fargelagit/Recursive-State-Estimation

Why is Initialise (defined in funcs.adb as merely calling setDoor) even defined?
Can't you just call setDoor at that position in the main file (bayes.adb)?
Even if not, is it really necessary the procedure is defined via
>procedure Initialise;
in the funcs.ads file?

Is it because you want setDoor to have it private to funcs.adb while you still need it ONCE in bayes.adb?
If yes, still, is this the best way to go about it - isn't it a bit verbose to add Initialize?

And I don't quit eget (0..1). Is this a pair?
And do you fix something (length of the game?) to 99?

>> No.8436659

>>8436499
Yes its very unnecessary to have initialise defined and have it only call setDoor. My initial reasoning was something that setDoor would set the door state and initialise would set the remaining values but I since discarded the idea because it too was somewhat unnecessary and I didn't really bother to clean up.
The reason initialise is still present is because setDoor is a private function only accessible within funcs, that is easily changed though.

(0..1) will give a range of 2 and hence a two element array (pair, vector, whatever, I assume you mean the doorStates type definition)

The length of the game is fixed to 100 iterations yes, not likely anyone will exceed it since it should take around 5 iterations to deduce the real state of the door.

>> No.8436942
File: 2.91 MB, 1352x1528, the book cover 008.png [View same] [iqdb] [saucenao] [google]
8436942

https://youtu.be/7EeuMyRECPU

Discussion of fargelagit's code

>> No.8438265

>>8436942
Cool, nice that you actually studied my code, that's a rare thing.
I plan on sticking around for a while, next time I'll do the implementation in C

>> No.8438292

>>8438265
Very much looking forward to that.
I'll take the change and bury a strawpoll link here to see how many people are even reading this:
http://www.strawpoll.me/11509318
The next thing on the list is exercise 1 and 2 >>8434518.