Skip to content

Commit b21d647

Browse files
committed
Testing new repositories
1 parent 29d83da commit b21d647

File tree

1 file changed

+35
-108
lines changed

1 file changed

+35
-108
lines changed

12_Datenfusion.md

Lines changed: 35 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ script: https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js
1717
https://cdn.plot.ly/plotly-latest.min.js
1818
1919
link: https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css
20+
21+
@eval: @Rextester._eval_(@uid, @Python, , , ,
22+
```
23+
var string = data.Result.replace(/\n/g, ' ');
24+
var lines = string.match(/(?<=\[).+?(?=\])/g);
25+
var outcome = [];
26+
for (var i=0; i<lines.length; i++){
27+
outcome[i] = lines[i].split(' ').map(function(item) {
28+
return parseFloat(item);
29+
});
30+
}
31+
@input(1);
32+
Plotly.newPlot(span_id, plot, layout);
33+
console.log("Aus Maus");
34+
```)
35+
2036
-->
2137

2238
# Vorlesung XII - Datenfusion
@@ -188,16 +204,10 @@ belief = np.array([1./10]*10)
188204
print(belief)
189205
```
190206
```js -Visualization
191-
var line = data.Result.slice(1, data.Result.length-2);
192-
line = line.replace( /\s\s+/g, ' ' );
193-
var outcome = line.split(' ').map(function(item) {
194-
return parseFloat(item);
195-
});
196-
197207
var plot = [
198208
{
199209
x: d3.range(0, 10),
200-
y: outcome,
210+
y: outcome[0],
201211
type: 'bar',
202212
name: 'Potential positions',
203213
}
@@ -222,12 +232,9 @@ var layout = {
222232
legend: { x: 1, xanchor: 'right', y: 1},
223233
tracetoggle: false
224234
};
235+
```
236+
@eval
225237

226-
Plotly.newPlot('Diagram1', plot, layout);
227-
console.log("Aus Maus")
228-
```@Rextester._eval_(@uid, @Python,`@0`,`@1`,` `,`@input(1)`)
229-
230-
<div id="Diagram1"></div>
231238

232239
Es wird deutlich, dass wir aktuell noch kein Wissen um die Position des Bootes haben. Man spricht vom "apriori-"Wissen.
233240

@@ -320,12 +327,6 @@ belief[markers == 0] = (1-truePositive)/np.count_nonzero(markers==0)
320327
print(belief)
321328
```
322329
```js -Visualization
323-
var line = data.Result.slice(1, data.Result.length-2);
324-
line = line.replace( /\s\s+/g, ' ' );
325-
var outcome = line.split(' ').map(function(item) {
326-
return parseFloat(item);
327-
});
328-
329330
var plot = [
330331
{
331332
x: d3.range(0, 10),
@@ -354,12 +355,8 @@ var layout = {
354355
legend: { x: 1, xanchor: 'right', y: 1},
355356
tracetoggle: false
356357
};
357-
358-
Plotly.newPlot('Diagram2', plot, layout);
359-
console.log("Aus Maus")
360-
```@Rextester._eval_(@uid, @Python,`@0`,`@1`,` `,`@input(1)`)
361-
362-
<div id="Diagram2"></div>
358+
```
359+
@eval
363360

364361
### Abbildung auf apriori Wissen
365362

@@ -381,12 +378,6 @@ posteriori = (apriori * belief) / sum(apriori*belief)
381378
print(posteriori)
382379
```
383380
```js -Visualization
384-
var line = data.Result.slice(1, data.Result.length-2);
385-
line = line.replace( /\s\s+/g, ' ' );
386-
var outcome = line.split(' ').map(function(item) {
387-
return parseFloat(item);
388-
});
389-
390381
var plot = [
391382
{
392383
x: d3.range(0, 10),
@@ -415,12 +406,8 @@ var layout = {
415406
legend: { x: 1, xanchor: 'right', y: 1},
416407
tracetoggle: false
417408
};
418-
419-
Plotly.newPlot('Diagram2', plot, layout);
420-
console.log("Aus Maus")
421-
```@Rextester._eval_(@uid, @Python,`@0`,`@1`,` `,`@input(1)`)
422-
423-
<div id="Diagram2"></div>
409+
```
410+
@eval
424411

425412
Wie erwartet haben die Segmente mit Schildern eine deutlich höhere Wahrscheinlichkeit von $p=0.24$ als die anderen Bereiche. Welche Veränderung
426413
erwarten Sie, wenn wir die Qualität der Sensormessungen erhöhen?
@@ -448,12 +435,6 @@ for i in range(1, 10):
448435
print(p_1)
449436
```
450437
```js -Visualization
451-
var line = data.Result.slice(1, data.Result.length-2);
452-
line = line.replace( /\s\s+/g, ' ' );
453-
var outcome = line.split(' ').map(function(item) {
454-
return parseFloat(item);
455-
});
456-
457438
var plot = [
458439
{
459440
x: d3.range(0, 10),
@@ -482,12 +463,8 @@ var layout = {
482463
legend: { x: 1, xanchor: 'right', y: 1},
483464
tracetoggle: false
484465
};
485-
486-
Plotly.newPlot('Diagram3', plot, layout);
487-
console.log("Aus Maus")
488-
```@Rextester._eval_(@uid, @Python,`@0`,`@1`,` `,`@input(1)`)
489-
490-
<div id="Diagram3"></div>
466+
```
467+
@eval
491468

492469
Unsere Positionsschätzung nähert sich der belief-Verteilung unsere Messung an. Der Einfluß des Anfangswissens geht zurück.
493470

@@ -512,18 +489,6 @@ print(belief)
512489
print(perfect_predict(belief, 1))
513490
```
514491
```js -Visualization
515-
var lines = data.Result.split('\n');
516-
var line_0 = lines[0].slice(1, lines[0].length-1).replace( /\s\s+/g, ' ' );
517-
var line_1 = lines[1].slice(1, lines[1].length-1).replace( /\s\s+/g, ' ' );
518-
519-
var outcome_0 = line_0.split(' ').map(function(item) {
520-
return parseFloat(item);
521-
});
522-
523-
var outcome_1 = line_1.split(' ').map(function(item) {
524-
return parseFloat(item);
525-
});
526-
527492
var plot = [
528493
{
529494
x: d3.range(0, 10),
@@ -559,12 +524,8 @@ var layout = {
559524
legend: { x: 1, xanchor: 'right', y: 1},
560525
tracetoggle: false
561526
};
562-
563-
Plotly.newPlot('Diagram4', plot, layout);
564-
console.log("Aus Maus")
565-
```@Rextester._eval_(@uid, @Python,`@0`,`@1`,` `,`@input(1)`)
566-
567-
<div id="Diagram4"></div>
527+
```
528+
@eval2
568529

569530
Welche Probleme sehen Sie?
570531

@@ -591,18 +552,6 @@ print(belief)
591552
print( predict_move(belief, 1, .1, .7, .2))
592553
```
593554
```js -Visualization
594-
var lines = data.Result.split('\n');
595-
var line_0 = lines[0].slice(1, lines[0].length-1).replace( /\s\s+/g, ' ' );
596-
var line_1 = lines[1].slice(1, lines[1].length-1).replace( /\s\s+/g, ' ' );
597-
598-
var outcome_0 = line_0.split(' ').map(function(item) {
599-
return parseFloat(item);
600-
});
601-
602-
var outcome_1 = line_1.split(' ').map(function(item) {
603-
return parseFloat(item);
604-
});
605-
606555
var plot = [
607556
{
608557
x: d3.range(0, 10),
@@ -638,12 +587,8 @@ var layout = {
638587
legend: { x: 1, xanchor: 'right', y: 1},
639588
tracetoggle: false
640589
};
641-
642-
Plotly.newPlot('Diagram5', plot, layout);
643-
console.log("Aus Maus")
644-
```@Rextester._eval_(@uid, @Python,`@0`,`@1`,` `,`@input(1)`)
645-
646-
<div id="Diagram5"></div>
590+
```
591+
@eval2
647592

648593
Was aber geschieht, wenn wir von einem unsicheren priori Wissen ausgehen?
649594

@@ -805,6 +750,8 @@ style="width: 100%; min-width: 380px; max-width: 720px; display: block; margin-l
805750
806751
Das folgende Codefragment bildet zwei Iterationen für unser Beispiel ab. Im ersten Durchlauf ändert die Prediktionsphase den Intertialen Wissenstand nicht. Die Faltung des Kernels ändert die Aufenthaltwahrscheinlichkeit nicht. Eine Präzisierung erfährt diese mit der ersten Messung durch den Schildersensor.
807752
753+
# asdfasöl
754+
808755
```python BayesFilter.py
809756
import numpy as np
810757
from scipy import ndimage
@@ -831,38 +778,18 @@ posteriori = posteriori * belief / sum(posteriori * belief )
831778
print(posteriori)
832779
```
833780
```js -Visualization
834-
var lines = data.Result.split('\n');
835-
var line_0 = lines[0].slice(1, lines[0].length-1).replace( /\s\s+/g, ' ' );
836-
var line_1 = lines[1].slice(1, lines[1].length-1).replace( /\s\s+/g, ' ' );
837-
var line_2 = lines[2].slice(1, lines[2].length-1).replace( /\s\s+/g, ' ' );
838-
var line_3 = lines[3].slice(1, lines[3].length-1).replace( /\s\s+/g, ' ' );
839-
840-
var outcome_0 = line_0.split(' ').map(function(item) {
841-
return parseFloat(item);
842-
});
843-
844-
var outcome_1 = line_1.split(' ').map(function(item) {
845-
return parseFloat(item);
846-
});
847781
848-
var outcome_2 = line_2.split(' ').map(function(item) {
849-
return parseFloat(item);
850-
});
851-
852-
var outcome_3 = line_3.split(' ').map(function(item) {
853-
return parseFloat(item);
854-
});
855782
856783
var plot1 = [
857784
{
858785
x: d3.range(0, 10),
859-
y: outcome_0,
786+
y: outcome[0],
860787
type: 'bar',
861788
name: 'Apriori Knowledge'
862789
},
863790
{
864791
x: d3.range(0, 10),
865-
y: outcome_1,
792+
y: outcome[1],
866793
type: 'bar',
867794
name: 'After measurement'
868795
},
@@ -871,13 +798,13 @@ var plot1 = [
871798
var plot2 = [
872799
{
873800
x: d3.range(0, 10),
874-
y: outcome_2,
801+
y: outcome[2],
875802
type: 'bar',
876803
name: 'After prediction'
877804
},
878805
{
879806
x: d3.range(0, 10),
880-
y: outcome_3,
807+
y: outcome[3],
881808
type: 'bar',
882809
name: 'After measurement'
883810
},

0 commit comments

Comments
 (0)