The codes in this following script will be used for the publication of the following work
"Qualify-As-You-Go: Sensor Fusion of Optical and Acoustic Signatures with Contrastive Deep Learning for Multi-Material Composition Monitoring in Laser Powder Bed Fusion Process"
@any reuse of this code should be authorized by the first owner, code author
"""
#libraries to import
importmatplotlib.pyplotasplt
importnumpyasnp
fromprettytableimportPrettyTable
importtorch.nnasnn
importtorch
classPrintLayer(torch.nn.Module):
def__init__(self):
super(PrintLayer,self).__init__()
defforward(self,x):
# Do your print / debug stuff here
print(x.shape)
returnx
classNetwork(nn.Module):
"""
This class represents a network model for multi-material composition monitoring using sensor fusion.
Args:
droupout (float): The dropout rate for the network.
emb_dim (int): The dimension of the output embedding.
Inputs:
x (torch.Tensor): The input tensor of shape (batch_size, 1, 5000).
Returns:
torch.Tensor: The normalized output tensor of shape (batch_size, emb_dim).