Getting started:
Related tutorials:
| import torch | |
| from torch import nn | |
| from torch.autograd import Variable | |
| import torch.nn.functional as F | |
| import torch.optim as optim | |
| # toy feed-forward net | |
| class Net(nn.Module): | |
| def __init__(self): |
Getting started:
Related tutorials:
| FROM golang:1.9 | |
| WORKDIR /go/src/github.com/purplebooth/example | |
| COPY . . | |
| RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go | |
| FROM scratch | |
| COPY --from=0 /go/src/github.com/purplebooth/example/main /main | |
| CMD ["/main"] |
Picking the right architecture = Picking the right battles + Managing trade-offs
| class Node(): | |
| """A node class for A* Pathfinding""" | |
| def __init__(self, parent=None, position=None): | |
| self.parent = parent | |
| self.position = position | |
| self.g = 0 | |
| self.h = 0 |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.