forked from sidhomj/DeepTCR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSupervised_Documentation.txt
737 lines (731 loc) · 32.5 KB
/
Supervised_Documentation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
Help on module DeepTCR_S:
NAME
DeepTCR_S
CLASSES
builtins.object
DeepTCR_S
class DeepTCR_S(builtins.object)
| Methods defined here:
|
| AUC_Curve(self, show_all=True, filename='AUC.tif', title=None)
| AUC Curve for both Single Sequence and Whole File Models
|
| Inputs
| ---------------------------------------
| show_all: bool
| In the case there is only two classes, the method defaults
| to producing an curve for only one class. If one desires
| to see curves for all classes, set to True.
|
| filename: str
| Filename to save tif file of AUC curve.
|
| title: str
| Optional Title to put on ROC Curve.
|
| Returns
| ---------------------------------------
|
| Condition_Kernels(self, kernel=3, sample_batch_size=50, motif_batch_size=1000, top_kernels=10, weight_by_freq=False, sample=None)
| DEPRECATED
| --------------------------------------
| Condition Kernels with differentially used motifs.
|
| This method determines in a brute-force heuristic which k-mers are differentially used in each cohort prior to
| training the classifier. This is particularly useful in the case for low-frequency motifs that may be difficult to
| find with gradient descent.
|
| Inputs
| ---------------------------------------
| kernel: int
| Size of convolutional kernel.
|
| sample_batch_size: int
| Size of sample batch to pass through network for inference.
|
| motif_batch_size: int
| Size of motif batch to pass through the network for inference.
|
| top_kernels: int
| Number of kernels to select per class to condition.
|
| weight_by_freq: bool
| Whether to use the frequency to determine enriched motifs.
|
| sample: int
| Number of motifs to sample to query for differential usage. For computationally more tractable results with
| high length kernels, it is best to sample some number of motifs to query.
|
|
| Returns
| ---------------------------------------
|
| Get_Data_SS(self, directory, Load_Prev_Data=False, classes=None, save_data=True, type_of_data_cut='Fraction_Response', data_cut=1.0, n_jobs=40, aa_column_alpha=None, aa_column_beta=None, count_column=None, sep='\t', aggregate_by_aa=True)
| Get Data for Single Sequence Classification.
|
| Parse Data into appropriate inputs for neural network.
|
| Inputs
| ---------------------------------------
| directory: str
| Path to directory with folders with tsv files are present
| for analysis. Folders names become labels for files within them.
|
| Load_Prev_Data: bool
| Loads Previous Data.
|
| classes: list
| Optional selection of input of which sub-directories to use for analysis.
|
| save_data: bool
| Whether to save data to pickle file for later use.
|
| type_of_data_cut: str
| Method by which one wants to sample from the TCRSeq File.
|
| Options are:
| Fraction_Response: A fraction (0 - 1) that samples the top fraction of the file by reads. For example,
| if one wants to sample the top 25% of reads, one would use this threshold with a data_cut = 0.25. The idea
| of this sampling is akin to sampling a fraction of cells from the file.
|
| Frequency_Cut: If one wants to select clones above a given frequency threshold, one would use this threshold.
| For example, if one wanted to only use clones about 1%, one would enter a data_cut value of 0.01.
|
| Num_Seq: If one wants to take the top N number of clones, one would use this threshold. For example,
| if one wanted to select the top 10 amino acid clones from each file, they would enter a data_cut value of 10.
|
| Read_Cut: If one wants to take amino acid clones with at least a certain number of reads, one would use
| this threshold. For example, if one wanted to only use clones with at least 10 reads,they would enter a data_cut value of 10.
|
| Read_Sum: IF one wants to take a given number of reads from each file, one would use this threshold. For example,
| if one wants to use the sequences comprising the top 100 reads of hte file, they would enter a data_cut value of 100.
|
| data_cut: float or int
| Value associated with type_of_data_cut parameter.
|
| n_jobs: int
| Number of processes to use for parallelized operations.
|
| aa_column_alpha: int
| Column where alpha chain amino acid data is stored. (0-indexed)
|
| aa_column_beta: int
| Column where beta chain amino acid data is stored.(0-indexed)
|
| If both column integers are left to None, column with a header containing 'acid' is used as
| the amino acid column.
|
| count_column: int
| Column where counts are stored. If set to None, first column with data in integer datatype is used as the
| counts column.
|
| sep: str
| Type of delimiter used in file with TCRSeq data.
|
| aggregate_by_aa: bool
| Choose to aggregate sequences by unique amino-acid. Defaults to True. If set to False, will allow duplicates
| of the same amino acid sequence given it comes from different nucleotide clones.
|
| Returns
| ---------------------------------------
|
| Get_Data_WF(self, directory, Load_Prev_Data=False, classes=None, save_data=True, type_of_data_cut='Fraction_Response', data_cut=1.0, n_jobs=40, aa_column_alpha=None, aa_column_beta=None, count_column=None, sep='\t', aggregate_by_aa=True)
| Get Data for Whole Sample Classification.
|
| Parse Data into appropriate inputs for neural network.
|
|
| Inputs
| ---------------------------------------
| directory: str
| Path to directory with folders with tsv files are present
| for analysis. Folders names become labels for files within them.
|
| Load_Prev_Data: bool
| Loads Previous Data.
|
| classes: list
| Optional selection of input of which sub-directories to use for analysis.
|
| save_data: bool
| Whether to save data to pickle file for later use.
|
| type_of_data_cut: str
| Method by which one wants to sample from the TCRSeq File.
|
| Options are:
| Fraction_Response: A fraction (0 - 1) that samples the top fraction of the file by reads. For example,
| if one wants to sample the top 25% of reads, one would use this threshold with a data_cut = 0.25. The idea
| of this sampling is akin to sampling a fraction of cells from the file.
|
| Frequency_Cut: If one wants to select clones above a given frequency threshold, one would use this threshold.
| For example, if one wanted to only use clones about 1%, one would enter a data_cut value of 0.01.
|
| Num_Seq: If one wants to take the top N number of clones, one would use this threshold. For example,
| if one wanted to select the top 10 amino acid clones from each file, they would enter a data_cut value of 10.
|
| Read_Cut: If one wants to take amino acid clones with at least a certain number of reads, one would use
| this threshold. For example, if one wanted to only use clones with at least 10 reads,they would enter a data_cut value of 10.
|
| Read_Sum: IF one wants to take a given number of reads from each file, one would use this threshold. For example,
| if one wants to use the sequences comprising the top 100 reads of hte file, they would enter a data_cut value of 100.
|
| data_cut: float or int
| Value associated with type_of_data_cut parameter.
|
| n_jobs: int
| Number of processes to use for parallelized operations.
|
| aa_column_alpha: int
| Column where alpha chain amino acid data is stored. (0-indexed)
|
| aa_column_beta: int
| Column where beta chain amino acid data is stored.(0-indexed)
|
| If both column integers are left to None, column with a header containing 'acid' is used as
| the amino acid column.
|
| count_column: int
| Column where counts are stored. If set to None, first column with data in integer datatype is used as the
| counts column.
|
| sep: str
| Type of delimiter used in file with TCRSeq data
|
| aggregate_by_aa: bool
| Choose to aggregate sequences by unique amino-acid. Defaults to True. If set to False, will allow duplicates
| of the same amino acid sequence given it comes from different nucleotide clones.
|
|
| Returns
| ---------------------------------------
|
| Get_Train_Valid_Test_SS(self, test_size=0.2, LOO=None)
| Train/Valid/Test Splits.
|
| Divide data for train, valid, test set. Training is used to
| train model parameters, validation is used to set early stopping,
| and test acts as blackbox independent test set.
|
| Inputs
| ---------------------------------------
| test_size: float
| Fraction of sample to be used for valid and test set.
|
| LOO: int
| Number of sequences to leave-out in Leave-One-Out Cross-Validation
|
| Returns
| ---------------------------------------
|
| Get_Train_Valid_Test_WF(self, test_size=0.2, LOO=None)
| Train/Valid/Test Splits.
|
| Divide data for train, valid, test set. Training is used to
| train model parameters, validation is used to set early stopping,
| and test acts as blackbox independent test set. In the case that
| Leave-One-Out (LOO) is set to a value, the valid and test sets
| have the same data and early stopping is based on the training loss.
|
| Inputs
| ---------------------------------------
| test_size: float
| Fraction of sample to be used for valid and test set.
|
| LOO: int
| Number of samples to leave-out in Leave-One-Out Cross-Validation
|
| Returns
| ---------------------------------------
|
| K_Fold_CrossVal_SS(self, folds=None, epochs_min=10, batch_size=1000, stop_criterion=0.001, kernel=5, units=12, trainable_embedding=True, weight_by_class=False, num_fc_layers=0, units_fc=12, drop_out_rate=0.0, suppress_output=False, iterations=None)
| K_Fold Cross-Validation for Single-Sequence Classifier
|
| If the number of sequences is small but training the single-sequence classifier, one
| can use K_Fold Cross Validation to train on all but one before assessing
| predictive performance.After this method is run, the AUC_Curve method can be run to
| assess the overall performance.
|
| Inputs
| ---------------------------------------
|
| folds: int
| Number of Folds
|
| epochs_min: int
| Minimum number of epochs for training neural network.
|
| batch_size: int
| Size of batch to be used for each training iteration of the net.
|
| stop_criterion: float
| Minimum percent decrease in determined interval (below) to continue
| training. Used as early stopping criterion.
|
| kernel: int
| Size of convolutional kernel.
|
| units: int
| Number of filters to be used for convolutional kernel.
|
| trainable_embedding; bool
| Toggle to control whether a trainable embedding layer is used or native
| one-hot representation for convolutional layers.
|
| num_fc_layers: int
| Number of fully connected layers following convolutional layer.
|
| units_fc: int
| Number of nodes per fully-connected layers following convolutional layer.
|
| drop_out_rate: float
| drop out rate for fully connected layers
|
| suppress_output: bool
| To suppress command line output with training statisitcs, set to True.
|
| iterations: int
| Option to specify how many iterations one wants to complete before
| terminating training. Useful for very large datasets.
|
|
| Returns
| ---------------------------------------
|
| K_Fold_CrossVal_WF(self, folds=None, epochs_min=5, batch_size=25, stop_criterion=0.001, kernel=5, units=12, weight_by_class=False, iterations=None, trainable_embedding=True, accuracy_min=None, weight_by_freq=True, plot_loss=False, num_fc_layers=0, units_fc=12, drop_out_rate=0.0, suppress_output=False)
| K_Fold Cross-Validation for Whole Sample Classifier
|
| If the number of samples is small but training the whole sample classifier, one
| can use K_Fold Cross Validation to train on all but one before assessing
| predictive performance.After this method is run, the AUC_Curve method can be run to
| assess the overall performance.
|
| Inputs
| ---------------------------------------
| folds: int
| Number of Folds
|
| batch_size: int
| Size of batch to be used for each training iteration of the net.
|
| epochs_min: int
| Minimum number of epochs for training neural network.
|
| stop_criterion: float
| Minimum percent decrease in determined interval (below) to continue
| training. Used as early stopping criterion.
|
| kernel: int
| Size of convolutional kernel.
|
| units: int
| Number of filters to be used for convolutional kernel.
|
| weight_by_class: bool
| Option to weight loss by the inverse of the class frequency. Useful for
| unbalanced classes.
|
| iterations: int
| Option to specify how many iterations one wants to complete before
| terminating training. Useful for very large datasets.
|
| trainable_embedding; bool
| Toggle to control whether a trainable embedding layer is used or native
| one-hot representation for convolutional layers.
|
| accuracy_min: float
| Optional parameter to allow alternative training strategy until minimum
| training accuracy is achieved, at which point, training ceases.
|
|
| weight_by_freq: bool
| Whether to use frequency to weight each sequence's features.
|
| plot_loss: bool
| To live plot the train/valid/test losses, set to True.
|
| num_fc_layers: int
| Number of fully connected layers following convolutional layer.
|
| units_fc: int
| Number of nodes per fully-connected layers following convolutional layer.
|
| drop_out_rate: float
| drop out rate for fully connected layers
|
| suppress_output: bool
| To suppress command line output with training statisitcs, set to True.
|
|
| Returns
| ---------------------------------------
|
| Monte_Carlo_CrossVal_SS(self, fold=5, test_size=0.25, LOO=None, epochs_min=10, batch_size=1000, stop_criterion=0.001, kernel=5, units=12, trainable_embedding=True, weight_by_class=False, num_fc_layers=0, units_fc=12, drop_out_rate=0.0, suppress_output=False)
| Monte Carlo Cross-Validation for Single-Sequence Classifier
|
| If the number of sequences is small but training the single-sequence classifier, one
| can use Monte Carlo Cross Validation to train a number of iterations before assessing
| predictive performance.After this method is run, the AUC_Curve method can be run to
| assess the overall performance.
|
| Inputs
| ---------------------------------------
| fold: int
| Number of iterations for Cross-Validation
|
| test_size: float
| Fraction of sample to be used for valid and test set.
|
| LOO: int
| Number of sequences to leave-out in Leave-One-Out Cross-Validation
|
| epochs_min: int
| Minimum number of epochs for training neural network.
|
| batch_size: int
| Size of batch to be used for each training iteration of the net.
|
|
| stop_criterion: float
| Minimum percent decrease in determined interval (below) to continue
| training. Used as early stopping criterion.
|
| kernel: int
| Size of convolutional kernel.
|
| units: int
| Number of filters to be used for convolutional kernel.
|
| trainable_embedding; bool
| Toggle to control whether a trainable embedding layer is used or native
| one-hot representation for convolutional layers.
|
| num_fc_layers: int
| Number of fully connected layers following convolutional layer.
|
| units_fc: int
| Number of nodes per fully-connected layers following convolutional layer.
|
| drop_out_rate: float
| drop out rate for fully connected layers
|
| suppress_output: bool
| To suppress command line output with training statisitcs, set to True.
|
|
| Returns
| ---------------------------------------
|
| Monte_Carlo_CrossVal_WF(self, fold=5, test_size=0.25, epochs_min=5, batch_size=25, LOO=None, stop_criterion=0.001, kernel=5, units=12, weight_by_class=False, trainable_embedding=True, accuracy_min=None, weight_by_freq=True, plot_loss=False, num_fc_layers=0, units_fc=12, drop_out_rate=0.0, suppress_output=False)
| Monte Carlo Cross-Validation for Whole Sample Classifier
|
| If the number of samples is small but training the whole sample classifier, one
| can use Monte Carlo Cross Validation to train a number of iterations before assessing
| predictive performance.After this method is run, the AUC_Curve method can be run to
| assess the overall performance.
|
| Inputs
| ---------------------------------------
| fold: int
| Number of iterations for Cross-Validation
|
| test_size: float
| Fraction of sample to be used for valid and test set.
|
| LOO: int
| Number of samples to leave-out in Leave-One-Out Cross-Validation
|
| batch_size: int
| Size of batch to be used for each training iteration of the net.
|
| epochs_min: int
| Minimum number of epochs for training neural network.
|
| stop_criterion: float
| Minimum percent decrease in determined interval (below) to continue
| training. Used as early stopping criterion.
|
| kernel: int
| Size of convolutional kernel.
|
| units: int
| Number of filters to be used for convolutional kernel.
|
|
| weight_by_class: bool
| Option to weight loss by the inverse of the class frequency. Useful for
| unbalanced classes.
|
| trainable_embedding; bool
| Toggle to control whether a trainable embedding layer is used or native
| one-hot representation for convolutional layers.
|
| accuracy_min: float
| Optional parameter to allow alternative training strategy until minimum
| training accuracy is achieved, at which point, training ceases.
|
|
| weight_by_freq: bool
| Whether to use frequency to weight each sequence's features.
|
| plot_loss: bool
| To live plot the train/valid/test losses, set to True.
|
| num_fc_layers: int
| Number of fully connected layers following convolutional layer.
|
| units_fc: int
| Number of nodes per fully-connected layers following convolutional layer.
|
| drop_out_rate: float
| drop out rate for fully connected layers
|
| suppress_output: bool
| To suppress command line output with training statisitcs, set to True.
|
|
| Returns
| ---------------------------------------
|
| Motif_Identification_SS(self, group, p_val_threshold=0.05)
| Motif Identification for Single-Sequence Classifier
|
| This method looks for enriched features in the predetermined gropu
| and returns fasta files in directory to be used with "https://weblogo.berkeley.edu/logo.cgi"
| to produce seqlogos.
|
| Inputs
| ---------------------------------------
| group: string
| Class for analyzing enriched motifs.
|
| p_val_threshold: float
| Significance threshold for enriched features/motifs for
| Mann-Whitney UTest.
|
| Returns
| ---------------------------------------
|
| self.(alpha/beta)_group_features_ss: Pandas Dataframe
| Sequences used to determine motifs in fasta files
| are stored in this dataframe where column names represent
| the feature number.
|
| Motif_Identification_WF(self, group, p_val_threshold=0.05, cut=95, save_images=False)
| Motif Identification for Whole Sample Classifier
|
| This method looks for enriched features in the predetermined group
| and returns fasta files in directory to be used with "https://weblogo.berkeley.edu/logo.cgi"
| to produce seqlogos.
|
| Inputs
| ---------------------------------------
| group: string
| Class for analyzing enriched motifs.
|
| p_val_threshold: float
| Significance threshold for enriched features/motifs for
| Mann-Whitney UTest.
|
| cut: float
| Percentile to set threshold for what is considered as a sequence
| positive for a feature.
|
| save_images: bool
| In order to save violin plots of feature contribution to each cohort,
| set to True.
|
| Returns
| ---------------------------------------
|
| self.(alpha/beta)_group_features_wf: Pandas Dataframe
| Sequences used to determine motifs in fasta files
| are stored in this dataframe where column names represent
| the feature number.
|
| One_V_All(self, one_v_all)
| One_V_All Binary Classifier
|
| If one desires to create a binary classifier where they want to compare one cohort against all others, run this method
| to divide the data into two cohorts (class of interest vs all else).
|
| Inputs
| ---------------------------------------
| one_v_all: str
| To create binary classifier between class and all else, specify cohort to compare against all others.
|
| Returns
| ---------------------------------------
|
| Representative_Sequences_SS(self, top_seq=10)
| Identify most highly predicted sequences for each class for single sequence classifier.
|
| This method allows the user to query which sequences were most predicted to belong to a given class.
|
| Inputs
| ---------------------------------------
|
| top_seq: int
| The number of top sequences to show for each class.
|
| Returns
|
| self.Rep_Seq_SS: dictionary of dataframes
| This dictionary of dataframes holds for each class the top sequences and their respective
| probabiltiies for all classes. These dataframes can also be found in the results folder under Rep_Sequences_SS.
|
| ---------------------------------------
|
| Representative_Sequences_WF(self, top_seq=10)
| Identify most highly predicted sequences for each class for whole sample classifier.
|
| This method allows the user to query which sequences were most predicted to belong to a given class.
|
| Inputs
| ---------------------------------------
|
| top_seq: int
| The number of top sequences to show for each class.
|
| Returns
|
| self.Rep_Seq_WF: dictionary of dataframes
| This dictionary of dataframes holds for each class the top sequences and their respective
| probabiltiies for all classes. These dataframes can also be found in the results folder under Rep_Sequences_WF.
|
| ---------------------------------------
|
| Train_SS(self, batch_size=1000, epochs_min=10, stop_criterion=0.001, kernel=5, units=12, trainable_embedding=True, weight_by_class=False, num_fc_layers=0, units_fc=12, drop_out_rate=0.0, suppress_output=False)
| Train Single-Sequence Classifier
|
| This method trains the network and saves features values at the
| end of training for motif analysis.
|
| Inputs
| ---------------------------------------
| batch_size: int
| Size of batch to be used for each training iteration of the net.
|
| epochs_min: int
| Minimum number of epochs for training neural network.
|
| stop_criterion: float
| Minimum percent decrease in determined interval (below) to continue
| training. Used as early stopping criterion.
|
| kernel: int
| Size of convolutional kernel.
|
| units: int
| Number of filters to be used for convolutional kernel.
|
| trainable_embedding; bool
| Toggle to control whether a trainable embedding layer is used or native
| one-hot representation for convolutional layers.
|
| num_fc_layers: int
| Number of fully connected layers following convolutional layer.
|
| units_fc: int
| Number of nodes per fully-connected layers following convolutional layer.
|
| drop_out_rate: float
| drop out rate for fully connected layers
|
| suppress_output: bool
| To suppress command line output with training statisitcs, set to True.
|
|
| Returns
| ---------------------------------------
|
| Train_WF(self, batch_size=25, epochs_min=10, stop_criterion=0.001, kernel=5, units=12, weight_by_class=False, trainable_embedding=True, accuracy_min=None, weight_by_freq=True, plot_loss=False, num_fc_layers=0, units_fc=12, drop_out_rate=0.0, suppress_output=False)
| Train Whole-Sample Classifier
|
| This method trains the network and saves features values at the
| end of training for motif analysis.
|
| Inputs
| ---------------------------------------
| batch_size: int
| Size of batch to be used for each training iteration of the net.
|
| epochs_min: int
| Minimum number of epochs for training neural network.
|
| stop_criterion: float
| Minimum percent decrease in determined interval (below) to continue
| training. Used as early stopping criterion.
|
| kernel: int
| Size of convolutional kernel.
|
| units: int
| Number of filters to be used for convolutional kernel.
|
| weight_by_class: bool
| Option to weight loss by the inverse of the class frequency. Useful for
| unbalanced classes.
|
| trainable_embedding; bool
| Toggle to control whether a trainable embedding layer is used or native
| one-hot representation for convolutional layers.
|
| accuracy_min: float
| Optional parameter to allow alternative training strategy until minimum
| training accuracy is achieved, at which point, training ceases.
|
|
| weight_by_freq: bool
| Whether to use frequency to weight each sequence's features.
|
| plot_loss: bool
| To live plot the train/valid/test losses, set to True.
|
| num_fc_layers: int
| Number of fully connected layers following convolutional layer.
|
| units_fc: int
| Number of nodes per fully-connected layers following convolutional layer.
|
| drop_out_rate: float
| drop out rate for fully connected layers
|
| suppress_output: bool
| To suppress command line output with training statisitcs, set to True.
|
|
|
| Returns
| ---------------------------------------
|
| __init__(self, Name, max_length=40, device='/gpu:0')
| Initialize Training Object.
|
| Initializes object and sets initial parameters.
|
| Inputs
| ---------------------------------------
| Name: str
| Name of the object.
|
| max_length: int
| maximum length of CDR3 sequence
|
| device: str
| In the case user is using tensorflow-gpu, one can
| specify the particular device to build the graphs on.
|
| Returns
| ---------------------------------------
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
FILE
/home/sidhom/DeepTCR_Github/DeepTCR/DeepTCR/DeepTCR_S.py