Package: pyadbcxy
Welcome to PyADBCXYPyADBCXY is an automatic differentiation software package that can calculate the values and derivatives of complex functions while maintaining high levels of accuracy.ContributorsGroup Name: cs107-BCXYGroup Number: 12Group Members:Charlie Harrington, Harvard University,charlesharrington@g.harvard.eduBowen Zhu, Harvard University,bszhu@fas.hardvard.eduYaxin Lei, Harvard University,yaxin_lei@g.harvard.eduXiang Bai, Harvard University,xbai@hsph.harvard.eduInstallationInstall the package with pip:pip install pyadbcxyThen you can run a simple example such asimportpyadbcxyasadx=ad.Variable(3)# instantiate x variabley=ad.Variable(4.,5.)# instantiate y variablef=lambdax,y:x+y# define function of interestfmode=ad.Forward(f,(x,y))# instantiate forward modefmode.calculate()# evaluate function at x and yprint(fmode.value)# print value of f at x and yprint(fmode.derivative)# print derivative of f and x and yFor further details on package usage as well as the math behind it, please see thedocumentation.For developersTo install the package for further development, clone the repository to your machine:git clone https://github.com/cs107-BCXY/cs107-FinalProject.gitThen, move into the repository and install the package dependenciescd cs107-FinalProject
pip install -r requirements.txtTestingTo run the tests, you can executepython -m unittest discover -s tests -p 'test_*.py'Alternatively, you can run the test driver script. The default testing framework isunittestand can be run with:bash tests/run_tests.shIf you'd like to execute the tests usingpytest, simply specify in the command:bash tests/run_tests.sh pytestFinally, if you'd like to see the code coverage report, you can do so with thecoveragekeyword:bash tests/run_tests.sh coverageLicenseThis project is licensed under the MIT License - see theLICENSEfor more details.Broader Impact and Inclusivity StatementWe strove to create a convenient way to automatically differentiate smoothly and accurately. The automatic differentiation package is able to efficiently compute the derivatives of functions of any numerical inputs granted they are mathematically valid in the constraints of functions, including integers, floats, single and multiple variables. Traditionally in finite differentiation, users need to select an epsilon value for the algorithm that calculates the difference of slope. The choice of epsilon will impact the accuracy of the derivative especially since computationally the rounding error may be a specific problem. Our package eliminates this process for users by adopting autodifferentation method.While automatic differentiation is proven to be powerful in calculating accurate derivatives, such function does not prevail in common machine learning packages. In neural networks and regression based models, gradient descent is widely used to find the optimal parameters. Automatic differentiation assists this process so that any differentiation, even when the algebraic form is hard to compute, can be done easily. This broadens the range of models one can choose from without concerning the complexity of their derivatives. If used responsibly, the benefit of a wider range of models and increasing accuracy can be broadcast to many fields including public health and medicine, where models are rather complicated.We strongly believe in the importance of inclusivity of our package. We worked to ensure that our package is accessible to all and is licensed as such. We ensured proper documentation and simple and straightforward usage instruction that is easy to follow. The creation of this package was conducted through teamwork where every member was respected and represented, and contributed to the outcome. The coding process was discussed among members of the team as well as researched online through open source.Our purpose in this development was to at once enrichment or own understanding of the mathematical and programming grounds of a commonly used and powerful tool as well as provide a basis for others to refer to and build upon. We discourage any illegal and unethical use of our package in projects that harm a particular group based on attributes including (but not limited to) age, culture, ethnicity, gender identity or expression, national origin, physical or mental difference, politics, race, religion, sex, sexual orientation, socio-economic status, and subculture.