def analyses_classes(X, noOfTrainData, noOfExamples): train_T_indices = [x for x in range(0, noOfTrainData, noOfExamples)] for i in range(0, len(train_T_indices)): print('i = {}'.format(i)) if i == 0: this_class=X[0:train_T_indices[1]] else: this_class=X[train_T_indices[i - 1]:train_T_indices[i]] code.min_hamming_distance(this_class) distances = all_hamming_distances(this_class) print('Mean Hamming distance for class {} is {}'.format(i,np.mean(distances))) print('Std of Hamming distance for class {} is {}'.format(i, np.std(sum(this_class)))) print('Mean no. of activiations per class {}'.format(np.mean(sum(this_class)))) print('Example vector weight per class {}'.format(sum(this_class[0]))) return
n = n + 1 # at the moment, we are not doing validation: XTrain = X TTrain = T allInputData = X ############################################################# # get some input stats ############################################################# if verbose == True: # temp=code.min_hamming_distance(T) # print('Input code: This is a [{0}, {1}, {2}] code'.format(noOfInputs, sizeOfInput, temp)) # print("min Hamming distance: %i" % temp) # weights = code.weight(T, verbose=True) temp = code.min_hamming_distance(t) print('Output code: This is a [{0}, {1}, {2}] code'.format( noOfOutputs, sizeOfOutput, temp)) print("Outputmin Hamming distance: %i" % temp) weights = code.weight(t, verbose=True) temp2 = code.min_hamming_distance(XTrain) print('Input code: This is a [{0}, {1}, {2}] code'.format( noOfTrainData, lenOfInput, temp2)) print("Input min Hamming distance: %i" % temp2) # N.B. for the analysis scripts np.save("allInputDataCurrent", X) np.save("allOutputDataCurrent", T) # N.B. we are just using this to get intel on the input dataset = np.append(X, T, axis=1)