<jupyter_start><jupyter_text>Data Owned By Alice<jupyter_code># create our dataset
data = sy.FloatTensor([[0,0],[0,1],[1,0],[1,1]])
target = sy.FloatTensor([[0],[0],[1],[1]])<jupyter_output><empty_output><jupyter_text>Model Owned By Bob<jupyter_code>model = sy.zeros(2,1)<jupyter_output><empty_output><jupyter_text>Alice  Bob Share<jupyter_code>data
# data = data.fix_precision().share(alice, bob)
target = target.fix_precision().share(alice, bob)
model = model.fix_precision().share(alice, bob)<jupyter_output><empty_output><jupyter_text>Train Logic<jupyter_code>for i in range(10):
    pred = data.mm(model)
    grad = pred - target
    update = data.transpose(0,1).mm(grad)

    model = model - update * 0.1
    loss = grad.get().decode().abs().sum()
    print(loss)
    
assert loss < 0.8<jupyter_output>2.0
1.6000000014901161
1.2999999821186066
1.0720000118017197
0.896000012755394
0.7599999904632568
0.6499999910593033
0.5600000023841858
0.4860000051558018
0.4259999953210354
{'fraction_non_alphanumeric': 0.15188583078491336, 'fraction_numerical': 0.17940876656472987, 'mean_word_length': 6.383458646616542, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '364450', 'license': 'Apache-2.0', 'n_tokens_mistral': 506, 'n_tokens_neox': 400, 'n_words': 56, 'path': 'examples/torch/toy/Toy MPC Training Example.ipynb', 'repo_name': 'andreas-hjortgaard/PySyft', 'size': '981'}