training-data

Simple neural network gives wrong output after training

前提是你 提交于 2020-04-18 06:10:17
问题 I've been working on a simple neural network. It takes in a data set with 3 columns, if the first column's value is a 1, then the output should be a 1. I've provided comments so it is easier to follow. Code is as follows: import numpy as np import random def sigmoid_derivative(x): return x * (1 - x) def sigmoid(x): return 1 / (1 + np.exp(-x)) def think(weights, inputs): sum = (weights[0] * inputs[0]) + (weights[1] * inputs[1]) + (weights[2] * inputs[2]) return sigmoid(sum) if __name__ == "_

how important is the loss difference between training and validation data at the beginning when training a neuronal network?

只愿长相守 提交于 2020-03-25 15:49:49
问题 Short question: Is the difference between validation and training loss at the beginning of the training (first epochs) a good indicator for the amount of data that should be used? E.g would it be a good method to increase the amount of data until the difference at the beginning is as small as possible? It would save me time and computation. backround: I am working on a neuronal network that overfits very fast. The best result after applying many different techniques like dropouts, batch

Run trained Machine Learning model on a different dataset

…衆ロ難τιáo~ 提交于 2020-02-24 20:22:41
问题 I am new to Machine Learning and am in the process of trying to run a simple classification model that I trained and saved using pickle, on another dataset of the same format. I have the following python code. Code #Training set features = pd.read_csv('../Data/Train_sop_Computed.csv') #Testing set testFeatures = pd.read_csv('../Data/Test_sop_Computed.csv') print(colored('\nThe shape of our features is:','green'), features.shape) print(colored('\nThe shape of our Test features is:','green'),

Run trained Machine Learning model on a different dataset

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-24 20:20:18
问题 I am new to Machine Learning and am in the process of trying to run a simple classification model that I trained and saved using pickle, on another dataset of the same format. I have the following python code. Code #Training set features = pd.read_csv('../Data/Train_sop_Computed.csv') #Testing set testFeatures = pd.read_csv('../Data/Test_sop_Computed.csv') print(colored('\nThe shape of our features is:','green'), features.shape) print(colored('\nThe shape of our Test features is:','green'),

How to generate a tiff/box file from an image to train Tesseract in Windows

可紊 提交于 2020-02-01 19:57:27
问题 I'm trying to train Tesseract in Windows and for that I need a pair tiff/box file and I'm trying to create it using jTessBoxEditor but it doesn't accept images as input. I've also tried boxFactory but it doesn't run properly. Does anyone know what is the best tool to create the pair from images? Thanks 回答1: If you have jTessBoxEditor, then you have Tesseract bin files. Go to the tesseract-ocr subfolder of jTessBoxEditor and run the following command : tesseract.exe D:\testocr\TestImage.tif D:

How to handle different queue batch size and feed value batch size in tensorflow?

China☆狼群 提交于 2020-01-25 03:13:07
问题 My code used to work on tensorflow 0.6, but it no longer works on the lastest tensorflow. I would like to perform inference every few training iterations. My training data is pulled from a queue, my inference data is from feed_dict. The training batch size is 128 while the inference batch size is 1. What Should I do to make the network accept the two different batch sizes? batch_size = 128 x_batch = tf.placeholder("float", [None, 100]) q = tf.FIFOQueue(10, [tf.float32], shapes=[[batch_size,

Leave one out crossvalind in Matlab

十年热恋 提交于 2020-01-25 01:27:09
问题 I have extracted HOG features for male and female pictures, now, I'm trying to use the Leave-one-out-method to classify my data. Due the standard way to write it in Matlab is: [Train, Test] = crossvalind('LeaveMOut', N, M); What I should write instead of N and M ? Also, should I write above code statement inside or outside a loop? this is my code, where I have training folder for Male (80 images) and female (80 images), and another one for testing (10 random images). for i = 1:10 [Train, Test

Difference between Keras model.fit using only batch_size and using only steps_per_epoch

不羁的心 提交于 2020-01-15 06:41:29
问题 When I run model.fit using both batch_size and steps_per_epoch parameters I receive the following error: ValueError: If steps_per_epoch is set, the `batch_size` must be None. So, from this error and from the following piece of documentation from keras Model(functional API) batch_size: Integer or None. Number of samples per gradient update. If unspecified, batch_size will default to 32. steps_per_epoch: Integer or None. Total number of steps (batches of samples) before declaring one epoch

Difference between Keras model.fit using only batch_size and using only steps_per_epoch

China☆狼群 提交于 2020-01-15 06:41:07
问题 When I run model.fit using both batch_size and steps_per_epoch parameters I receive the following error: ValueError: If steps_per_epoch is set, the `batch_size` must be None. So, from this error and from the following piece of documentation from keras Model(functional API) batch_size: Integer or None. Number of samples per gradient update. If unspecified, batch_size will default to 32. steps_per_epoch: Integer or None. Total number of steps (batches of samples) before declaring one epoch

OpenCV SVM train_auto Insufficient Memory

爱⌒轻易说出口 提交于 2020-01-13 19:34:15
问题 This is my first post here so I hope to be able to ask my question properly :-) I want to do "elephant detection" by classifying color samples (I was inspired by this paper). This is the pipeline of my "solution" until the training of the classifier: Loading a set of 4 training images (all containing an elephant), and then splitting them in two images: one containing the environment surrounding the elephant (the "background"), and one containing the elephant (the "foreground"); Mean shift