Example #1
0
 def __init__(self, n_antenna, n_beam):
     super(Channel_Encoder, self).__init__()
     self.analog_codebook = PhaseShifter(in_features=2*n_antenna, out_features=n_beam, scale=np.sqrt(n_antenna))
     self.dense_1 = nn.Linear(in_features = n_beam*2, out_features = n_beam*2)
     self.dense_2 = nn.Linear(in_features = n_beam*2, out_features = n_beam*2)
     self.relu = nn.ReLU()
     self.compute_power = ComputePower(2*n_beam)
Example #2
0
 def __init__(self, n_antenna, n_beam):
     super(Node, self).__init__()
     self.analog_codebook = PhaseShifter(in_features=2 * n_antenna,
                                         out_features=n_beam,
                                         scale=np.sqrt(n_antenna))
     self.n_antenna = n_antenna
     self.n_beam = n_beam
     self.compute_power = ComputePower(2 * n_beam)
     self.parent = None
     self.child = None
Example #3
0
 def __init__(self, n_antenna, n_beam):
     super(Node, self).__init__()
     self.analog_codebook = PhaseShifter(in_features=2*n_antenna, out_features=n_beam, scale=np.sqrt(n_antenna))
     self.n_antenna = n_antenna
     self.n_beam = n_beam
     self.compute_power = ComputePower(2*n_beam)
     self.dense_1 = nn.Linear(in_features = n_beam, out_features = n_beam)
     self.relu = nn.ReLU()
     self.softmax = nn.Softmax(dim=1)
     self.parent = None
     self.child = None
Example #4
0
 def __init__(self, n_antenna, azimuths, idx):
     super(Leaf, self).__init__()
     self.analog_codebook = DFT_Codebook_Layer(n_antenna=n_antenna,
                                               azimuths=azimuths)
     self.n_beam = len(azimuths)
     self.azimuths = azimuths
     self.n_antenna = n_antenna
     self.idx = idx
     self.compute_power = ComputePower(2 * self.n_beam)
     self.softmax = nn.Softmax(dim=1)
     self.parent = None
     self.child = None
Example #5
0
 def __init__(self, n_antenna, n_wide_beam, n_narrow_beam, trainable_codebook = True, theta = None):
     super(Beam_Classifier, self).__init__()
     self.trainable_codebook = trainable_codebook
     self.n_antenna = n_antenna
     self.n_wide_beam = n_wide_beam
     self.n_narrow_beam = n_narrow_beam
     if trainable_codebook:
         self.codebook = PhaseShifter(in_features=2*n_antenna, out_features=n_wide_beam, scale=np.sqrt(n_antenna), theta=theta)
     else:
         dft_codebook = DFT_codebook_blockmatrix(n_antenna=n_antenna, nseg=n_wide_beam)
         self.codebook = torch.from_numpy(dft_codebook).float()
         self.codebook.requires_grad = False
     self.compute_power = ComputePower(2*n_wide_beam)
     self.relu = nn.ReLU()
     self.dense1 = nn.Linear(in_features=n_wide_beam, out_features=2*n_wide_beam)
     self.dense2 = nn.Linear(in_features=2*n_wide_beam, out_features=3*n_wide_beam)
     self.dense3 = nn.Linear(in_features=3*n_wide_beam, out_features=n_narrow_beam)
     self.softmax = nn.Softmax()
Example #6
0
 def __init__(self, n_antenna = 64, n_beam = 64, theta = None):
     super(AnalogBeamformer, self).__init__()
     self.codebook = PhaseShifter(in_features=2*n_antenna, out_features=n_beam, scale=np.sqrt(n_antenna), theta = theta)
     self.beam_selection = PowerPooling(2*n_beam)
     self.compute_power = ComputePower(2*n_beam)
Example #7
0
 def __init__(self, n_antenna, n_beam):
     super(Self_Supervised_AnalogBeamformer, self).__init__()
     self.codebook = PhaseShifter(in_features=2*n_antenna, out_features=n_beam, scale=np.sqrt(n_antenna))
     self.compute_power = ComputePower(2*n_beam)