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.regularizers import l2
from preprocessing import BASES
def build_model(hyper_parameters) -> Model:
def build_model(hyper_parameters, bases="ACGT") -> Model:
"""
Builds the CNN model
"""
@ -41,6 +39,6 @@ def build_model(hyper_parameters) -> Model:
),
layers.Dropout(rate=0.3),
# 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.train import BytesList, Example, Feature, Features, FloatList
BASES = "ACGT"
def generate_example(sequence, weight_matrix):
schema = {