Posts

Showing posts with the label artifcial intelligence machinelearning python

Implementation Stage Of Tanh Activation Function

Image
Tanh help to break non zero centered problem of sigmoid function. Tanh squashes a real- valued number to the range (-1, 1). It’s non-linear too. Secondary function give us nearly same as sigmoid’s outgrowth function. It break sigmoid’s debit but it still can’t remove the evaporating grade problem fully. When we compare tanh activation function with sigmoid, this picture give you clear idea. # tanh activation function def tanh(z): return (np.exp(z) - np.exp(-z)) / (np.exp(z) + np.exp(-z)) # Derivative of Tanh Activation Function def tanh_prime(z): return 1 - np.power(tanh(z), 2) For More Just Visit On InsideAIML .

Rules To Create Identifiers In Python

Image
There are  many   rules  that must  be   followed  to  produce  a python identifier. 1.You ca n’t  use   reticent  keywords as an identifier   name . 2. Python identifier can  contain  letters in a  small  case (a-z), upper case (A-Z),  integers  (0-9), and underscore (,). 3Identifier  name  ca n’t  begin  with a  number . 4. Identifiers in python ca n’t  contain   only   integers . 5.Python identifier  name  can  start  with an underscore. 6.There's no  limit  on the  length  of the identifier  name . 7.Python identifier  names  are case  sensitive . Python Valid Identifiers Example ab10c : contains only letters and numbers abc_DE : contains all the valid characters _:  surprisingly but Yes, underscore is a valid identifier _abc : identifier can start with an underscore Python Invalid Identifiers Example 99 : identifier can’t be only digits 9abc : identifier can’t start with number x+y : the only special character allowed is an underscore for : it’s a reserved keyword How to Tes

Namespaces and grouping in python

Image
 What is namespace? A namespace is a system that has a unique name for each and every thing in Python. An object might be a variable or a system. Python itself maintains a namespace in the figure of a Python wordbook. Let’s go through an illustration, a directory- train system structure in computers. Dispensable to say, that bone can have multiple directories having a train with the same name inside every directory. But one can get directed to the train, one wishes, just by specifying the absolute path to the train. Real- time illustration, the part of a namespace is like a surname. One might not find a single “ Alice” in the class there might be multiple “ Alice” but when you particularly ask for “ Alice Lee” or “ Alice Clark” (with a surname), there will be only one ( time being do n’t suppose of both first name and surname are same for multiple scholars). On analogous lines, the Python practitioner understands what exact system or variable bone is trying to point to in the law, depe