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
| BoxLayout: | |
| orientation: "vertical" | |
| Label: | |
| text: "Result of Addition." | |
| id: label | |
| BoxLayout: | |
| orientation: "horizontal" | |
| TextInput: | |
| hint_text: "Enter First Number." | |
| id: textinput1 |
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
| import kivy.app | |
| class FirstApp(kivy.app.App): | |
| def add_nums(self, root): | |
| num1 = float(self.root.ids["textinput1"].text) | |
| num2 = float(self.root.ids["textinput2"].text) | |
| result = num1 + num2 | |
| self.root.ids["label"].text = str(result) |
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
| import numpy | |
| import PIL.Image | |
| def sigmoid(inpt): | |
| return 1.0/(1.0+numpy.exp(-1*inpt)) | |
| def relu(inpt): | |
| result = inpt | |
| result[inpt<0] = 0 | |
| return result |
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
| BoxLayout: | |
| orientation: "vertical" | |
| Label: | |
| text: "Predicted Class Appears Here." | |
| font_size: 30 | |
| id: label | |
| BoxLayout: | |
| orientation: "horizontal" | |
| Image: | |
| source: "apple.jpg" |
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
| import kivy.app | |
| import Fruits | |
| class FirstApp(kivy.app.App): | |
| def classify_image(self): | |
| img_path = self.root.ids["img"].source | |
| img_features = Fruits.extract_features(img_path) | |
| predicted_class = Fruits.predict_output("weights.npy", img_features, activation="sigmoid") |
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
| import numpy | |
| import matplotlib.pyplot | |
| input_data = numpy.array([[1, 4], | |
| [4, 1], | |
| [3, 2], | |
| [2, 1]]) | |
| output_data = numpy.array([0, 0, 1, 1]) | |
| matplotlib.pyplot.scatter(input_data[:2, 0], input_data[:2, 1], color='blue', linewidths=5) |
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
| import kivy.app | |
| import kivy.uix.gridlayout | |
| import kivy.uix.button | |
| class BuzzleApp(kivy.app.App): | |
| def build(self): | |
| gridLayout = kivy.uix.gridlayout.GridLayout() | |
| button = kivy.uix.button.Button(text="Button") | |
| gridLayout.add_widget(button ) |
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
| import kivy.app | |
| import kivy.uix.gridlayout | |
| import kivy.uix.boxlayout | |
| import kivy.uix.button | |
| import kivy.uix.textinput | |
| import kivy.uix.label | |
| import numpy | |
| class BuzzleApp(kivy.app.App): |