Commit 71335b7a authored by Carlos GO's avatar Carlos GO
Browse files

loading

parent 58a6933e
......@@ -32,9 +32,33 @@ See README in each folder for details on how to use each component.
## Usage
### Using the pre-trained model
### Loading a trained model
* You can use the model used for the paper, or load a trained model you trained yourself (see next section)
Loading the fully trained RNAmigos model and using standard pytorch API:
```
from tools.learning_utils import load_model
model,meta = load_model('data/rnamigos')
nx_graph, dgl_graph = nx_to_dgl(g, edge_map, nucs=nucs)
with torch.no_grad():
predicted_fingerprint,_ = model(graph)
fp_pred = fp_pred.detach().numpy() > 0.5
```
Making predictions for every graph in a folder.
```
from tools.learning_utils import inference_on_dir
graph_folder = "data/predict_plz"
Y = inference_on_dir("models/rnamigos", graph_dir)
```
### Training your own model
A basic example is training on the annotated graphs inside `data/annotated` on default settings.
......
......@@ -19,7 +19,7 @@ Most important model parameters which can be specified from the command line:
For a full list of command line options run:
```
python learning/meain.py -h
python learning/main.py -h
```
All necessary files are saved in a folder inside `results/` with the run id specified at command ine (`-n`)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment