(act, one_hot=False)
| 98 | |
| 99 | |
| 100 | def action_encoding(act, one_hot=False): |
| 101 | act_int = action_dict[act] |
| 102 | if one_hot: |
| 103 | result = np.zeros(len(action_dict), dtype=int) |
| 104 | result[act_int] = 1 |
| 105 | return result |
| 106 | else: |
| 107 | return act_int |
| 108 | |
| 109 | |
| 110 | def data_process_sensor(data_str, length=150): |
no outgoing calls
no test coverage detected
searching dependent graphs…