I have a list containing the activation function names to apply to each of the hidden layers of a NN.  I want to modify the following command so that instead of relu, the command calls activation[i]:  #activation = ['relu','softplus','softsign'] for i in range (1,hidden_layers+1):     W_dmd[i] = tf.Variable(tf.initializers.GlorotUniform()(shape=[input_shape,code_length]))     b_encoder_dmd[i] = tf.Variable(tf.initializers.Zeros()(shape=[code_length]))     x_dmd[i] = tf.compat.v1.nn.relu(tf.compat.v1.nn.xw_plus_b(x_dmd[i-1], W_dmd[i], b_encoder_dmd[i])) #Instead of relu, same command but with the name in activation[i]   The commands should then be:  x_dmd[1] = tf.compat.v1.nn.relu(tf.compat.v1.nn.xw_plus_b(x_dmd[0], W_dmd[1], b_encoder_dmd[1]))  x_dmd[1] = tf.compat.v1.nn.softplus(tf.compat.v1.nn.xw_plus_b(x_dmd[1], W_dmd[2], b_encoder_dmd[2])) x_dmd[3] = tf.compat.v1.nn.softsign(tf.compat.v1.nn.xw_plus_b(x_dmd[2], W_dmd[3], b_encoder_dmd[3]))   From this , I can come up with:  x_dmd[i] = getattr(tf.compat.v1.nn, activation[i])(tf.compat.v1.nn.xw_plus_b(x_dmd[i-1], W_dmd[i], b_encoder_dmd[i]))   Is this correct? Thanks!
What is the best way to go about calling a function given a string with the function's name in a Python program.  For example, let's say that I have a module foo, and I have a string whose content is "bar". What is the best way to call foo.bar()?  I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this.
As far as I know, only a player character's non-temporary ability scores are considered for taking feats, taking prestige classes, etc. Meanwhile, any ability bonus that comes from spells, or magic items that are in effect only while worn, is not counted (except tomes which increase abilities permanently).  So a Fighter with low Int who wants to qualify for Combat Expertise can't use spells or items that gives an Int bonus to raise it high enough to qualify. Is that right?  For example:  Say our fighter has Str 12, so he can not take the Power Attack feat. Suppose he asks for a spell from the wizard to make his Str 16, or to borrow a ring which provides +4 Str from another character. (Or any other method that will provide him a non-permanent bonus). His Str is now 16. Can he take Power Attack with that non-permanent bonus now? Because after the spell duration ends or he takes off the ring, his Str score will be to low again to qualify for Power Attack. Any hints or answers to figure out the unknown value of C? Proving that closed (and open) balls are convex Why do Jedi use lightsabers instead of blasters? Blasters seem to be more practical. Is there a special bond or something between lightsabers and Jedi? Estimating the integrated Tchebychev function and calculating its error How do I draw the graph of inequalities in the coordinate plane? I want to graph the following inequalities (done in desmos) in latex. I need the code. I have question about ArcGIS and python script. There are following sample code, So I would like to change Another Field , not OIDFieldName. Please let me know how to change Another Field.  import arcpy import itertools  arcpy.env.workspace = r"C:\path\to\workspace"  base_shapefile = "some_shapefile.shp"  oid_field = arcpy.Describe(base_shapefile).OIDFieldName feature_count = int(arcpy.GetCount_management(base_shapefile).getOutput(0))  for (i, j) in itertools.combinations(range(feature_count), 2):     arcpy.Select_analysis(base_shapefile , "combination_%i_%i.shp" % (i, j), '"%s" in (%i, %i)' % (oid_field, i, j))   These sample code is combination for 5C2. I want to create all combiantions 5C3 , 5C4 , 5C5. I'm looking to create a simple short-lived reservation system, and I'd like to generate confirmation numbers that are   unique random-looking alphanumeric short-ish, at least much shorter than 32 character-long strings returned by sha1   I'm only looking to have ~500 reservations, so I don't imagine high likelyhood of collissions.  One idea I had is generate an sha1 hash based on a date-time stamp and username, then truncating it to its first 10 characters.  Would something like that be reliably unique enough for the purposes of processing ~500 reservations? How to attach CGPDFDocument/CGPDFPage to MFMailComposeViewController Showing $\gcd(2^m-1,2^n+1)=1$ I didn't find the difference between them by  googling  Edit: Thx litterally, authenticate, means prove its identity, which is a just a subprocess of global access authorization btw I forgot to mention "Sign In", that's another confusing term for me ;)  Edit 2 other useful answers: $V$ be a vector space , $T:V \to V$ be a linear operator , then is $\ker (T) \cap R(T) \cong R(T)/R(T^2) $? Let $V$ be a vector space , $T:V \to V$ be a linear operator , then is it true that   $\ker (T) \cap R(T) \cong R(T)/R(T^2) $ ( where $R(T)$ denotes the range of $T$ ) ?    I know that the statement is true when $V$ is finite dimensional as I can show that if $V$ is finite   dimensional , then $\dim (\ker (T) \cap R(T))=rank (T) - rank (T^2)=\dim R(T)/R(T^2)$ ,   but I don't know what happens in general . Please help . Thanks in advance Parental controls with different settings for different users Does anyone know of a good way to set up some sort of parental controls so that one user account is subject to them, but not another?  A couple of friends of mine use Ubuntu and have kids (7 to 10 years old) who use the family computer. They'd like to have some blocking of adult sites. They're not going to supervise all the time, which I know might be ideal, but there we go. And they're not particularly technical, so they don't want to have to run scripts to turn the parental controls on and off regularly, but they can cope with having different accounts for different people. I haven't found a great way of doing this. I am pretty technical, so I'm happy to spend some time at the command line to set it up, but then it needs to just work.  Please don't just link to DansGuardian. If your answer doesn't address the different user account aspect, I will vote it down. If you want to talk about general parental controls that apply to all users then please start a new question - I'm sure that plenty of people would be interested in it, and I'll link to it from this question. I´d like to enable the ssh root access on Ubuntu 14.04. Editing the /etc/ssh_config (PermitRootLogin yes) didn't affect anything. What is the simplest and most robust way to get the user's current location on Android? Is it possible to upgrade a BGA 1224 CPU? I want to upgrade the CPU of my T430s laptop from i7-3520M to i7-3632QM. I'm sure i7-3632QM is supported (same socket (BGA1224), same TDP (35W) and microcode found in BIOS (306A9.PAT)).  So my question is: 1) is it possible to de-solder the current CPU without damaging it, and to solder the new CPU without damaging it and the motherboard ? 2) if so, what tools are necessary? who can do that at a reasonnable cost?  Until now, I was unable to find anyone able (or willing) to do that (I'm located in France, and I have tried a local fablab, electronics shops, TV repair shops, ...). Any hint would be appreciated. Select current element in jQuery How can I select part of a mesh and make it seperate? I want to make the teeth a separate child object from the mouth. I want to know the best way to do this.   I have tried going into edit mode with Tab and trying to select all the vertices but that doesn't move the teeth. Is there an easy way to select just that part and make it a separate child mesh to the rest of the mouth? Which one is correct to say: "It's me" or "It's I"? I was taught at school that the following expression is not grammatically correct:  Who is there? It's me.  The correct one is:  Who is there? It's I.  Can you let me know which one is accurate? Direct Proof that $1 + 3 + 5 + \cdots+ (2n - 1) = n\cdot n$ Prove that for all integers $n$, $n \geq 1$,   $$1 + 3 + 5 + \cdots + (2n - 1) = n\cdot n$$   How would I go about proving this?