Update References
Browse files- References +66 -1
References
CHANGED
|
@@ -5,4 +5,69 @@ Automatically generated by Colab.
|
|
| 5 |
|
| 6 |
Original file is located at
|
| 7 |
https://colab.research.google.com/drive/1n4ADxn-u0nAkYm6mKMzzhiH1vl97qImr
|
| 8 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
Original file is located at
|
| 7 |
https://colab.research.google.com/drive/1n4ADxn-u0nAkYm6mKMzzhiH1vl97qImr
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
import torch
|
| 11 |
+
import torch.nn as nn
|
| 12 |
+
import torch.optim as optim
|
| 13 |
+
import matplotlib.pyplot as plt
|
| 14 |
+
|
| 15 |
+
wealth_distribution = torch.randn(32, 24, 1)
|
| 16 |
+
target_direction = torch.randn(32, 24, 1)
|
| 17 |
+
|
| 18 |
+
class WealthTransferModelWithVPN(nn.Module):
|
| 19 |
+
def __init__(self, input_size, hidden_size, lstm_hidden_size, output_size, vpn_size):
|
| 20 |
+
super(WealthTransferModelWithVPN, self).__init__()
|
| 21 |
+
self.fc1 = nn.Linear(input_size, hidden_size)
|
| 22 |
+
self.relu = nn.ReLU()
|
| 23 |
+
|
| 24 |
+
self.lstm = nn.LSTM(hidden_size, lstm_hidden_size, batch_first=True)
|
| 25 |
+
|
| 26 |
+
self.fc2 = nn.Linear(lstm_hidden_size, output_size)
|
| 27 |
+
|
| 28 |
+
self.vpn_layer = nn.Linear(output_size, vpn_size)
|
| 29 |
+
self.decrypt_layer = nn.Linear(vpn_size, output_size)
|
| 30 |
+
|
| 31 |
+
def forward(self, x, target):
|
| 32 |
+
x = torch.cat((x, target), dim=1)
|
| 33 |
+
|
| 34 |
+
x = self.relu(self.fc1(x))
|
| 35 |
+
|
| 36 |
+
x, _ = self.lstm(x)
|
| 37 |
+
|
| 38 |
+
x = self.fc2(x)
|
| 39 |
+
|
| 40 |
+
encrypted_output = torch.sigmoid(self.vpn_layer(x))
|
| 41 |
+
|
| 42 |
+
decrypted_output = self.decrypt_layer(encrypted_output)
|
| 43 |
+
|
| 44 |
+
return decrypted_output
|
| 45 |
+
|
| 46 |
+
input_size = wealth_distribution[-1] + target_direction.shape[-1]
|
| 47 |
+
hidden_size = 64
|
| 48 |
+
lstm_hidden_size = 32
|
| 49 |
+
output_size = wealth_distribution.shape[-1]
|
| 50 |
+
vpn_size = 128
|
| 51 |
+
|
| 52 |
+
model = WealthTransferWithVPN(input_size, hidden_sizse, lstm_hidden_size, vpn_size)
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
with torch.no_grad():
|
| 56 |
+
output_signal = model(wealth_distribution, target_direction)
|
| 57 |
+
|
| 58 |
+
wealth_waveform = output_signal[0].squeeze().numpy()
|
| 59 |
+
|
| 60 |
+
hours = list(range(24))
|
| 61 |
+
|
| 62 |
+
plt.figure(figsize=(10, 5))
|
| 63 |
+
plt.plot(hours, wealth_waveform, label='Wealth Transfer Signal over 24 hours', marker='o')
|
| 64 |
+
plt.title('Wealth Transfer Signal in 24-Hour Intervals')
|
| 65 |
+
plt.xlabel('Hour of the Day')
|
| 66 |
+
plt.ylabel('Wealth Signal Intensity')
|
| 67 |
+
plt.xticks(hours)
|
| 68 |
+
plt.grid(True)
|
| 69 |
+
plt.legend()
|
| 70 |
+
plt.show()
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
|