Converting
convert_model(train_sequences, val_sequences, test_sequences, parameters, dir_path, training_done)
Convert trained model to ONNX.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
train_sequences |
List[Tuple[pd.DataFrame, float]]
|
Training sequences. |
required |
val_sequences |
List[Tuple[pd.DataFrame, float]]
|
Validation sequences. |
required |
test_sequences |
List[Tuple[pd.DataFrame, float]]
|
Test sequences. |
required |
parameters |
str
|
Parameters used for training. |
required |
dir_path |
str
|
Directory path where the model is saved. |
required |
training_done |
Dict[str, bool]
|
Flag indicating if the training is done. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dictionary of outputs from the conversion step. |
Source code in make_us_rich/pipelines/converting/nodes.py
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 |
|
to_numpy(tensor)
Converts a tensor to numpy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor |
torch.Tensor
|
Tensor to be converted. |
required |
Returns:
Type | Description |
---|---|
numpy.ndarray
|
Source code in make_us_rich/pipelines/converting/nodes.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
validate_model(dir_path, conversion_outputs)
Check if the converted model is valid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dir_path |
str
|
Directory path where the model is saved. |
required |
conversion_outputs |
Dict[str, Any]
|
Dictionary of outputs from the conversion step. |
required |
Returns:
Type | Description |
---|---|
Dict[str, bool]
|
Flag indicating if the model is valid. |
Source code in make_us_rich/pipelines/converting/nodes.py
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 |
|
Last update:
2022-05-04