# -*- coding: utf-8 -*-
# read the data of npy,the data is input(label)
import os
import numpy as np
import tensorflow as tf
import time
import math
batch_size = 128
path =os.getcwd()
keep_prob = tf.placeholder(tf.float32)
# In order to get the suitable type of data and label
def initial_data(all_data,all_label): #data and label are all the name of .npy
Data_Examples = np.load(path+'/'+ all_data) # all_data = .npy
Data_Labels = np.load(path+'/'+ all_label)
Data_Labels = tf.one_hot(Data_Labels,2,1,0)
Data_Labels = tf.to_float(Data_Labels,name = 'Data_Labels')
return Data_Examples,Data_Labels
def get_batch_data(t_enh,t_enh_label,t_pro,t_pro_label):
t_enh = tf.cast(t_enh, tf.float32)
t_enh_label = tf.cast(t_enh_label, tf.float32)
t_pro = tf.cast(t_pro, tf.float32)
&nb
用CNN与RNN(LSTM)提取DNA序列中的特征的定义函数
最新推荐文章于 2024-07-12 11:12:53 发布
该博客介绍了如何运用卷积神经网络(CNN)和长短期记忆网络(RNN/LSTM)来处理和提取DNA序列中的特征。内容涵盖了数据的读取以及CNN和RNN的整合应用,但未详细展开全连接层和评估指标的计算过程。

最低0.47元/天 解锁文章
1566

被折叠的 条评论
为什么被折叠?



