I am fairly new to neural networks. I am trying to empirically show that a neural network can work better than logistic regression when the underlying function is non-linear. In my simulation study, the true probability of assignment to the treatment group is a function of $X_1$, $X_2^2$, $X_3$, and $X_4$ - however, I am acting as if I don't know that $X_2$ is squared, and just using the non-squared term. Logistic regression performs poorly.   I think that I can get a neural network to estimate the function better since it's a (rather simple) non-linear function. However, my first attempt was not fruitful and I'm not sure if I need to increase "hidden," the number of hidden neurons, or change the activation function (or something else). Here's what I tried in R:  nn = neuralnet(t ~ X1+X2+X3+X4, data=df, hidden=3, act.fct = "logistic",              linear.output = FALSE)   Any thoughts?  Thanks!
I'm training a neural network but the training loss doesn't decrease. How can I fix this?  I'm not asking about overfitting or regularization. I'm asking about how to solve the problem where my network's performance doesn't improve on the training set.    This question is intentionally general so that other questions about how to train a neural network can be closed as a duplicate of this one, with the attitude that "if you give a man a fish you feed him for a day, but if you teach a man to fish, you can feed him for the rest of his life." See this Meta thread for a discussion:   If your neural network does not generalize well, see:
I have seen this construct in scripts a lot and used it myself, but it bothers me that I can't seem to find it in the documentation.  Example:  [ -f file1 ] &amp;&amp; [ -f file2 ] &amp;&amp; echo "Both files exist." || echo "One or the other file doesn't exist."   This could also be done with backslashes before the newlines, as mentioned in man bash:  If a \&lt;newline&gt; pair appears,  and  the  backslash  is  not itself  quoted,  the \&lt;newline&gt; is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).   Example:  [ -f file1 ] &amp;&amp; \ [ -f file2 ] &amp;&amp; \ echo "Both files exist." || \ echo "One or the other file doesn't exist."   ...but this doesn't seem to be necessary.  The first version above works even without the backslashes.  Where can I find this in man bash?  (Also, is this bash specific or POSIX compliant?) $\text{Let }y=\sqrt{5+\sqrt{5-\sqrt{5+\sqrt{5-...}}}} $, what is the nearest value of $y^2 - y$? I found this question somewhere and have been unable to solve it. It is a modification of a very common algebra question.          $\text{Let }y=\sqrt{5+\sqrt{5-\sqrt{5+\sqrt{5-...}}}} $,  what is the     nearest value of $y^2 - y$?          $\textbf {(1) } 1 \qquad \textbf {(2) } \sqrt5 \qquad \textbf {(3) } 4 \qquad \textbf {(4) } 2\sqrt5$      I worked the problem and got $$y^2 - y = 5+ \sqrt{5-\sqrt{5+\sqrt{5-...}}} -\sqrt{5+\sqrt{5-\sqrt{5+\sqrt{5-...}}}} \\ = 5+ \sqrt{5-y} - y = 5-y + \sqrt{5-y}$$ What do I do next? Is it possible that by mutation a human could see infrared or other 'colours'? Incoming light reacts with the several types of cone cells in the eye. In humans, there are three types of cones sensitive to three different spectra, resulting in trichromatic color vision. Each individual cone contains pigments composed of opsin apoprotein, which is covalently linked to either 11-cis-hydroretinal or more rarely 11-cis-dehydroretina.  The opsins (photopigments) present in the L and M cones are encoded on the X chromosome.  A very small percentage of women may have an extra type of color receptor because they have different alleles for the gene for the L opsin on each X chromosome. X chromosome inactivation means that only one opsin is expressed in each cone cell, and some women may therefore show a degree of tetrachromatic color vision. Tetrachromacy is also demonstrated among several species of birds, fish, amphibians, reptiles and insects.  Humans cannot see ultraviolet light directly because the lens of the eye blocks most light in the wavelength range of 300–400 nm.  So, besides above mentioned exceptions, is it possible due to mutations or genetic engineering to see UV or infrared. What kind of mutations should be made or are the changes to be made in the opsines to big to create 'alien' eyes? How can I safely move a module to another folder? I created a module through Drupal Console, unfortunately it wasn't placed in a folder of its own, rather straight into /modules/custom. Before I noticed where it had gone, I enabled the module.   In Drupal 6/7, this was easy to fix - I could literally just put the files into the correct path, clear the cache (maybe rebuild the registry, it wasn't an exact science), and all was well.  The same isn't true for Drupal 8; I moved the files into a subfolder, rebuilt cache, and all requests tell me that Drupal is failing to include a required file. The particular file is a block class, and the path Drupal is trying to find it is where it used to be, not where I've moved it to.  The bit of code objecting is in Symfony's ApcClassLoader, so I guess I need to clear something that's slightly above Drupal's head to get this path reference updated.  How can I do that?  Uninstalling and re-installing the module does work, but once there's important data stored that's not going to be an option.  I was wrong, uninstalling and re-installing is not a viable option. After uninstalling and reinstalling, Drupal can no longer pick up the custom blocks the module defines. I'm guessing that reference is cached somewhere that isn't cleared when the module is uninstalled. Just need to find out where that is and how to clear it... In school, we just started learning about trigonometry, and I was wondering: is there a way to find the sine, cosine, tangent, cosecant, secant, and cotangent of a single angle without using a calculator?  Sometimes I don't feel right when I can't do things out myself and let a machine do it when I can't.  Or, if you could redirect me to a place that explains how to do it, please do so.  My dad said there isn't, but I just had to make sure.  Thanks. I read a collection of Sci-Fi short stories back in the 1970's or early 80's that had one about a couple in love who kept losing each other. The book was my dad's so the story itself could be much older than that. I am very fuzzy on the details as I was young when I read it and it was so long ago. I believe the woman/girlfriend was "taken" (by some bad guy aliens??) while she was sleeping. I think it involved time travel and the man had to search through time to find her. After he found her, when he was asleep one time, he somehow was then "taken" and I think transported through time and had to fight his way back to her again. He may have been some sort of police officer. I just remember in the end, at night when they went to bed, the couple always wore handcuffs so they were never separated when they went to sleep ever again. Does this ring a bell with anyone?  (There is a possibility it is in a short story collection that also contained " The Twonky " by Lewis Padgett (1942), as I remember reading that story around the same time) Simple way of finding the locus of $z$? I am tasked to sketch the locus of complex numbers $z$ that satisfies $$(z-2+i)^2 + (z^*-2-i)^2 + 2zz^* + 6 = 0$$ I was wondering if there’s a special trick to this question, or if this is only solvable by plugging in $z=x+iy$ ? I noticed that the second term is the conjugate of the first, and wanted to substitute $w = z-2+i$, however this gives me a complicated expression for $zz^*$ which makes it more confusing. Is there a trick I’m missing out? Thanks! Edit: I have already solved it through direct substitution (parabola intersecting real axis at $x=3$ and $x=-1$) but it took a good 5 minutes or so, expanding everything correctly, which seems rather long (I was attempting it under exam conditions). I was just wondering if it is possible to exploit the $w$ substitution I made in particular. Prove $\int_0^\infty \frac{\sin^4x}{x^4}dx = \frac{\pi}{3}$ I need to show that  $$ \int_0^\infty \frac{\sin^4x}{x^4}dx = \frac{\pi}{3} $$  I have already derived the result $\int_0^\infty \frac{\sin^2x}{x^2} = \frac{\pi}{2}$ using complex analysis, a result which I am supposed to start from.  Using a change of variable $ x \mapsto 2x $ :  $$ \int_0^\infty \frac{\sin^2(2x)}{x^2}dx = \pi $$  Now using the identity $\sin^2(2x) = 4\sin^2x - 4\sin^4x $, we obtain  $$ \int_0^\infty \frac{\sin^2x - \sin^4x}{x^2}dx = \frac{\pi}{4} $$ $$ \frac{\pi}{2} - \int_0^\infty \frac{\sin^4x}{x^2}dx = \frac{\pi}{4} $$ $$ \int_0^\infty \frac{\sin^4x}{x^2}dx = \frac{\pi}{4} $$  But I am now at a loss as to how to make $x^4$ appear at the denominator.  Any ideas appreciated.  Important: I must start from $ \int_0^\infty \frac{\sin^2x}{x^2}dx $, and use the change of variable and identity mentioned above function a () {     return "foo"; }  a.b = function () {     return "bar"; }  function c () { }; c.prototype = a;  var d = new c(); d.b(); // returns "bar" d(); // throws exception, d is not a function   Is there some way for d to be a function, and yet still inherit properties from a? Can you stay in Turkey for over 90 days within the 180 day visa period but split over different visits? The Turkish e-visa is valid for a period of 180 days and allows you to stay for a maximum of 90 days. Am I allowed to stay for say 50 days, then another 50 days, over two different visits within the 180 day period?  I'm looking at the e-visa website  and it doesn't seem to be too clear on this. Suppose I look at a parallel plate capacitor in its rest frame and calculate the electrostatic energy, $E$.  Next, I look at the same capacitor in a primed frame boosted in the direction perpendicular to the plane of the plates. In this frame, the $E$-field is the same strength, there is no magnetic field, and the volume over which the $E$-field extends is less by a factor $1/\gamma$. This suggests $E' = \frac{1}{\gamma} E$, but relativity states that energy transforms as $E' = \gamma E$.   Where is the missing energy? "A number of students" vs. "the number of students" Possible Duplicate:          From the grammatical view both are correct, but please explain the difference in meaning:   The number of students in the class is fifteen. A number of students were late for class. Emacs: Symbol's value as variable is void Is there a combination of "LIKE" and "IN" in SQL? Plot above desired region register_globals error in php I was stuck up with the error   directive 'register_globals' is no longer available in PHP in unknown on line 0   when tried to check the php version using "php -v" after enabling register_globals in php.ini file. I am not getting any php version info by doing so. Instead it throws the above mentioned error.After turning off this option, php info works quite well. It is very essential for me to have register_globals to be turned on.How can I have this corrected.  my php.ini is as follows:   ; Default Value: None ; Development Value: "GP" ; Production Value: "GP" ; http://php.net/request-order request_order = "GP"  ; Whether or not to register the EGPCS variables as global variables.  You may ; want to turn this off if you don't want to clutter your scripts' global scope ; with user data. ; You should do your best to write your scripts so that they do not require ; register_globals to be on;  Using form variables as globals can easily lead ; to possible security problems, if the code is not very well thought of. ;  register_globals = On  ; Determines whether the deprecated long $HTTP_*_VARS type predefined variables ; are registered by PHP or not. As they are deprecated, we obviously don't ; recommend you use them. They are on by default for compatibility reasons but ; they are not recommended on production servers. ; Default Value: On ; Development Value: Off ; Production Value: Off ;  register_long_arrays = Off  ; This directive determines whether PHP registers $argv &amp; $argc each time it ; runs. $argv contains an array of all the arguments passed to PHP when a script ; is invoked. $argc contains an integer representing the number of arguments ; that were passed when the script was invoked. These arrays are extremely ; useful when running scripts from the command line. When this directive is ; enabled, registering these variables consumes CPU cycles and memory each time ; a script is executed. For performance reasons, this feature should be disabled ; on production servers. ; Note: This directive is hardcoded to On for the CLI SAPI ; Default Value: On ; Development Value: Off ; Production Value: Off ; register_argc_argv = Off  ; When enabled, the SERVER and ENV variables are created when they're first ; used (Just In Time) instead of when the script starts. If these variables ; are not used within a script, having this directive on will result in a ; performance gain. The PHP directives register_globals, register_long_arrays, ; and register_argc_argv must be disabled for this directive to have any affect. ; auto_globals_jit = On How to prove a cross is not locally homeomorphic to an euclidean space? Consider the subset $X = \{(x, 0) \mid -1 \lt x \lt 1\} \cup \{(0, y) \mid -1 \lt y \lt 1\} \subset \Bbb R^2$. It's just two open segments intersecting at $(0, 0)$.  How do you show that $X$, equipped with the subspace topology of $(\Bbb R^2, \lvert \lvert \cdot \rvert \rvert_2)$, is not locally homeomorphic to an euclidean space because of the point $(0, 0)$ ? Do I cast the result of malloc? Full List of inventory items After beating the game, I still have several empty inventory spots.  I most likely missed several items in my addicted frenzy to finish the game.  What are all the items that can be found in the game? And where can they found? How to raise a complex number to the power of another complex number? How do I calculate the outcome of taking one complex number to the power of another, ie  $\displaystyle {(a + bi)}^{(c + di)}$?