首页 \ 问答 \ Web App架构问题(Web App architecture questions)

Web App架构问题(Web App architecture questions)

背景:我是一位在.Net平台上工作的中级Web应用程序开发人员。 我的大部分工作都是由我的同事或上级为我定义的,我遵循指示并完成工作完全没有问题。

手头的任务:我最近被一位老朋友要求重新开始他的网络应用程序。 他的应用程序非常陈旧,而且他总是被打破。 有问题的应用程序是库存/ CRM应用程序,目前每个客户都需要新安装应用程序(通常通过在同一服务器上的不同域上部署并指向新数据库来完成)。

目前,如果任何客户想要对表单进行任何修改(例如附加字段,新功能等),我的朋友就会将这些字段手动添加到表单,脚本,数据库等。因此,此应用程序的所有安装都是唯一的。 没有一个单一的源代码库,没有一个单一版本的这个应用程序。 一般而言,新功能会加入到其他网站中,但仍按个别网站逐个网站完成。

我将在一个非常模块化的基础上接近这一点。 最初,我将编写一个模块来查询外部Web服务的某些数据,并显示和存储它,并定期自动更新它。 下一个模块可能用于存储和显示库存数据。 这种方式我想随着时间的推移重复他的应用程序的当前功能集100%,但增量。

百万美元的问题

  1. 我想让应用具有用户可配置的表单字段。 用户应该能够进入管理页面,创建特定类别的新表单页面,然后指定他想要的字段。 他可以说'创建一个名为Item#的新文本字段并将其设置为需求',并将其存储到某个位置。所有表单都将根据用户配置的内容动态呈现给用户。这是一种很好的方式不知道客户可能想要什么形式的问题,从而能够存储和显示任何形式的表单数据?我应该在这里遵循什么样的设计模式?

    我对asp.net和.net框架一般都很熟悉,并且对javascript,html,silverlight,jquery,c#等具有相当的知识。我可以以一种很好的方式绕过web应用程序,但我不确定是什么我应该用这种框架或技术来完成这项任务。 ASP.net 3.5 webforms会成为一种方式吗? 或者我应该看看ASP.NET MVC? 我是否使用jquery和ajax完成前端和后端的解耦? 或者将一个正常的asp.net页面与抛出的一个Ajax抛出的代码隐藏在一起是当天的顺序?

只是在开始之前寻找一般建议。

我目前正在考虑使用ASP.NET 3.5 webforms,用于客户端动画,UI,操作和数据验证的jQuery,以及用于后端的sqlserver + .net或wcf webservice。

你的建议一如既往地受到重视。


Background: I am an intermediate web app developer working on the .Net Platform. Most of my work has been defined pretty well for me by my peers or superiors and I have no problem following instructions and getting the job done.

The task at hand: I was recently asked by an old friend to redo his web app from scratch. His app is extremely antiquated and he is getting overwhelmed by it breaking all the time. The app in question is an inventory / CRM application and currently each customer requires a new install of the app (usually accomplished by deploying it on a different domain on the same server and pointing to a new database).

Currently if any client wants any modifications to the forms such as additional fields, new features, etc my friend goes in and manually adds those fields to the forms, scripts, database etc. As a result all installs of this application are unique. There is no one singular source repository and no one single version of this app. Generally new features are overtime rolled into the other sites, but still this is done on an individual site by site basis.

I will be approaching this on a very modular basis. Initially I will be coding a module that will query an external web service for some data, display and store it, and periodically update it automatically. The next module will likely be for storing and displaying inventory data. This way I want to over time duplicate the current feature set of his app 100% but do it incrementally.

The Million Dollar Questions

  1. I want to make the app have user configurable form fields. The user should be able to go to an admin page, create a new forms page of a certain category, and then specify what fields he wants in there. He could say 'create a new text field called Item # and make it a requirement" and that will get stored somewhere. All forms will be dynamically rendered to screen based on what the user has configured. Is this a good way to go about the problem of having no idea what a customer could want in a form? and thus be able to store and display form data of any sort ? What sort of design pattern should I follow here?

    I am familiar with asp.net and the .net framework in general and have decent knowledge of javascript, html, silverlight, jquery, c# etc etc. I can work my way around web apps in a good way, but I am not sure what sort of framework or tech I should use to accomplish this task. Would ASP.net 3.5 webforms be the way to go? or should I look into ASP.NET MVC? Do I use jquery and ajax for complete decoupling of frontend and backend ? or will a normal asp.net page with some spattering of ajax thrown in working with a codebehind be the order of the day?

Just looking for general advice before I start.

I am currently thinking of using ASP.NET 3.5 webforms, jquery for clientside animation, ui, manipulation and data validation, and sqlserver + a .net or wcf webservice for backend.

Your advice is much appreciated as always.


原文:https://stackoverflow.com/questions/1298373
更新时间:2022-04-20 16:04

最满意答案

channel_swapRGB转换为BGR ,如果您使用基于[1]中的注释的参考图像网络模型,则显然这是必要的。 在你的情况下,图像是灰度的,所以你可能没有三个通道。 您可能需要将其设置为(0,0,0),但即使这可能也无济于事(我不确定channel_swap的确切实施情况)。 如果这没有帮助,最简单的解决方案可能是通过将每个像素分成具有相同值的三个值(RGB)来预处理数据。 之后,您可能会完全删除channel_swap ,因为您的频道具有相同的值,并且交换它们是不可操作的。

意思是将从输入数据中减去将其居中。 (请记住,神经网络需要数据具有零均值,而输入图像通常具有正的均值,因此需要减法)。 您减去的平均值应与用于训练的平均值相同,因此使用与该模型相关的文件中的平均值是正确的。 不过,我不确定你是否应该调用.mean(1) - 你是否从某个例子中得到了这条线? 如果是的话,那很可能是正确的做法。

raw_scale是您的输入数据的比例。 模型期望像素被归一化,所以如果你的输入数据的值在0到255之间,那么raw_scale设置为255是正确的。 如果您的数据的值介于0和1之间,则应将raw_scale设置为1。

最后,根据我对[2]中的评论的理解,您不需要提供image_dims

[1] https://github.com/BVLC/caffe/blob/master/python/caffe/io.py#L204

[2] https://github.com/BVLC/caffe/blob/master/python/caffe/classifier.py#L18


The channel_swap is to reverse RGB into BGR, which is apparently necessary if you use a reference image net model, based on a comment in [1]. In your case the images are greyscale, so you probably do not have three channels. You might need to set it to (0, 0, 0), but even that might not help (I am unsure on the exact implementation of channel_swap). If that does not help, the simplest solution might be to preprocess you data by splitting every pixel into three values (RGB) with equal values. After that you might drop channel_swap altogether, because your channels have the same value, and swapping them is a no-op.

Mean is what will be subtracted from your input data to center it. (Remember that neural networks need the data to have zero mean, while the input images usually have positive mean, hence the need of the subtraction). The mean you subtract should be the same that was used for training, so using mean from the file associated with the model is correct. I am not sure, however, on whether you should call .mean(1) on it -- did you get that line from some example? If yes, then it is most likely the correct thing to do.

raw_scale is a scale of your input data. The model expects pixels to be normalized, so if your input data has values between 0 and 255, then raw_scale set to 255 is correct. If your data has values between 0 and 1, then raw_scale should be set to 1.

Finally, based on my understanding of the comment in [2] you do not need to provide image_dims

[1] https://github.com/BVLC/caffe/blob/master/python/caffe/io.py#L204

[2] https://github.com/BVLC/caffe/blob/master/python/caffe/classifier.py#L18

相关问答

更多
  • 将图层从“loss1 / classifier”重命名为“loss1 / classifier_retrain”。 在微调模型时,这就是Caffe的作用: # pseudo-code for layer in new_model: if layer.name in old_model: new_model.layer.weights = old_model.layer.weights 你得到一个错误,因为“loss1 / classifier”的权重是1000级分类问题(1000x1024), ...
  • 我不认为你可以用python接口在caffe中做到这一点。 但我认为可以使用c ++来完成:在c ++中你可以访问Blob的mutable_gpu_data() 。 您可以编写在设备上运行的代码,并直接从gpu“填充”输入Blob的mutable_gpu_data() 。 一旦你做了这个更新,caffe应该能够从那里继续它的net->forward() 。 UPDATE 2017年9月19日PR#5904合并为主人。 这个PR通过python接口公开了blob的GPU指针。 您可以直接从python访问bl ...
  • 我想通了,deploy.prototxt有一些input_param不匹配。 奇怪的行为。 I figured it out, the deploy.prototxt had some input_param mismatch. Strange behavior.
  • Python公开.caffemodel文件中的数据。 它可以作为数组访问。 例如, net = caffe.Net('path/to/conv.prototxt', 'path/to/conv.caffemodel', caffe.TEST) W = net.params['con_1'][0].data[...] b = net.params['con_1'][1].data[...] 您可以将此数据复制到新文件中,并将其另存为.caffemodel文件。 看看这个和这个 。 Python expose ...
  • channel_swap将RGB转换为BGR ,如果您使用基于[1]中的注释的参考图像网络模型,则显然这是必要的。 在你的情况下,图像是灰度的,所以你可能没有三个通道。 您可能需要将其设置为(0,0,0),但即使这可能也无济于事(我不确定channel_swap的确切实施情况)。 如果这没有帮助,最简单的解决方案可能是通过将每个像素分成具有相同值的三个值(RGB)来预处理数据。 之后,您可能会完全删除channel_swap ,因为您的频道具有相同的值,并且交换它们是不可操作的。 意思是将从输入数据中减去将 ...
  • 频道数量 嗯,第一个问题很重要。 VGG模型是用3个通道制作的彩色图像...所以,它对你的情况来说不是正确的型号。 我不确定是否有黑白图像的模型,但你应该搜索它们。 我不知道是否能正常工作的解决方法是制作3份mainModel输出。 tripleOut = Concatenate()([mainModel.output,mainModel.output,mainModel.output]) 图表已断开 这意味着您的代码中没有任何地方,您在fullModel的输入和输出之间创建了一个连接。 您必须将main ...
  • 如果没有您的具体应用,很难指出适当的预训练模型。 但是,独立于您的具体应用,我建议如下: 您不一定需要预先训练好的模型来支持更大的图像尺寸 - 根据您的应用,您需要重新训练最后几层(即完全连接的层)。 然而,卷积层(以及汇集层,局部响应归一化层,ReLU层等)与图像大小无关。 因此,您可以将卷积层形成预先训练的模型(例如,来自AlexNet或参考BVLC模型 ),并根据您的需要调整完全连接的层,并仅重新训练这些层。 不过,这里有一些图像尺寸较大的模型(您可以在Caffe模型动物园中找到所有这些模型 )。 但 ...
  • 您需要手动将train_val.prototxt更改为deploy.protoxt 。 但是,这种变化比你想象的要容易。 将train_val.prototxt复制到新的deploy.prototxt并根据以下步骤编辑deploy.prototxt : 第一次改变:投入。 您需要告诉caffe将内存分配给稍后手动提供的图像,而不是使用训练/验证数据集(通常表示为"Data" / "HDF5Data" / "Imagedata"图层)。 为此,您需要删除现有的输入图层(适用于TRAIN和TEST阶段),并将其 ...
  • 我假设您在初始化后尝试微调整个网络,否则您可以简单地使用从AlexNet提取的功能并在FC层开始训练。 对于微调,您需要在第一个网络上复制权重(一个具有相同名称),并使第二个网络与第一个网络共享权重。 看看这个帖子。 或者更确切地说是Evan Shelmar的回复。 I presume that you are trying to finetune the whole network after initialization, otherwise you could simply use features ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)