Last active
March 27, 2020 14:29
-
-
Save shshemi/3169b5efe61e20d8c4bae75465bf1c21 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
def ascii_encode(message, sentence_len): | |
sen = np.zeros((1, sentence_len)) | |
for i, a in enumerate(message.encode("ascii")): | |
sen[0, i] = a | |
return sen | |
def ascii_decode(message): | |
return ''.join(chr(int(a)) for a in message[0].argmax(-1)) |
For this code what kind of libraries need to used for this
In Jupiter notebooks
…On Fri, Mar 27, 2020, 15:27 Shayan ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Where it excute the codes
This code is a part of the article "Neural Cryptography" the article could
be found here
<https://towardsdatascience.com/neural-cryptography-7733f18184f3>.
Furthermore, the code for it may be found here
<https://github.com/shshemi/NeuralCryptography>.
I hope you got your answers.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/3169b5efe61e20d8c4bae75465bf1c21#gistcomment-3229440>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMLFTFO25SLTE3B7QJZR4VTRJR2A5ANCNFSM4LUKEC3Q>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where it excute the codes