Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import numpy as np
import pandas as pd
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from keras.layers import Dense, Input
from keras.models import Model, load_model
#from keras.layers import Dense, Input
#from keras.models import Model, load_model
from skimage.filters import threshold_otsu
from sklearn import utils as skl_utils

Expand Down Expand Up @@ -42,10 +42,13 @@ def build_model(max_epochs, vec_size, alpha, tag_data):
# '''

def autoencoder(vec_input, train):
from keras.layers import Dense, Input
input_dim = Input(shape = (vec_input, ))
encoded1 = Dense(vec_input//2, activation='sigmoid')(input_dim)
encoded2 = Dense(1, activation='sigmoid')(encoded1)

from keras.models import Model

# Decoder Layers
decoded1 = Dense(vec_input//2, activation='tanh')(encoded2)
decoded2 = Dense(vec_input, activation='tanh')(decoded1)
Expand Down Expand Up @@ -170,6 +173,7 @@ def novelty_analysis(df_message, r_id, models_dir, full_train=True):

# Pretrained AE model already exists, directly predict
else:
from keras.models import load_model
threshold = 0
ae = load_model(f'{models_dir}/{r_id}_uniq.h5')
#logger.info('Loaded pretrained AE model for repo')
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ dependencies = [
"slack==0.0.2",
"SQLAlchemy==2.0.22",
"tenacity==8.3.0",
"tensorflow==2.15.0",
"tensorflow==2.15.0; sys_platform == 'linux'",
"tensorflow==2.15.0; sys_platform == 'darwin' and platform_machine == 'x86_64'",
"tensorflow-macos==2.15.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
"textblob==0.15.3",
"textual>=0.73.0",
"tomli>=2.2.1 ; python_full_version < '3.11'",
Expand Down
Loading
Loading