This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -e | |
| # Function to display progress | |
| show_progress() { | |
| echo "$1 ... " | |
| } | |
| # Function to display success |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def activation(output): | |
| """ | |
| Activation function | |
| :param output: Perceptron algorithm result | |
| :return: 1 if output >= 0 and -1 if output < 0 | |
| """ | |
| if output >= 0: | |
| res = 1 | |
| else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import namedtuple | |
| from dataclasses import dataclass, field | |
| from typing import List | |
| EC = namedtuple('EC', ['rc', 'hc', 'di', 'ga', 're']) | |
| @dataclass(order=True) | |
| class Node: | |
| key: str |