I am following this keras tutorial to construct a convolutional MNIST autoencoder. The decoder has a sigmoid activation function and the entire autoencoder is trained with binary_crossentropy loss. This makes sense to me if the pixel values are completely binary. However, I noticed that the digits are normalized between 0 and 1 and can take on values in the middle. (x_train, _), (x_test, _) = mnist.load_data()  x_train = x_train.astype('float32') / 255.  x_test = x_test.astype('float32') / 255.   While majority of the pixels take on 0 or 1 values, often times the edges take on intermediate values (the greenish pixels in the example image above). Therefore, wouldn't relu or some other activation function be more appropriate? I've seen many tutorials use sigmoid and binary_crossentropy, so I feel like I must be misunderstanding why these were chosen.
I was wondering why binary crossentropy can be used as the loss function in autoencoders trained on (normalized) images, e.g.  or ? I know that binary crossentropy can be used in binray classification problems where the ground-truth labels (i.e. $y$) are either 0 or 1 and therefore when predictions (i.e. $p$) are correct, in both cases, the loss value would be zero:  $$ BCE(y,p) = -y.log(p) - (1-y).\log{(1-p)} $$  $$ BCE(0,0) = 0, BCE(1,1) = 0 $$  However, binary crossentropy does not have a value of zero when neither of its arguments are both zero or one, which is the case for an autoencoder with ground-truth labels in range $[0,1]$ (i.e. assuming the input data has been normalized in this range). I thought a regression loss function such as mean squared error or mean absolute error must be used instead, which have a value of zero when labels and predictions are the same. What am I missing here?
Can I remove receipts from imported products from my passport? I have recently imported books into Canada from Japan.  As I bought in excess of 5000¥, the purchase was tax free and the receipt was stapled to my passport and stamped.  Since I've now come back to Canada and no issues occurred with my imports, Is it safe to remove the receipts from my passport?  As it was stamped and stapled, there will remain a trace that something was there. Could this cause problems when I return to Japan at a later time? Upgrade SQL Server database Using Compatibility Level I've made a backup of a SQL Server database running on SQL Server 2008. I've restored that backup into a SQL Server 2012 instance. I've set the compatibility level on the restored instance to SQL Server 2012 (110).   What does this do to the database?   Does it, for example,    cause stored procedures to be examined for incompatibilities cause any updates to all of the data pages in the database Cause updates to to datapages as the are accessed in the future Cause errors in the future if stored procedures or views are executed that use incompatible syntax   Where in books on line, or else where, can I find more detail? How to Sort a 2D array? I've always enjoyed solving problems in the complex numbers during my undergrad. However, I've always wondered where are they used and for what? In my domain (computer science) I've rarely seen it be used/applied and hence am curious.  So what practical applications of complex numbers exist and what are the ways in which complex  transformation helps address the problem that wasn't immediately addressable?  Way back in undergrad when I asked my professor this he mentioned that "the folks in mechanical and aerospace engineering use it a lot" but for what? (Don't other domains use it too?). I'm well aware of its use in Fourier analysis but that's the farthest I got to a 'real world application'. I'm sure that's not it.  PS: I'm not looking for the ability to make one problem easier to solve, but a bigger picture where the result of the complex analysis is used for something meaningful in the real world. A naive analogy is deciding the height of tower based on trigonometry. That's going from paper to the real world. Similarly, what is it that is analyzed in the complex world and the result is used in the real world without imaginaries clouding the problem?  The question:  is nice but covers a more mathematical perspective on interim results that make solving a problem easier. It covers different ground IMHO. I have two atoms, both of which are either bosons or fermions, with four allowed energy states: $E_1 = 0$, $E_2 = E$, $E_3 = 2E$, with degeneracies 1, 1, 2 respectively.  What's the difference between the partition functions of a pair of two bosons and that of a pair of two fermions? Can you negate the Frightened condition by not looking at the source of your fear? As the title says, if you cause a creature to be Frightened of you, as in the Frightened condition, but they can somehow manage to not see you, do they stop rolling with disadvantage to attacks/ability checks?  Below are scenarios to illustrate my question.  Scenarios:   If a creature is frightened of you, and they turn their back against you to hit someone else, would they no longer have disadvantage to attack rolls/ability checks? If a creature is frightened of you and they have Blindsight, can they close their eyes to stop seeing you, and hence stop rolling with disadvantage? If a creature has 60 ft of movement and is frightened of you, and there is a corner they can reach in 15 ft that will block you from sight, can they run to that corner to stop being frightened, then run back to attack without disadvantage? Assume they would not provoke OA to do this, although the OA is immaterial to the question. German language: use of comma in numbers How to run a script without closing the terminal? I have a script in file bla.sh and it is executable. When I click on it, the script is executed and the window is closed. I'd like the window to stay open.  Something like command cmd /k** command in Windows.  P.S. I don't want to use pause, but I want to able to write more commands after the script was executed. I found this , but I am not sure if this is the same issue.  On , I did some reformatting of the indentation in the code block to make it a bit more readable and it was  for peer review. A few minutes later, it appears the OP made an edit that added some additional code. It looks like my suggested edit was applied when the OP saved his/her edit, and it looks like he got the "credit" for the edit.  I'm not really concerned about the 2 rep points; I'm more curious why this happened and if this is a bug (or limitation) in the editing feature, or if this is known/intended behavior?  Note that this is not a suggested edit that's overridden by a concurrent edit: the recorded edit starts from the post-suggested edit state (and in fact can be identical to it, as in  ). How does CoffeeScript's existential operator work? How to truncate all logfiles? can anybody give me a solution to truncate all logfile in /var/log/ directory?  and a question just for knowledge, is it a good idea or not?  #!/bin/bash LOGDIR="/var/log" for logfile in $(ls $LOGDIR/*log) do   truncate -s 0 $logfile done Primitive of holomorphic Function $\frac{1}{z}$ on an Annulus. Given an Annulus with $A(0,r,R)$ show by considering Cauchy's Theorem for primitives that there is no holomorphic function with $f'(z)=\dfrac{1}{z}$.   I am struggling to picture this since but it seems like there are issues because $f(z)=\log z$ isn't well defined in the same range as $\dfrac{1}{z}$.  Am I looking to show that $\int_Ag(z)dz = 0$ where $g(z) = \dfrac{1}{z}$? Countability of disjoint intervals According this problem/solution set from an MIT class (http://ocw.mit.edu/courses/mathematics/18-100c-analysis-i-spring-2006/exams/exam1_sol.pdf), the assertion:  "Every collection of disjoint intervals in R is countable."  is True, because "every interval contains a rational number", and the rationals are countable.  It seems to me this should be False, with possible counterexample:  { [x,x] | x is an element of R}  ie the set of all singelton intervals on R. Why isn't this a valid counterexample? What lens characteristics are important in star photography? In optimal world I would buy a lens that is good in every way. But I'm on a budget and have to find a balance in quality and price. I'm looking for a lens for star photography, so in my case it will be a wide angle lens with good characteristics for capturing points of light in a dark sky. What would those characteristics be?  So far I've learned about , which seems like a thing to note when comparing different lenses for star photography. It would be quite disappointing if stars turned into long teardrops on the edges of a photograph even when every precaution was taken to make all stars sharp round points of light.  Vignetting would be an example of lens characteristic not so important in this use.  Many characteristics of a lens turn better when aperture is slightly stopped down, but I suppose I'd be wanting to use a lens with wide open aperture when trying to capture the stars in a dark night sky.  I'm not asking for lens recommendations. But, as an example of what kind of lenses I've been looking at, I name  manual focus lens. Its price level is $350'ish in Amazon and seems to run with name Rokinon too. It seems to be reasonably sharp even when wide open - my camera is an APS-C sensor camera. $\newcommand{\Var}{\operatorname{Var}}$In this  is claimed that if the equation of errors in OLS is given by: $$u=y - X\beta$$ Then in the presence of heteroscedasticity the variance of $u$, will not be constant, $\sigma^2 \times I$, where $I$ is an identity matrix, but: $$\Var(u\mid X)=\sigma^2\Omega$$ In order to account for the heteroskedasticity, we can estimate the transform system, such that $P$ is a transformation matrix. $$Py=PX\beta-Pu$$ Where "the variance of a constant matrix $P$ times a random vector $u$" is: $$\Var(Pu\mid X)=P\Var(u\mid X)P'=P(\sigma^2\Omega)P'$$ Can somebody explain me the proof for that? 529 plan withdrawal penalties My son is a freshman this year.  We live in and he attends school in California.  We pulled out the first $ from our Utah 529 plan.  I had the money deposited in my account since I paid the registration and dorm &amp; meal plan.  Our friend has a son a year ahead and he has the exact same 529 plan.  He warned me that he got hit with a small tax penalty when he withdrew the money to his account and not to an account in his son's name.  I called the 529 administrator and they said it shouldn't matter either way.  Other online blogs agree.  They say the only difference is that my son would get the tax forms and have to file if it went to his account. Nevertheless, my friend did get a penalty.  Any clarity would be appreciated! Should I round my uncertainty to nearest hundred? I was doing some exercises on error propagation when I came across this problem:  $4\pi^2/(0,034 \pm 0,004 \space s^2/cm)$  I calculated my uncertainty to be $\Delta$ = 136 $cm/s^2$  And so the hole thing gives me: $(1200 \pm 136) \space cm/s^2$.  Now going into my question I rounded $4\pi^2/0,034 = 1161.12993$ to $1200$ which makes sense since my uncertainty is 136 but in the solution to this problem $136$ is rounded to $100$ and that's not making much sense to me.  So should I always round my uncertainty to the nearest hundred (assuming my uncertainty has 3 digits)? I am struggling with this question from Halmos's text, please ignore the imperative language.  "Suppose that $L, M$  and $N$ are subspaces of a vector space. Show that the equation    $$L \cap (M + N) = (L \cap M) + (L \cap N)$$   is not necessarily true.  Since each of these subspaces has origin in them, clearly there intersections could not be empty. I wasn't able to formulate an example where this result did n't hold. Any help would be highly appreciated. Does League of Legends have a tournament that is recognized as the 'Most Important'? I recently upgraded from QGIS 3.2 to 3.4 using the standalone installer (Windows 64 bit), and uninstalling 3.2 beforehand.  When I open 3.4 it goes the background behind all my other open programs and clicking its icon on the taskbar does nothing, nor does Alt-Tab.  To use QGIS I have to minimize all my other open programs.    Is this a Windows issue, a QGIS issue, or something else entirely?