palmy
Cool to see that it's still kicking!
Also made some minor modifications: replaced `xsel` with `xclip` and added truncated version of the copied text to the `notify-send`:
#!/bin/bash
# Dependencies: tesseract-ocr imagemagick
# on gnome: gnome-screenshot
# on kde: spectacle
# on x11: xsel
# on wayland: wl-clipboard
die(){
notify-send "$1"
exit 1
}
cleanup(){
[[ -n $1 ]] && rm -r "$1"
}
SCR_IMG=$(mktemp -d) || die "failed to take screenshot"
# shellcheck disable=SC2064
trap "cleanup '$SCR_IMG'" EXIT
#notify-send "Select the area of the text"
if which "spectacle" &> /dev/null
then
spectacle -n -b -r -o "$SCR_IMG/scr.png" || die "failed to take screenshot"
else
gnome-screenshot -a -f "$SCR_IMG/scr.png" || die "failed to take screenshot"
fi
# increase image quality with option -q from default 75 to 100
mogrify -modulate 100,0 -resize 400% "$SCR_IMG/scr.png" || die "failed to convert image"
#should increase detection rate
tesseract "$SCR_IMG/scr.png" "$SCR_IMG/scr" &> /dev/null || die "failed to extract text"
if [ "$XDG_SESSION_TYPE" == "wayland" ]
then
wl-copy < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
else
# xsel -b -i < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
xclip -selection clipboard -i < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
fi
# Notify the user what was copied but truncate the text to 100 characters
notify-send "Text extracted from image" "$(head -c 100 "$SCR_IMG/scr.txt")" || die "failed to send notification"
exitPPLs are useful when the data generation process is not easily represented by something like a simple multivariate Gaussian, etc. You find many good examples academic research, e.g. epidemiology.
1. When your main objective is not prediction but understanding the effect of some underlying / unobserved random variable.
2. When you don't have tons data + you have very clear ideas of the data generation process.
(1) is mainly relevant for science rather than private companies, e.g. if you're an epidemiologist, you're generally speaking interested in determining the effect of certain underlying factors, e.g. effect of mobility patterns, rather than just predicting the number of infected people tomorrow since the hidden variables are often someting you can directly control, e.g. impose travel restrictions.
(2) can occur either in academic settings or in private sector in applications such as revenue optimization. In these scenarios, it's also very useful to have a notion of the "risk" you're taking by optimizing according to this model. Such a notion of risk is in the Bayesian framework completely straight-forward, while less so in the frequentist scenarios.
I've been involved in the above scenarios and have seen clear advantages of using Bayesian inference, both in academia and private sector.
With that being said, I don't think ever Bayesian inference, and thus even less so PPLs, are going to "take off" in a similar fashion to many other machine learning techniques. The reason for this are fairly simple:
1. It's difficult. Applying these techniques efficiently and correctly is way more difficult than standard frequentist methods (even interpeting the results is often non-trivial).
2. The applicability of Bayesian inference (and thus PPLs) is just so much more limited due to the computational complexity + reduction in utility of the methods as data increases (which, for private companies, is more and more the case).
PPLs mainly try to address (1), and we do have examples of very successful examples of this, e.g. PyMC3 (they also have a bunch of nice examples of applying Bayesian inference in private sector context), and Stan (maybe more heavily used in academia).
Yes, it's not like running an actual browser, but this is so much better than anything I expected.
https://macowners.club/posts/using-xwidgets-on-macos/ gave me a quick and nice overview of how it looked.
Worth noting that Germany not having any deaths despite such a large number of cases can also indicate that they discover the infection very early, and similarly the number of US deaths can indicate late discovery.
I do this without even publishing the posts. As mentioned in one of the other comments, I am vary of making these accessible for the public due to lack of "oversight". I feel like there's a responsibility when sharing information, and if I'm not 100% sure what I've written is correct, I don't want to mislead people. And even if correct, one should really ask themselves if it actually adds something to the topic which is otherwise not easily accessible. I think this is especially important to ask today when there is so much information already available.
Hence I actually think writing blog posts as means of understanding is a really goof approach; whether or not the piece should be made public is something that should then be judged case-by-case.
And regarding the moments, it's just that the normal distribution is the only distribution with a finite number of non-zero moments. Therefore, constraining higher order moments is not so straight forward.
Also might be worth noting that technically, if one was sufficiently UNreasonable, one could constrain the target distribution to take on specific values given specific inputs. This would not be very useful in any real-world applications. Then choosing between constraining only the first moment ("minimal" constraints), or constraining each point you've observed to take on the normalized frequency ("maximal" constraints) becomes entirely up to you. Therefore I don't see quite how maxent models give us the tools for deciding between complexity and accuracy, as the maxent models can be on either end of the spectrum depending on what constraints we choose.
(Unsure if you were implying that it did, but nonetheless it might be something to note.)
I do see the reasoning for choosing the normal due to it being the only distribution with finite non-zero moments, and thus, as you nicely pointed out, constraints on a finite number of higher order moments will not give a unique distribution.
But, due to the issues we've now mentioned, I find myself a bit uneasy wrt. maxent as a derivation of and/or as an explanation of the ubiquity of the normal distribution. Thus I find myself more comfortable with some of the other derivations demonstrated by Jaynes.
And thank you for the paper reference; will have a proper look at it sometime. It might be related to
I'm intrigued by your comment on maximum entropy, as I personally struggle with the maximum entropy derivation due to the fact that we're using differential entropy ("continuous" entropy) to derive the Gaussian under constraints on the first and second moment. The differential entropy does not satisfy the same properties as entropy for a discrete distribution, some of which are the very properties that motivated entropy as a measure of information. Jaynes himself wrote a paper on this topic of continuous entropy in the 60s (can dig out the reference in the morning). Even ignoring this, I also struggle a bit with "we're only constraining the two first and second moment". Why exactly one the first two? Why not the three first, etc.? One could say it's motivate by the fact that the Gaussian is the only distribution with finite nonzero moments, but that seems a bit handwavey?
Would genuinely appreciate some input here, as the concept of Principle of Maximum Entropy is something I have a bit of trouble coming to terms with for the reasons described above (in general, mainly because choice of constraints is abritrary).
On top of this, if you read a fair bit of papers, check out org-ref [1]. Referencing and notetaking of papers becomes a breeze.
Finally, you can also export your notes to a bunch of different formats (e.g. html, pdf).
But for the specific use-cases you mentioned:
- Org-mode allows you to integrate code into the document, hence to draw a function you could easily write a small snippet of code outputting a plot, which will be embedded in the document.
- I actually do this sometimes too! For the color-coding, Org-mode allows you to embedd arbitrary LaTeX such as "\textcolor{red}{\alpha}". I've set up a Yasnippet which lets me type "color + [TAB]" and expands to "\textcolor{}{}" with my cursor inside the curly brackets. I type "red" and hit TAB again, and then type whatever I want to be coded in red. For descriptions, I'm unsure why you couldn't as easily do this in a document. In my documents I usually have a larger body of text deriving/explaining the equation, and then I simply put the equation into a definition-block for further reference. Then I know that I can jump to its definition, and I'll find a more thorough explanation of it.
- edit
- organize (heck, you can even search!)
But I'm a maths student and I never came across anything where I can efficiently write equations and formulas, before Emacs + Org-mode.
I have now been using Emacs + Org-mode + Yasnippet for a year, and it's bloody amazing. When it comes to efficiently including latex-expressions in my org-notes, Yasnippet is an absolute must.
And because this is Org-mode, I can export all my notes to HTML, PDF, etc. Adding a bit of customization, you get something like this http://www.retiredparkingguard.com/notes/. If you go to one of the note-pages with a bit of maths on it, e.g. mathematics/geometry.html, you should see a bar on the right displaying the notation used in each section. This requires javascript.
I also make heavy use of customized named blocks in my note-taking, e.g.
#+name: def:schrodinger-equation
#+begin_definition
...
#+end_definition
And then, using org-ref, I can do a `M-x org-ref-insert-ref-link` anywhere in the document and I can search through all these definitions, theorems, etc.
These blocks, when exported to HTML, are also given CSS classes, hence you can easily give these styling, making the reading experience into whatever you want.
Finally, I would also suggest org-ref by John Kitchin (https://github.com/jkitchin/org-ref); it makes organizing papers and the corresponding notes so incredibly easy.
All together this makes note-taking such a breeze and lowers the barrier for me to re-read and edit my notes significantly, compared to handwritten notes.
From what I can gather he's basically saying that the "probability of a random face being classified as homosexual" is 0.5. This isn't REALLY true (would have to run the classifier on all possible faces to find this), but that is in fact the "environment" the classifier has been trained within.