Change BASES constant to a local variable

This commit is contained in:
coolneng 2021-06-01 18:34:29 +02:00
parent ad49e598db
commit 5ac81c049f
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 2 additions and 6 deletions

View File

@ -1,10 +1,8 @@
from tensorflow.keras import Model, Sequential, layers from tensorflow.keras import Model, Sequential, layers
from tensorflow.keras.regularizers import l2 from tensorflow.keras.regularizers import l2
from preprocessing import BASES
def build_model(hyper_parameters, bases="ACGT") -> Model:
def build_model(hyper_parameters) -> Model:
""" """
Builds the CNN model Builds the CNN model
""" """
@ -41,6 +39,6 @@ def build_model(hyper_parameters) -> Model:
), ),
layers.Dropout(rate=0.3), layers.Dropout(rate=0.3),
# Output layer with softmax activation # Output layer with softmax activation
layers.Dense(units=len(BASES), activation="softmax"), layers.Dense(units=len(bases), activation="softmax"),
] ]
) )

View File

@ -4,8 +4,6 @@ from numpy.random import random
from tensorflow.io import TFRecordWriter from tensorflow.io import TFRecordWriter
from tensorflow.train import BytesList, Example, Feature, Features, FloatList from tensorflow.train import BytesList, Example, Feature, Features, FloatList
BASES = "ACGT"
def generate_example(sequence, weight_matrix): def generate_example(sequence, weight_matrix):
schema = { schema = {