原创 數據挖掘幾種常見損失函數

對數損失函數

原创 matplotlib繪製兩個柱狀圖

import matplotlib.pyplot as plt import numpy as np data_2 = [93, 92, 93, 91, 92,93] data_3 = [57,56, 57,56,56.,54]

原创 組卷積(group convolution)的理解

分組是日常生活中一種常見現象,如基於年齡分爲幼年、兒童、青少年、青年、中年和老年等。在機器學習中,聚類算法的本質思想也是分組,即把未知數據基於一些特性分成一個個組,便於人們理解。在深度學習用到組思想的一個地方就是組卷積。 組卷積最早出現是

原创 linux服務器安裝anaconda,然後遠程使用jupyter----windows環境

  linux服務器安裝anaconda: 1.1 下載安裝腳本: wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh 1.2 運行安裝嚮導: ba

原创 Opencv, PIL.Image和TensorFlow對圖像進行resize(縮放)基於Python

一、基於OpenCV的方法 def Resize_Image_cv2(img_name, height, width, method): ''' :param img_name: the name of image

原创 TensorFlow網絡框架模型的保存和加載

在訓練深度學習模型時, 需要對將模型的參數保存,以便以後的需要。以前訓練深度學習模型主要關注網絡的設計,對模型的保存和加載不太注意。最近寫使用TensorFlow寫深度學習框架,覺得有必要詳細瞭解一下。 最簡單的保存和恢復模型的方法是使用

原创 基於TensorFlow的圖像大小調整

import tensorflow as tf def TF_image_Resize(path_to_images, method = 0, height =224, width =224): """ using te

原创 TensorFlow批讀取圖片

# coding:utf-8 from __future__ import print_function import os import tensorflow as tf def TF_image_data(path_to_im

原创 Human Activity Recognition using GRU based on label replication strategy

import tensorflow as tf import numpy as np from sklearn.metrics import classification_report # Load "X" (the neural

原创 Python繪製箱形圖

#coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_fun

原创 使用Python按照索引查找元素

#Search elements in every row using index X = np.random.randint(1,10, [5,6]) print(X) Y = np.array([0,3,2,4,5]) len

原创 Softmax 實現源代碼

import numpy as np from numpy.core._rational_tests import denominator def softmax(x): #implementation one

原创 One-hot編碼Python實現(二)

def dense_to_one_hot(labels_dense, num_classes): """Convert class labels from scalars to one-hot vectors."""

原创 Python實現Complement Entropy Loss 參考 ICLR 2019論文 COMPLEMENT OBJECTIVE TRAINING

import numpy as np def zero_hot(labels_dense, num_classes): """Convert class labels from scalars to one-hot vect

原创 特徵選擇之計算特徵重要性(二):樹森林 (forests of trees)

import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_classification from sklearn.ense