This file contains 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 __future__ import annotations # don't crash on non-imported libraries when type checking | |
from typing import Dict, Optional, Union | |
import torch | |
from torch import nn as nn | |
import pytorch_lightning as pl | |
from pytorch_lightning import Trainer | |
from torch.utils.data import Dataset, DataLoader | |
from torch.nn import functional as F | |
This file contains 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 abc import abstractmethod | |
import torch | |
from torch import nn as nn | |
import pytorch_lightning as pl | |
from pytorch_lightning.metrics.functional import accuracy, to_categorical | |
from pytorch_lightning import Trainer | |
from torch.utils.data import Dataset, DataLoader | |
from torch.nn import functional as F | |
This file contains 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 functools import partial | |
import torch | |
import torch.optim as optim | |
from torch.utils.data import Dataset | |
import pytorch_lightning as pl | |
from pytorch_lightning import Trainer | |
# partial to give all params, except the data | |
hparams = { | |
"criterion": torch.nn.BCELoss(), # F.cross_entropy(), # loss function |
This file contains 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
------------------------------------------------------------ | |
C:\Python34\lib\site-packages\pip\__main__.py run on 12/19/16 20:48:36 | |
Kivy-1.9.2.dev0-cp34-cp34m-win_amd64.whl is not a supported wheel on this platform. | |
Exception information: | |
Traceback (most recent call last): | |
File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main | |
status = self.run(options, args) | |
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 257, in run | |
InstallRequirement.from_line(name, None)) | |
File "C:\Python34\lib\site-packages\pip\req.py", line 167, in from_line |
This file contains 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
Traceback (most recent call last): | |
File "main.py", line 5, in <module> | |
from kivy.app import App | |
File "C:\Python35\lib\site-packages\kivy\app.py", line 318, in <module> | |
from kivy.config import ConfigParser | |
File "C:\Python35\lib\site-packages\kivy\config.py", line 305, in <module> | |
from kivy import kivy_config_fn | |
ImportError: cannot import name 'kivy_config_fn' |
This file contains 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 kivy.uix.label import Label | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.base import runTouchApp | |
from kivy.lang import Builder | |
Builder.load_string(''' | |
<TestWidget>: | |
Label: | |
text: '速 dsf あい' |
This file contains 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
<ScatterTextWidget>: | |
Label: | |
text: root.txt | |
font_name: 'TakaoPMincho.ttf' | |
font_size: sp(48) |
This file contains 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
<ScatterTextWidget>: | |
Label: | |
# This doesn't work: | |
text: "愛 あい" | |
# This font should be in Windows already, so you have to copy that file to this folder: | |
font_name: 'TakaoPMincho.ttf' | |
font_size: sp(48) |
This file contains 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 kivy.uix.label import Label | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.properties import StringProperty | |
from kivy.base import runTouchApp | |
from kivy.lang import Builder | |
Builder.load_string(''' | |
<ScrollableLabel>: |
This file contains 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 kivy.uix.label import Label | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.properties import StringProperty | |
from kivy.base import runTouchApp | |
from kivy.lang import Builder | |
Builder.load_string(''' | |
<ScrollableLabel>: |