ptrblck:

model = DenoisingAutoencoder(10, 10)
out = model(torch.randn(1, 10))

Could you post the code snippet where you are initializing the model and which input shape you are using?
If you are passing numpy arrays as the input, make sure to transform them to PyTorch tensors via torch.from_numpy .


this is the code to train data:
“”"
X_train, y_train = load_data(root_folder_train)
X_test, y_test = load_data(root_folder_test)
in_features = 512
out_features = 256
X_train= torch.Tensor(X_train)
X_test=torch.Tensor(X_test)
sdae = StackedDAE(input_dim=512, z_dim=10, binary=True,
    encodeLayer=[256,100,10], decodeLayer=[10,100,256], activation="relu",
    dropout=0)
sdae.pretrain(X_train,X_test, lr=args.lr, batch_size=args.batch_size,
              num_epochs=args.pretrainepochs, corrupt=0.3, loss_type="cross-entropy")
sdae.save_model("model/sdae.pt")
sdae.fit(X_train,X_test, lr=args.lr, num_epochs=args.epochs, corrupt=0.3, loss_type="cross-entropy")

“”""