<commit_before>[![Build Status](https://travis-ci.org/amartya18x/easyGrad.svg?branch=master)](https://travis-ci.org/amartya18x/easyGrad)
# Easy Grad

This library aims to provide an easy implementation of doing symbolic operations in python

## Testing

```Python
def gradTestSimple():  
    a = Integer("a")  
    b = Integer("b")  
    c = a + b  
    d = b + 6  
    e = c * d  
    graph = GradGraph(e)  
    graph.getOutput({a: 32,  
                     b: 11})  
    graph.getGradients(wrt=b)  
    print a.gradient, b.gradient  
```
### Here is a more complex example.
```Python
def gradTest():  
    x = Integer("Int1x")  <commit_msg>Modify readme<commit_after>[![Build Status](https://travis-ci.org/amartya18x/easyGrad.svg?branch=master)](https://travis-ci.org/amartya18x/easyGrad)
# Easy Grad

This library aims to provide an easy implementation of doing symbolic operations in python
## Operators allowed

- *exp(x)* and *log(x)*
```Python
def testOps():
    x = Integer('x')
    y = ops.log(x)
    z = ops.exp(y)
    graph = GradGraph(z)
    graph.getOutput({x: 1})
    graph.getGradients(wrt=x)
    print x.gradient
```
- *Sigmoid(x)*
```Python

def activ_fns():
    x = Double('x')
    z = ops.sigmoid(x)
    graph = GradGraph(z)
    graph.getOutput({x: 110.5})
    graph.getGradients(wrt=x)
    print x.gradient
```
- *Tanh(x)*
```Python

def activ_fns():
    x = Double('x')
    z = ops.tanh(x)
    graph = GradGraph(z)
    graph.getOutput({x: 110.5})
    graph.getGradients(wrt=x)
    print x.gradient
```

## Testing

```Python
def gradTestSimple():  
    a = Integer("a")  
    b = Integer("b")  
    c = a + b  
    d = b + 6  
    e = c * d  
    graph = GradGraph(e)  
    graph.getOutput({a: 32,  
                     b: 11})  
    graph.getGradients(wrt=b)  
    print a.gradient, b.gradient  
```
### Here is a more complex example.
```Python
def gradTest():  
    x = Integer("Int1x")  
{'fraction_non_alphanumeric': 0.15830721003134796, 'fraction_numerical': 0.015151515151515152, 'mean_word_length': 2.6756238003838773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6450419', 'n_tokens_mistral': 758, 'n_tokens_neox': 699, 'n_words': 164}