deep-learning

How to do inference with fined-tuned huggingface models?

How to do inference with fined-tuned huggingface models? Question: I have fine-tuned a Huggingface model using the IMDB dataset, and I was able to use the trainer to make predictions on the test set by doing trainer.predict(test_ds_encoded). However, when doing the same thing with the inference set that has a dummy label feature (all -1s …

Total answers: 1

Multi Label Classification – Incorrect training hyperparameters?

Multi Label Classification – Incorrect training hyperparameters? Question: I am working on a multi-label image classification problem, using TensorFlow, Keras and Python 3.9. I have built a dataset containing one .csv file with image names and their respective one-hot encoded labels, like so: I also have an image folder with the associated image files. There …

Total answers: 1

Simple Neural Network Using Pytorch

Simple Neural Network Using Pytorch Question: I want to build Simple Neural Network with pytorch. And I want to teach this network. the network has y = w(weight) * x + b(bias) with w = 3 and b = 0 so I have the data x = [1,2,3,4,5,6] y = [3,6,9,12,15,18] But I have some …

Total answers: 1

TypeError: Input 'y' of 'Mul' Op has type float32 that does not match type int64 of argument 'x'. in computer vision

TypeError: Input 'y' of 'Mul' Op has type float32 that does not match type int64 of argument 'x'. in computer vision Question: I’m working in training my model. so, I do: # create the base pre-trained model base_model = DenseNet121(weights=’/Users/awabe/Desktop/Project/PapilaDB/ClinicalData/DenseNet-BC-121-32-no-top.h5′, include_top=False) x = base_model.output # add a global spatial average pooling layer x = GlobalAveragePooling2D()(x) …

Total answers: 1

Training VGG16 from scratch doesn't improve accuracy in Keras

Training VGG16 from scratch doesn't improve accuracy in Keras Question: I’m trying to train VGG16 models using both transfer learning and training from scratch. I have a dataset with 7k images per category, and 4 different categories. I managed to come up with the transfer learning code no problem, however, the same program but for …

Total answers: 1

In deep learning, can the prediction speed increase as the batch size decreases?

In deep learning, can the prediction speed increase as the batch size decreases? Question: We are developing a prediction model using deepchem’s GCNModel. Model learning and performance verification proceeded without problems, but it was confirmed that a lot of time was spent on prediction. We are trying to predict a total of 1 million data, …

Total answers: 3

How to add dropout layers automatically to a neural network in pytorch

How to add dropout layers automatically to a neural network in pytorch Question: I have a neural network in pytorch and make each layer automatically via the following structure: class FCN(nn.Module): ##Neural Network def __init__(self,layers): super().__init__() #call __init__ from parent class self.activation = nn.Tanh() self.loss_function = nn.MSELoss(reduction =’mean’) ‘Initialise neural network as a list using …

Total answers: 2

Exchange a pooling layer using conv2d layer in keras

Exchange a pooling layer using conv2d layer in keras Question: I have a neural network in keras with two conv2d layers, an average pooling layer and a dense output layer. I want to put the trained model on an FPGA later on and the architecture does not support MaxPooling or AveragePooling layers. However, I read …

Total answers: 1

opencv dnn disable detecting coco dataset for some categories and enable for others

opencv dnn disable detecting coco dataset for some categories and enable for others Question: I am using the code in this repository https://github.com/salar-dev/python-object-detection-opencv but I want to disable detecting the coco dataset for some categories and enable it for others I tryed to delete some of the ssd_mobilenet nodes but the program stopped Asked By: …

Total answers: 1

Usage of torch.scatter() for multi-dimensional value

Usage of torch.scatter() for multi-dimensional value Question: i have a question regarding the usage of the torch.scatter() function. I want to construct a weights matrix weights (# [B, N, V]. B is batch size, N is number of points and V is the number of features for each point. ) Let’s say i have two …

Total answers: 1