Compute the sigmoid function
This commit is contained in:
		
							parent
							
								
									d52fa95328
								
							
						
					
					
						commit
						efe94282b4
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -2,14 +2,14 @@ function g = sigmoid(z) | |||
| %SIGMOID Compute sigmoid functoon | ||||
| %   J = SIGMOID(z) computes the sigmoid of z. | ||||
| 
 | ||||
| % You need to return the following variables correctly  | ||||
| % You need to return the following variables correctly | ||||
| g = zeros(size(z)); | ||||
| 
 | ||||
| % ====================== YOUR CODE HERE ====================== | ||||
| % Instructions: Compute the sigmoid of each value of z (z can be a matrix, | ||||
| %               vector or scalar). | ||||
| 
 | ||||
| 
 | ||||
| g = 1 ./ (1 + exp(-z)); | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Reference in a new issue