<jupyter_start><jupyter_text>Let's Secure now<jupyter_code>import torch as t
import syft as sy
hook = sy.TorchHook(t)
bob = sy.VirtualWorker(hook, id="bob")
alice = sy.VirtualWorker(hook, id="alice")
secure_worker =sy.VirtualWorker(hook, id="secure_worker")
from torch import nn
from torch import optim
import torch.nn.functional as F
encryptedModel = model.fix_precision().share(alice, bob, crypto_provider = secure_worker)
list(encryptedModel.parameters())
test
encryptedTest = test.fix_precision().share(alice, bob, crypto_provider = secure_worker)
encrypytedPrediction = encryptedModel(encryptedTest)
dynamicPrice = encrypytedPrediction.get().float_precision()
round(float(dynamicPrice.numpy()),3)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11491108071135431, 'fraction_numerical': 0.0013679890560875513, 'mean_word_length': 9.027397260273972, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '431709', 'license': 'Apache-2.0', 'n_tokens_mistral': 245, 'n_tokens_neox': 236, 'n_words': 50, 'path': 'Tanish Bhola/PROJECT-01__SmartEV/04_Securing using Encrypted Deep Learning.ipynb', 'repo_name': 'bharatnishant/UdacityOpenSource', 'size': '731'}