Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model #1

Open
xiaonig opened this issue Nov 16, 2023 · 1 comment
Open

model #1

xiaonig opened this issue Nov 16, 2023 · 1 comment

Comments

@xiaonig
Copy link

xiaonig commented Nov 16, 2023

您好请问有CNN-TCN主模型的代码吗

@TomMakesThings
Copy link
Owner

您好, 虽然我做三个模型在'ECG_Classifier.ipynb', 但是最好的模型是'TimeSeriesClassifier'。看看'Train Arrhythmia Classifier'下面的代码。特别是:

class TimeSeriesClassifier(BaseClassifier):
  def __init__(self, train_samples, train_labels, validation_samples=[], validation_labels=[], ...

...

# Set the model's parameters
model_kwargs = {'learning_rate': 0.001, 'dropout_rate': 0.3, 'architecture': "CNN",
                'tcn': True, 'attention': False, 'batch_norm': True, 'amsgrad': False}

...

arrhythmia_model_data = {}
...
# Otherwise set as the original training data with the arrhythmia class labels
arrhythmia_model_data['train_samples'] = X_train
arrhythmia_model_data['train_labels'] = y_train_new
...
# Otherwise create an arrhythmia classifier without transferring layers
arrhythmia_model = TimeSeriesClassifier(**arrhythmia_model_data, **model_kwargs)
...
 # Train the new model
 arrhythmia_model.train(epochs=200, batch_size=32, save_best=True, file_name=arrhythmia_model_file,
                      log_dir='logs/arrhythmia_fit/')

我两年前写了代码, 希望这回答您的问题!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants