Comments (7)
好的,感谢大佬,最近在复现tinyimagenet在pfedla上的效果,再次感谢你的解答。
from fl-bench.
class CNNWithBatchNorm(nn.Module):
def init(self, dataset):
super(CNNWithBatchNorm, self).init()
self.block1 = nn.ModuleDict(
{
"conv": nn.Conv2d(ARGS[dataset][0], 64, 5, 1, 2),
"bn": nn.BatchNorm2d(64),
"relu": nn.ReLU(True),
"pool": nn.MaxPool2d(2),
}
)
self.block2 = nn.ModuleDict(
{
"conv": nn.Conv2d(64, 64, 5, 1, 2),
"bn": nn.BatchNorm2d(64),
"relu": nn.ReLU(True),
"pool": nn.MaxPool2d(2),
}
)
self.block3 = nn.ModuleDict(
{
"conv": nn.Conv2d(64, 128, 5, 1, 2),
"bn": nn.BatchNorm2d(128),
"relu": nn.ReLU(True),
}
)
self.block4 = nn.ModuleDict(
{"fc": nn.Linear(ARGS[dataset][1], 2048), "relu": nn.ReLU(True)}
)
self.block5 = nn.ModuleDict({"fc": nn.Linear(2048, 512), "relu": nn.ReLU(True)})
self.block6 = nn.ModuleDict({"fc": nn.Linear(512, ARGS[dataset][2])})
def forward(self, x):
x = self.block1["conv"](x)
x = self.block1["bn"](x)
x = self.block1["relu"](x)
x = self.block1["pool"](x)
x = self.block2["conv"](x)
x = self.block2["bn"](x)
x = self.block2["relu"](x)
x = self.block2["pool"](x)
x = self.block3["conv"](x)
x = self.block3["bn"](x)
x = self.block3["relu"](x)
x = x.view(x.shape[0], -1)
x = self.block4["fc"](x)
x = self.block4["relu"](x)
x = self.block5["fc"](x)
x = self.block5["relu"](x)
x = self.block6["fc"](x)
return x
我希望能运行上面这个模型的HpFedla
from fl-bench.
如果只是简单的移用,你可以把整个 CNNWithBatchNorm
的实现先拷贝到 models.py
然后在 CustomModel
中将 self.base
设置为 CNNWithBatchNorm
的一个实例,self.classifier = nn.Identity()
from fl-bench.
那Hpfedla的分层保留还会实现吗?
from fl-bench.
应该是会的
from fl-bench.
我在对比了pfedla和这个bench里的之后发现精度差异还是比较大的,而且bench里的pfedla似乎会出现精度越来越低的情况
from fl-bench.
我并不能保证bench 中的算法能够完全复现 papper 里的数据。那些没有公开源代码的尤甚。pfedla 是一个(我没记错的话)连使用的模型架构都没有公开的算法。我这能做的也只是根据paper提供的算法伪代码将其表达出来。至于最终模型的效果如何,取决于多个因素:模型架构,实验超参,随机种子...
如果给你带来困扰了的话,十分抱歉。FL-bench 并不保证搭载的算法能 100% 原汁原味复现出 paper 上的结果(对于任何其他算法都是,除了pFedSim,那是我自己写的)
而你说的精度越来越低的情况,我会在近期检查一下pfedla的代码,如果有bug我会修复。也欢迎你如果找出bug提 issue 或 pr 来为这个项目做贡献。
from fl-bench.
Related Issues (20)
- Dataset problem HOT 2
- runtime erro HOT 4
- python generate_data.py -d medmnistC -a 0.1 -cn 100 HOT 8
- Comparison of the results of FedAvg on Cifar with the original paper HOT 3
- question HOT 2
- please can somebody helps me
- please can somebody helps me to solve this problem HOT 5
- COPY failed: forbidden path outside the build context: ../ () HOT 3
- Changing "finetune_epoch" doesn't affect test accuracies. HOT 4
- problem run pre-treatment HOT 7
- [Implementation Error] algorithm "ccvr" code lost a "()" HOT 5
- Are u considering to add the FedMix algo in the repository? HOT 2
- There is no VALIDATION set for FEMNIST LEAF - help wanted HOT 8
- FL-bench welcomes PRs
- Hi, thanks for your contributions to the FL community, you are extremely a talented person
- Elastic aggregation and Non-iid data by using dirichlet distribution scenario HOT 5
- why after fine tunning accuracy shows 0% ?? HOT 10
- server aggregation about BN layers HOT 5
- pfedla with high cpu occupy and low gpu occupy HOT 4
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 fl-bench.