Created
June 13, 2013 14:17
-
-
Save satojkovic/5774024 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
from math import * | |
import sys | |
def sigmoid(x): | |
return (1 / (1+exp(-x))) | |
def main(): | |
argvs = sys.argv | |
argc = len(argvs) | |
if argc != 2: | |
print 'Usage: python %s <parameter for sigmoid function>' % argvs[0] | |
quit() | |
x = int(argvs[1]) | |
y = sigmoid(x) | |
print 'sigmoid(%d) = %f' %(x, y) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment