Datasets:
File size: 4,400 Bytes
8379ea4 |
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 |
{
"cells": [
{
"cell_type": "markdown",
"id": "3b921d47-d760-4438-b754-8a6d805e9415",
"metadata": {},
"source": [
"### The GAN models were trained using a conda environment. Below you can find how to create the same environment to train GAN models and generate sequences"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0cd67f38-a1bf-4234-bbad-cf5baa718e59",
"metadata": {},
"outputs": [],
"source": [
"# %%bash\n",
"# conda create --name deeplearning_py36_tf114_gpu python=3.6 tensorflow-gpu=1.14.0 keras-gpu=2.2.4\n",
"# conda activate deeplearning_py36_tf114_gpu\n",
"# conda install numpy=1.16.2 matplotlib=3.1.1 shap=0.29.3 ipykernel=5.1.2"
]
},
{
"cell_type": "markdown",
"id": "a03be807-48c6-42c9-90ec-f1a2e16d95f1",
"metadata": {},
"source": [
"### Below you can find explanation of parameters that were used to train model and generate sequences.\n",
"#### (These variables can be found in the beginning of __wgan_gp.py__)"
]
},
{
"cell_type": "markdown",
"id": "3a272a4a-71da-40ac-9906-a74c62bfe3f8",
"metadata": {},
"source": [
"__BATCH_SIZE__: Batch size (how many regions will be used in each iteration). \\\n",
"__ITERS__: Number of batch iterations to train the model. \\\n",
"__SEQ_LEN__: Length of the input sequences. \\\n",
"__SEQ_DIM__: Dimension of the input sequences. (4 nucleotides) \\\n",
"__DIM__: Dimension of the model. It is used in latent space and convolutional layers. \\\n",
"__CRITIC_ITERS__: How many training iterations will be done for Discriminator for each Generator iteration. \\\n",
"__LAMBDA__: Hyperparameter for gradient penalty. \\\n",
"__loginterval__: Once every N iteration the log will be saved. \\\n",
"__seqinterval__: Once every N iteration the sample sequences will be generated. \\\n",
"__modelinterval__: Once every N iteration the model files will be saved. \\\n",
"__selectedmodel__: When generating sequences, the iteration number of the model you want to use. \\\n",
"__suffix__: When generating sequences, the suffix to add to the header of the fasta regions. \\\n",
"__ngenerate__: When generating sequences, number of sequences you want to generate relative to batchsize. Example: 1 (128 sequences will be generated if the batch size is 128) \\\n",
"__outputdirc__: Path the to output folder. \\\n",
"__fastafile__: Path to the fasta file to use as real enhancers "
]
},
{
"cell_type": "markdown",
"id": "9a4ab1ed-8973-4026-9d66-98f2ca6d764d",
"metadata": {},
"source": [
"### How to run the model"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "832087a8-fa27-4250-bb4e-066a52ded090",
"metadata": {},
"outputs": [],
"source": [
"# %%bash\n",
"# conda activate deeplearning_py36_tf114_gpu\n",
"# python wgan_gp.py"
]
},
{
"cell_type": "markdown",
"id": "efc65b44-515e-4dd8-9bb9-81d1f0ceaa13",
"metadata": {},
"source": [
"### This will result following outputs"
]
},
{
"cell_type": "markdown",
"id": "cb3d54fd-11d2-4fa8-92c7-b85c4007ad00",
"metadata": {},
"source": [
"__./models/__: Folder containing saved model's weight files. \\\n",
"__./samples_ACGT/__: Folder containing sampled sequences during training. \\\n",
"__./samples_raw/__: Folder containing sampled sequences (in their raw format) during training. \\\n",
"__./gen_seq/__: Folder containing generated sequences after training. \\\n",
"__./disc.json__: Architecture file of the discriminator. \\\n",
"__./gen.json__: Architecture file of the generator. \\\n",
"__./d_g_loss.pkl__: Logged loss values during training. "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9aa94e0f-263e-4ad1-967e-059770526381",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Deeplearning tf1.15",
"language": "python",
"name": "deeplearning_tf115"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|