Comments (4)
In GitLab by @mvesin on Jun 23, 2021, 15:53
marked the checklist item implement local training as incomplete
from fedbiomed.
In GitLab by @mvesin on Jun 24, 2021, 09:34
marked the checklist item implement local training as completed
from fedbiomed.
In GitLab by @mvesin on Jun 24, 2021, 13:36
- Why do we need to import
torch
&F
before testing, as they seem to be already imported before when defining the model ?
%%writefile "$model_file"
import torch
import torch.nn as nn
from fedbiomed.common.torchnn import Torchnn
import torch.nn.functional as F
# you can use any class name eg:
# class NetAlter(Torchnn):
class Net(Torchnn):
def __init__(self):
...
and then :
# torch & F are not know if we don't import them here
import torch
import torch.nn.functional as F
test_set = datasets.MNIST(root = TMP_DIR + '/local_mnist_testing.tmp', download = True, train = False, transform = transform)
test_loader = torch.utils.data.DataLoader(test_set, batch_size=64, shuffle=True)
...
-
TLDR: this is normal
-
explanation :
%%writefile
indicates that the content of the cell will be saved to a file not executed. Thus the import was not executed in the notebook (and those modules/functions never available in context of the notebook).- nevertheless, these imports are executed in
localJob.__init__()
when importing the classNet
from the module corresponding to%%writefile
. So the corresponding symbols are available within the context of theNet()
object, which is used for training. You can check it with this, which givesF is defined
at execution :
class Net(Torchnn):
def __init__(self):
super(Net, self).__init__()
try:
F
print("F IS DEFINED")
except NameError:
print("F IS NOT DEFINED")
print(dir())
print(globals().keys())
...
- also note that
F
does not appear indir()
but appears inglobals().keys()
, as it is not defined inNet
's namespace but in the enclosing module's namespace. Some context about python namespaces here
from fedbiomed.
In GitLab by @mvesin on Jul 5, 2021, 11:44
marked the checklist item compare with fed training (accuracy) as completed
from fedbiomed.
Related Issues (20)
- Small dysfunctions in User Guide HOT 1
- Support for alternate EDITOR is broken when viewing the training plan
- Experiment `_create_object` should not be in experiment class HOT 1
- Clean generated data during the end2end tests on the researcher side HOT 1
- Create a function to configure secure aggregation environment for end2end tests and write tests
- Write helper functions for training plan approval to be used in e2e tests
- Replace legacy end2end tests by new end2end testing machinery
- Create test cases to run examples in tutorials/pytorch tutorials/sklearn HOT 3
- DefaultStrategy only receives successful training replies
- Reorganize existing end2end tests in 'tests/end2end/' directory
- Building `gui` container fails because of missing `fedbiomed-node` environment HOT 2
- Remove old end-to-end tests: Github actions and test scripts
- Add a way to execute cells / distinguish cells in notebooks for end2end tests HOT 1
- Continue #1091 - GUI container execution fails
- Add more debug messages into transport module
- Design proposal for structured datasets
- Node fails during training with "gRPC already finished" error message
- Researcher component needs better memory management HOT 2
- [BUG]: cannot load a `nifti` image in the medical folder dataset of Fed-BioMed if it contains dots (`.`) in its name HOT 1
- [BUG]: `clean_researcher.py` does not clean `Researcher` well
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fedbiomed.